diff --git a/packages/cactus-plugin-ledger-connector-xdai/README.md b/packages/cactus-plugin-ledger-connector-xdai/README.md new file mode 100644 index 0000000000..17998d2d4a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/README.md @@ -0,0 +1,160 @@ +# `@hyperledger/cactus-plugin-ledger-connector-xdai` + +This plugin provides `Cactus` a way to interact with Xdai networks. Using this we can perform: +* Deploy Smart-contracts through bytecode. +* Build and sign transactions using different keystores. +* Invoke smart-contract functions that we have deployed on the network. +## Summary + + - [Getting Started](#getting-started) + - [Architecture](#architecture) + - [Usage](#usage) + - [Prometheus Exporter](#prometheus-exporter) + - [Runing the tests](#running-the-tests) + - [Built With](#built-with) + - [Contributing](#contributing) + - [License](#license) + - [Acknowledgments](#acknowledgments) + +## Getting Started + +Clone the git repository on your local machine. Follow these instructions that will get you a copy of the project up and running on +your local machine for development and testing purposes. + +### Prerequisites + +In the root of the project to install the dependencies execute the command: +```sh +npm run configure +``` + +### Compiling + +In the project root folder, run this command to compile the plugin and create the dist directory: +```sh +npm run tsc +``` + +### Architecture +The sequence diagrams for various endpoints are mentioned below + +#### run-transaction-endpoint +![run-transaction-endpoint sequence diagram](docs/architecture/images/run-transaction-endpoint.png) +The above diagram shows the sequence diagram of run-transaction-endpoint. User A (One of the many Users) interacts with the API Client which in turn, calls the API server. API server then executes transact() method which is explained in detailed in the subsequent diagrams. +![run-transaction-endpoint transact() method](docs/architecture/images/run-transaction-endpoint-transact.png) +The above diagram shows the sequence diagraom of transact() method of the PluginLedgerConnectorXdai class. The caller to this function, which in reference to the above sequence diagram is API server, sends RunTransactionV1Request object as an argument to the transact() method. Based on the type of Web3SigningCredentialType, corresponsing responses are sent back to the caller. +![run-transaction-endpoint transactCactusKeychainRef() method](docs/architecture/images/run-transaction-endpoint-transact-cactuskeychainref.png) +The above diagram shows transactCactusKeychainReference() method being called by the transact() method of the PluginLedgerConnector class when the Web3SigningCredentialType is CACTUSKEYCHAINREF. This method inturn calls transactPrivateKey() which calls the signTransaction() method of web3 library. +![runtransaction-endpoint transactPrivateKey() method](docs/architecture/images/run-transaction-endpoint-transact-privatekey.png) +The above diagram shows transactPrivateKey() method being called by the transact() method of the PluginLedgerConnector class when the Web3SigningCredentialType is PRIVATEKEYHEX. This method then calls the signTransaction() method of the web3 library. +![run-transaction-endpoint transactSigned() method](docs/architecture/images/run-transaction-endpoint-transact-signed.png) +The above diagram shows transactSigned() method being called by the transact() method of the PluginLedgerConnector class when the Web3SigningCredentialType is NONE. This method calls the sendSignedTransaction() of the web3 library and then calls pollForTxReceipt() method. +![run-transaction-endpoint pollForTxReceipt() method](docs/architecture/images/run-transaction-endpoint-transact-pollfortxreceipt.png) +The above diagram shows pollForTxReceipt() method which is called by the transactSigned() method as described in the previous sequence diagram. This method waits for the block confirmation in a loop and then sends the corresponding response back to the caller. + +### Usage + +To use this import public-api and create new **PluginFactoryLedgerConnector**. Then use it to create a connector. +```typescript +const factory = new PluginFactoryLedgerConnector({ + pluginImportType: PluginImportType.LOCAL, + }); + const connector: PluginLedgerConnectorXdai = await factory.create({ + rpcApiHttpHost, + instanceId: uuidv4(), + pluginRegistry: new PluginRegistry(), + }); +``` +You can make calls through the connector to the plugin API: + +```typescript +async invokeContract(req: InvokeContractV1Request):Promise; +async transactSigned(rawTransaction: string): Promise; +async transactPrivateKey(req: RunTransactionV1Request): Promise; +async transactCactusKeychainRef(req: RunTransactionV1Request):Promise; +async deployContract(req: DeployContractV1Request):Promise; +async signTransaction(req: SignTransactionRequest):Promise>; +``` + +Call example to deploy a contract: +```typescript +const deployOut = await connector.deployContract({ + web3SigningCredential: { + ethAccount: firstHighNetWorthAccount, + secret: xdaiKeyPair.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + bytecode: SmartContractJson.bytecode, + gas: 1000000, +}); +``` +The field "type" can have the following values: +```typescript +enum Web3SigningCredentialType { + CACTUSKEYCHAINREF = 'CACTUS_KEYCHAIN_REF', + GETHKEYCHAINPASSWORD = 'GETH_KEYCHAIN_PASSWORD', + PRIVATEKEYHEX = 'PRIVATE_KEY_HEX', + NONE = 'NONE' +} +``` +> Extensive documentation and examples in the [readthedocs](https://readthedocs.org/projects/hyperledger-cactus/) (WIP) + +## Prometheus Exporter + +This class creates a prometheus exporter, which scrapes the transactions (total transaction count) for the use cases incorporating the use of Xdai connector plugin. + +### Prometheus Exporter Usage +The prometheus exporter object is initialized in the `PluginLedgerConnectorXdai` class constructor itself, so instantiating the object of the `PluginLedgerConnectorXdai` class, gives access to the exporter object. +You can also initialize the prometheus exporter object seperately and then pass it to the `IPluginLedgerConnectorXdaiOptions` interface for `PluginLedgerConnectoXdai` constructor. + +`getPrometheusExporterMetricsV1` function returns the prometheus exporter metrics, currently displaying the total transaction count, which currently increments everytime the `transact()` method of the `PluginLedgerConnectorXdai` class is called. + +### Prometheus Integration +To use Prometheus with this exporter make sure to install [Prometheus main component](https://prometheus.io/download/). +Once Prometheus is setup, the corresponding scrape_config needs to be added to the prometheus.yml + +```(yaml) +- job_name: 'xdai_ledger_connector_exporter' + metrics_path: api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics + scrape_interval: 5s + static_configs: + - targets: ['{host}:{port}'] +``` + +Here the `host:port` is where the prometheus exporter metrics are exposed. The test cases (For example, packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/plugin-ledger-connector-xdai/deploy-contract/deploy-contract-from-json.test.ts) exposes it over `0.0.0.0` and a random port(). The random port can be found in the running logs of the test case and looks like (42379 in the below mentioned URL) +`Metrics URL: http://0.0.0.0:42379/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics` + +Once edited, you can start the prometheus service by referencing the above edited prometheus.yml file. +On the prometheus graphical interface (defaulted to http://localhost:9090), choose **Graph** from the menu bar, then select the **Console** tab. From the **Insert metric at cursor** drop down, select **cactus_xdai_total_tx_count** and click **execute** + +### Helper code + +###### response.type.ts +This file contains the various responses of the metrics. + +###### data-fetcher.ts +This file contains functions encasing the logic to process the data points + +###### metrics.ts +This file lists all the prometheus metrics and what they are used for. + +## Running the tests + +To check that all has been installed correctly and that the pugin has no errors run the tests: + +* Run this command at the project's root: +```sh +npm run test:plugin-ledger-connector-xdai +``` + +## Contributing + +We welcome contributions to Hyperledger Cactus in many forms, and there’s always plenty to do! + +Please review [CONTIRBUTING.md](../../CONTRIBUTING.md) to get started. + +## License + +This distribution is published under the Apache License Version 2.0 found in the [LICENSE](../../LICENSE) file. + +## Acknowledgments diff --git a/packages/cactus-plugin-ledger-connector-xdai/package-lock.json b/packages/cactus-plugin-ledger-connector-xdai/package-lock.json new file mode 100644 index 0000000000..6653521729 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/package-lock.json @@ -0,0 +1,2659 @@ +{ + "name": "@hyperledger/cactus-plugin-ledger-connector-xdai", + "version": "0.4.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==" + }, + "@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==", + "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==", + "requires": { + "@types/node": "*" + } + }, + "@types/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ==", + "dev": true, + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.34", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.34.tgz", + "integrity": "sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/express": { + "version": "4.17.8", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.8.tgz", + "integrity": "sha512-wLhcKh3PMlyA2cNAB9sjM1BntnhPMiM0JOBwPBqttjHev2428MLEB4AYVN+d8s2iyCVZac+o41Pflm/ZH5vLXQ==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.19.tgz", + "integrity": "sha512-DJOSHzX7pCiSElWaGR8kCprwibCB/3yW6vcT8VG3P0SJjnv19gnWG/AZMfM60Xj/YJIp/YCaDHyvzsFVeniARA==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", + "dev": true + }, + "@types/node": { + "version": "10.17.58", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.58.tgz", + "integrity": "sha512-Dn5RBxLohjdHFj17dVVw3rtrZAeXeWg+LQfvxDIW/fdPkSiuQk7h3frKMYtsQhtIW42wkErDcy9UMVxhGW4O7w==" + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/qs": { + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA==", + "dev": true + }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==", + "dev": true + }, + "@types/secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-QMg+9v0bbNJ2peLuHRWxzmy0HRJIG6gFZNhaRSp7S3ggSbCCxiqQB2/ybvhXyhHOCequpNkrx7OavNhrWOsW0A==", + "requires": { + "@types/node": "*" + } + }, + "@types/serve-static": { + "version": "1.13.9", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.9.tgz", + "integrity": "sha512-ZFqF6qa48XsPdjXV5Gsz0Zqmux2PerNd3a/ktL45mHpa19cuMi/cL8tcxdAx497yRh+QtYPuofjT9oWw9P7nkA==", + "dev": true, + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "@web3-js/scrypt-shim": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz", + "integrity": "sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw==", + "requires": { + "scryptsy": "^2.1.0", + "semver": "^6.3.0" + } + }, + "@web3-js/websocket": { + "version": "1.0.30", + "resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz", + "integrity": "sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==", + "requires": { + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "nan": "^2.14.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" + } + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "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" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "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==", + "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=" + }, + "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==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "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=" + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + }, + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "requires": { + "follow-redirects": "^1.10.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==", + "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==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "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==" + }, + "bintrees": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.1.tgz", + "integrity": "sha1-DmVcm5wkNeqraL9AJyJtK1WjRSQ=" + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, + "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==" + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "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" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "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==", + "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==", + "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==", + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + }, + "dependencies": { + "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==" + } + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "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.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "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==" + } + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "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==", + "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==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "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=" + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "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": { + "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==", + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" + } + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, + "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==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "requires": { + "mimic-response": "^1.0.0" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "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==" + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" + }, + "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=" + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "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==", + "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==", + "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==", + "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" + } + }, + "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==", + "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==", + "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=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "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=" + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "requires": { + "mimic-response": "^1.0.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==" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "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=" + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "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==" + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "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=" + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "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": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "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==", + "requires": { + "once": "^1.4.0" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "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=", + "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==", + "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=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "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=", + "requires": { + "idna-uts46-hx": "^2.3.1", + "js-sha3": "^0.5.7" + }, + "dependencies": { + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + } + } + }, + "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==", + "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" + } + }, + "ethereum-bloom-filters": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.9.tgz", + "integrity": "sha512-GiK/RQkAkcVaEdxKVkPcG07PQ5vD7v2MFSHgZmBJSfMzNRHimntdBithsHAT89tAXnIpzVDWt8iaCD1DvkaxGg==", + "requires": { + "js-sha3": "^0.8.0" + } + }, + "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==", + "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" + }, + "dependencies": { + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + } + } + }, + "ethereumjs-common": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", + "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==" + }, + "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==", + "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==", + "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" + } + }, + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + }, + "dependencies": { + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + }, + "setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + } + } + }, + "ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "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=" + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==" + }, + "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==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "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" + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "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==" + }, + "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==" + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "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" + } + }, + "follow-redirects": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", + "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "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==", + "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=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "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==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "requires": { + "minipass": "^2.6.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "global": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", + "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", + "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==", + "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" + } + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "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==" + }, + "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==", + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "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==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "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==" + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hoek": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", + "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==" + }, + "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==" + }, + "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==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", + "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "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==", + "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==", + "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=" + } + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "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==" + }, + "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==" + }, + "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=" + }, + "is-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", + "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==" + }, + "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=" + }, + "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==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isemail": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz", + "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", + "requires": { + "punycode": "2.x.x" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "joi": { + "version": "14.3.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-14.3.1.tgz", + "integrity": "sha512-LQDdM+pkOrpAn4Lp+neNIFV3axv1Vna3j38bisbQhETPMANYRbFJFUyOZcOClYvM/hppMhGWuKSFEK9vjrB+bQ==", + "requires": { + "hoek": "6.x.x", + "isemail": "3.x.x", + "topo": "3.x.x" + } + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "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==" + }, + "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=" + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "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=", + "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==", + "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==", + "requires": { + "json-buffer": "3.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==" + }, + "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==", + "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=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "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==" + }, + "mime-db": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", + "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==" + }, + "mime-types": { + "version": "2.1.30", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", + "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", + "requires": { + "mime-db": "1.47.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==" + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "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==" + }, + "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=" + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "requires": { + "minipass": "^2.9.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "requires": { + "mkdirp": "*" + } + }, + "mock-fs": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz", + "integrity": "sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" + }, + "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=" + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, + "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==" + }, + "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==" + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" + }, + "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=", + "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=" + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "oboe": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.4.tgz", + "integrity": "sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY=", + "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=", + "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=", + "requires": { + "wrappy": "1" + } + }, + "openapi-types": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-7.0.1.tgz", + "integrity": "sha512-6pi4/Fw+JIW1HHda2Ij7LRJ5QJ8f6YzaXnsRA6m44BJz8nLq/j5gVFzPBKJo+uOFhAeHqZC/3uzhTpYPga3Q/A==" + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "requires": { + "p-finally": "^1.0.0" + } + }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "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==" + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "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=" + }, + "pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "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=" + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "prom-client": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-13.1.0.tgz", + "integrity": "sha512-jT9VccZCWrJWXdyEtQddCDszYsiuWj5T0ekrPszi/WEegj3IZy6Mm09iOOVM86A4IKMWq8hZkT2dD9MaSe+sng==", + "requires": { + "tdigest": "^0.1.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==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "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" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "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==" + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "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==", + "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==", + "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==", + "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==" + }, + "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==", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.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==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "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==" + } + } + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "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==", + "requires": { + "bn.js": "^4.11.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==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=" + }, + "scryptsy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", + "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==" + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "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": { + "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==" + } + } + }, + "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==", + "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==", + "requires": { + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "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==" + }, + "simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "requires": { + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "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" + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "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=" + }, + "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==", + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "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==" + } + } + }, + "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=", + "requires": { + "is-hex-prefixed": "1.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==", + "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": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "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" + } + }, + "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==" + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" + }, + "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=", + "requires": { + "prepend-http": "^1.0.1" + } + } + } + }, + "tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "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": { + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "requires": { + "minimist": "^1.2.5" + } + } + } + }, + "tdigest": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.1.tgz", + "integrity": "sha1-Ljyyw56kSeVdHmzZEReszKRYgCE=", + "requires": { + "bintrees": "1.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=" + }, + "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==" + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, + "topo": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz", + "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==", + "requires": { + "hoek": "6.x.x" + } + }, + "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==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "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==", + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript-optional": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/typescript-optional/-/typescript-optional-2.0.1.tgz", + "integrity": "sha512-xuwmqsCjE4OeeMKxbNX3jjNcISGzYh5Q9R1rM5OyxEVNIr94CB5llCkfKW+1nZTKbbUV0axN3QAUuX2fus/DhQ==" + }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" + }, + "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==" + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "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=", + "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=" + }, + "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=" + }, + "utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "web3": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.7.tgz", + "integrity": "sha512-jAAJHMfUlTps+jH2li1ckDFEpPrEEriU/ubegSTGRl3KRdNhEqT93+3kd7FHJTn3NgjcyURo2+f7Da1YcZL8Mw==", + "requires": { + "web3-bzz": "1.2.7", + "web3-core": "1.2.7", + "web3-eth": "1.2.7", + "web3-eth-personal": "1.2.7", + "web3-net": "1.2.7", + "web3-shh": "1.2.7", + "web3-utils": "1.2.7" + } + }, + "web3-bzz": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.7.tgz", + "integrity": "sha512-iTIWBR+Z+Bn09WprtKm46LmyNOasg2lUn++AjXkBTB8UNxlUybxtza84yl2ETTZUs0zuFzdSSAEgbjhygG+9oA==", + "requires": { + "@types/node": "^10.12.18", + "got": "9.6.0", + "swarm-js": "^0.1.40", + "underscore": "1.9.1" + } + }, + "web3-core": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.7.tgz", + "integrity": "sha512-QA0MTae0gXcr3KHe3cQ4x56+Wh43ZKWfMwg1gfCc3NNxPRM1jJ8qudzyptCAUcxUGXWpDG8syLIn1APDz5J8BQ==", + "requires": { + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "bignumber.js": "^9.0.0", + "web3-core-helpers": "1.2.7", + "web3-core-method": "1.2.7", + "web3-core-requestmanager": "1.2.7", + "web3-utils": "1.2.7" + }, + "dependencies": { + "@types/node": { + "version": "12.20.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.10.tgz", + "integrity": "sha512-TxCmnSSppKBBOzYzPR2BR25YlX5Oay8z2XGwFBInuA/Co0V9xJhLlW4kjbxKtgeNo3NOMbQP1A5Rc03y+XecPw==" + } + } + }, + "web3-core-helpers": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.7.tgz", + "integrity": "sha512-bdU++9QATGeCetVrMp8pV97aQtVkN5oLBf/TWu/qumC6jK/YqrvLlBJLdwbz0QveU8zOSap6GCvJbqKvmmbV2A==", + "requires": { + "underscore": "1.9.1", + "web3-eth-iban": "1.2.7", + "web3-utils": "1.2.7" + } + }, + "web3-core-method": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.7.tgz", + "integrity": "sha512-e1TI0QUnByDMbQ8QHwnjxfjKw0LIgVRY4TYrlPijET9ebqUJU1HCayn/BHIMpV6LKyR1fQj9EldWyT64wZQXkg==", + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.7", + "web3-core-promievent": "1.2.7", + "web3-core-subscriptions": "1.2.7", + "web3-utils": "1.2.7" + } + }, + "web3-core-promievent": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.7.tgz", + "integrity": "sha512-jNmsM/czCeMGQqKKwM9/HZVTJVIF96hdMVNN/V9TGvp+EEE7vDhB4pUocDnc/QF9Z/5QFBCVmvNWttlRgZmU0A==", + "requires": { + "eventemitter3": "3.1.2" + } + }, + "web3-core-requestmanager": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.7.tgz", + "integrity": "sha512-HJb/txjHixu1dxIebiZQKBoJCaNu4gsh7mq/uj6Z/w6tIHbybL90s/7ADyMED353yyJ2tDWtYJqeMVAR+KtdaA==", + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.7", + "web3-providers-http": "1.2.7", + "web3-providers-ipc": "1.2.7", + "web3-providers-ws": "1.2.7" + } + }, + "web3-core-subscriptions": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.7.tgz", + "integrity": "sha512-W/CzQYOUawdMDvkgA/fmLsnG5aMpbjrs78LZMbc0MFXLpH3ofqAgO2by4QZrrTShUUTeWS0ZuEkFFL/iFrSObw==", + "requires": { + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.7" + } + }, + "web3-eth": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.7.tgz", + "integrity": "sha512-ljLd0oB4IjWkzFGVan4HkYhJXhSXgn9iaSaxdJixKGntZPgWMJfxeA+uLwTrlxrWzhvy4f+39WnT7wCh5e9TGg==", + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.7", + "web3-core-helpers": "1.2.7", + "web3-core-method": "1.2.7", + "web3-core-subscriptions": "1.2.7", + "web3-eth-abi": "1.2.7", + "web3-eth-accounts": "1.2.7", + "web3-eth-contract": "1.2.7", + "web3-eth-ens": "1.2.7", + "web3-eth-iban": "1.2.7", + "web3-eth-personal": "1.2.7", + "web3-net": "1.2.7", + "web3-utils": "1.2.7" + } + }, + "web3-eth-abi": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.7.tgz", + "integrity": "sha512-4FnlT1q+D0XBkxSMXlIb/eG337uQeMaUdtVQ4PZ3XzxqpcoDuMgXm4o+3NRxnWmr4AMm6QKjM+hcC7c0mBKcyg==", + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.7" + } + }, + "web3-eth-accounts": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.7.tgz", + "integrity": "sha512-AE7QWi/iIQIjXwlAPtlMabm/OPFF0a1PhxT1EiTckpYNP8fYs6jW7lYxEtJPPJIKqfMjoi1xkEqTVR1YZQ88lg==", + "requires": { + "@web3-js/scrypt-shim": "^0.1.0", + "crypto-browserify": "3.12.0", + "eth-lib": "^0.2.8", + "ethereumjs-common": "^1.3.2", + "ethereumjs-tx": "^2.1.1", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.7", + "web3-core-helpers": "1.2.7", + "web3-core-method": "1.2.7", + "web3-utils": "1.2.7" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "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==" + } + } + }, + "web3-eth-contract": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.7.tgz", + "integrity": "sha512-uW23Y0iL7XroRNbf9fWZ1N6OYhEYTJX8gTuYASuRnpYrISN5QGiQML6pq/NCzqypR1bl5E0fuINZQSK/xefIVw==", + "requires": { + "@types/bn.js": "^4.11.4", + "underscore": "1.9.1", + "web3-core": "1.2.7", + "web3-core-helpers": "1.2.7", + "web3-core-method": "1.2.7", + "web3-core-promievent": "1.2.7", + "web3-core-subscriptions": "1.2.7", + "web3-eth-abi": "1.2.7", + "web3-utils": "1.2.7" + } + }, + "web3-eth-ens": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.7.tgz", + "integrity": "sha512-SPRnvUNWQ0CnnTDBteGIJkvFWEizJcAHlVsrFLICwcwFZu+appjX1UOaoGu2h3GXWtc/XZlu7B451Gi+Os2cTg==", + "requires": { + "eth-ens-namehash": "2.0.8", + "underscore": "1.9.1", + "web3-core": "1.2.7", + "web3-core-helpers": "1.2.7", + "web3-core-promievent": "1.2.7", + "web3-eth-abi": "1.2.7", + "web3-eth-contract": "1.2.7", + "web3-utils": "1.2.7" + } + }, + "web3-eth-iban": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.7.tgz", + "integrity": "sha512-2NrClz1PoQ3nSJBd+91ylCOVga9qbTxjRofq/oSCoHVAEvz3WZyttx9k5DC+0rWqwJF1h69ufFvdHAAlmN/4lg==", + "requires": { + "bn.js": "4.11.8", + "web3-utils": "1.2.7" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } + } + }, + "web3-eth-personal": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.7.tgz", + "integrity": "sha512-2OAa1Spz0uB29dwCM8+1y0So7E47A4gKznjBEwXIYEcUIsvwT5X7ofFhC2XxyRpqlIWZSQAxRSSJFyupRRXzyw==", + "requires": { + "@types/node": "^12.6.1", + "web3-core": "1.2.7", + "web3-core-helpers": "1.2.7", + "web3-core-method": "1.2.7", + "web3-net": "1.2.7", + "web3-utils": "1.2.7" + }, + "dependencies": { + "@types/node": { + "version": "12.20.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.10.tgz", + "integrity": "sha512-TxCmnSSppKBBOzYzPR2BR25YlX5Oay8z2XGwFBInuA/Co0V9xJhLlW4kjbxKtgeNo3NOMbQP1A5Rc03y+XecPw==" + } + } + }, + "web3-net": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.7.tgz", + "integrity": "sha512-j9qeZrS1FNyCeA0BfdLojkxOZQz3FKa1DJI+Dw9fEVhZS68vLOFANu2RB96gR9BoPHo5+k5D3NsKOoxt1gw3Gg==", + "requires": { + "web3-core": "1.2.7", + "web3-core-method": "1.2.7", + "web3-utils": "1.2.7" + } + }, + "web3-providers-http": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.7.tgz", + "integrity": "sha512-vazGx5onuH/zogrwkUaLFJwFcJ6CckP65VFSHoiV+GTQdkOqgoDIha7StKkslvDz4XJ2FuY/zOZHbtuOYeltXQ==", + "requires": { + "web3-core-helpers": "1.2.7", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.7.tgz", + "integrity": "sha512-/zc0y724H2zbkV4UbGGMhsEiLfafjagIzfrsWZnyTZUlSB0OGRmmFm2EkLJAgtXrLiodaHHyXKM0vB8S24bxdA==", + "requires": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.7" + } + }, + "web3-providers-ws": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.7.tgz", + "integrity": "sha512-b5XzqDpRkNVe6MFs5K6iqOEyjQikHtg3KuU2/ClCDV37hm0WN4xCRVMC0LwegulbDXZej3zT9+1CYzGaGFREzA==", + "requires": { + "@web3-js/websocket": "^1.0.29", + "eventemitter3": "^4.0.0", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.7" + }, + "dependencies": { + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + } + } + }, + "web3-shh": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.7.tgz", + "integrity": "sha512-f6PAgcpG0ZAo98KqCmeHoDEx5qzm3d5plet18DkT4U6WIeYowKdec8vZaLPRR7c2XreXFJ2gQf45CB7oqR7U/w==", + "requires": { + "web3-core": "1.2.7", + "web3-core-method": "1.2.7", + "web3-core-subscriptions": "1.2.7", + "web3-net": "1.2.7" + } + }, + "web3-utils": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.7.tgz", + "integrity": "sha512-FBh/CPJND+eiPeUF9KVbTyTZtXNWxPWtByBaWS6e2x4ACazPX711EeNaZaChIOGSLGe6se2n7kg6wnawe/MjuQ==", + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "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": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + } + }, + "xhr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", + "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", + "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==", + "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==", + "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=", + "requires": { + "cookiejar": "^2.1.1" + } + }, + "xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/package.json b/packages/cactus-plugin-ledger-connector-xdai/package.json new file mode 100644 index 0000000000..2201469470 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/package.json @@ -0,0 +1,103 @@ +{ + "name": "@hyperledger/cactus-plugin-ledger-connector-xdai", + "version": "0.4.1", + "description": "Allows Cactus nodes to connect to a Xdai ledger.", + "main": "dist/lib/main/typescript/index.js", + "mainMinified": "dist/cactus-plugin-ledger-connector-xdai.node.umd.min.js", + "browser": "dist/cactus-plugin-ledger-connector-xdai.web.umd.js", + "browserMinified": "dist/cactus-plugin-ledger-connector-xdai.web.umd.min.js", + "module": "dist/lib/main/typescript/index.js", + "types": "dist/types/main/typescript/index.d.ts", + "files": [ + "dist/*" + ], + "scripts": { + "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "pretsc": "npm run generate-sdk", + "tsc": "tsc --project ./tsconfig.json", + "watch": "npm-watch", + "webpack": "npm-run-all webpack:dev webpack:prod", + "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", + "webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js", + "webpack:dev:node": "webpack --env=dev --target=node --config ../../webpack.config.js", + "webpack:prod": "npm-run-all webpack:prod:node webpack:prod:web", + "webpack:prod:web": "webpack --env=prod --target=web --config ../../webpack.config.js", + "webpack:prod:node": "webpack --env=prod --target=node --config ../../webpack.config.js" + }, + "watch": { + "tsc": { + "patterns": [ + "src/", + "src/*/json/**/openapi*" + ], + "ignore": [ + "src/**/generated/*" + ], + "extensions": [ + "ts", + "json" + ], + "quiet": true, + "verbose": false, + "runOnChangeOnly": true + } + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=10", + "npm": ">=6" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/hyperledger/cactus.git" + }, + "keywords": [ + "Hyperledger", + "Cactus", + "Integration", + "Blockchain", + "Distributed Ledger Technology" + ], + "author": { + "name": "Hyperledger Cactus Contributors", + "email": "cactus@lists.hyperledger.org", + "url": "https://www.hyperledger.org/use/cactus" + }, + "contributors": [ + { + "name": "Please add yourself to the list of contributors", + "email": "your.name@example.com", + "url": "https://example.com" + }, + { + "name": "Peter Somogyvari", + "email": "peter.somogyvari@accenture.com", + "url": "https://accenture.com" + } + ], + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/hyperledger/cactus/issues" + }, + "homepage": "https://github.com/hyperledger/cactus#readme", + "dependencies": { + "@hyperledger/cactus-common": "0.4.0", + "@hyperledger/cactus-core": "0.4.1", + "@hyperledger/cactus-core-api": "0.4.1", + "axios": "0.21.1", + "express": "4.17.1", + "joi": "14.3.1", + "openapi-types": "7.0.1", + "prom-client": "13.1.0", + "typescript-optional": "2.0.1", + "web3": "1.2.7", + "web3-utils": "1.2.7" + }, + "devDependencies": { + "@hyperledger/cactus-plugin-keychain-memory": "0.4.1", + "@hyperledger/cactus-test-tooling": "0.4.0", + "@types/express": "4.17.8" + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/json/openapi.json b/packages/cactus-plugin-ledger-connector-xdai/src/main/json/openapi.json new file mode 100644 index 0000000000..518a2f8893 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/json/openapi.json @@ -0,0 +1,711 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Hyperledger Cactus Plugin - Connector Xdai", + "description": "Can perform basic tasks on a Xdai ledger", + "version": "0.0.1", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "servers": [ + { + "url": "https://www.cactus.stream/{basePath}", + "description": "Public test instance", + "variables": { + "basePath": { + "default": "" + } + } + }, + { + "url": "http://localhost:4000/{basePath}", + "description": "Local test instance", + "variables": { + "basePath": { + "default": "" + } + } + } + ], + "components": { + "schemas": { + "ReceiptType": { + "description": "Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger.", + "type": "string", + "enum": [ + "NODE_TX_POOL_ACK", + "LEDGER_BLOCK_ACK" + ] + }, + "ConsistencyStrategy": { + "type": "object", + "required": ["receiptType", "blockConfirmations"], + "properties": { + "receiptType": { + "$ref": "#/components/schemas/ReceiptType" + }, + "timeoutMs": { + "type": "integer", + "description": "The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrancy is a broader topic not in scope to discuss here, but it is important to mention it.", + "minimum": 0 + }, + "blockConfirmations": { + "type": "integer", + "minimum": 0, + "description": "The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters." + } + } + }, + "Web3SigningCredential": { + "type": "object", + "required": [ + "type" + ], + "discriminator": { + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/Web3SigningCredentialCactusKeychainRef" + }, + { + "$ref": "#/components/schemas/Web3SigningCredentialPrivateKeyHex" + }, + { + "$ref": "#/components/schemas/Web3SigningCredentialNone" + } + ], + "properties": { + "type": { + "$ref": "#/components/schemas/Web3SigningCredentialType" + } + } + }, + "Web3SigningCredentialCactusKeychainRef": { + "type": "object", + "required": [ + "type", + "ethAccount", + "keychainId", + "keychainEntryKey" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/Web3SigningCredentialType" + }, + "ethAccount": { + "type": "string", + "description": "The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication.", + "minLength": 64, + "maxLength": 64, + "nullable": false + }, + "keychainEntryKey": { + "type": "string", + "description": "The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter.", + "minLength": 0, + "maxLength": 1024 + }, + "keychainId": { + "type": "string", + "description": "The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter.", + "minLength": 0, + "maxLength": 1024 + } + } + }, + "Web3SigningCredentialPrivateKeyHex": { + "type": "object", + "required": [ + "type", + "ethAccount", + "secret" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/Web3SigningCredentialType" + }, + "ethAccount": { + "type": "string", + "description": "The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication.", + "minLength": 64, + "maxLength": 64, + "nullable": false + }, + "secret": { + "type": "string", + "description": "The HEX encoded private key of an eth account.", + "minLength": 0, + "maxLength": 65535 + } + } + }, + "Web3SigningCredentialNone": { + "type": "object", + "required": [ + "type" + ], + "description": "Using this denotes that there is no signing required because the transaction is pre-signed.", + "properties": { + "type": { + "$ref": "#/components/schemas/Web3SigningCredentialType" + } + } + }, + "Web3SigningCredentialType": { + "type": "string", + "enum": [ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE" + ] + }, + "EthContractInvocationType": { + "type": "string", + "enum": [ + "SEND", + "CALL" + ] + }, + "SolidityContractJsonArtifact": { + "type": "object", + "required": [ + "contractName" + ], + "properties": { + "contractName": { + "type": "string", + "nullable": false + }, + "metadata": { + "type": "string", + "nullable": false + }, + "bytecode": { + "type": "string", + "nullable": false + }, + "deployedBytecode": { + "type": "string", + "nullable": false + }, + "sourceMap": { + "type": "string", + "nullable": false + }, + "deployedSourceMap": { + "type": "string", + "nullable": false + }, + "sourcePath": { + "type": "string" + }, + "compiler": { + "type": "object", + "additionalProperties": true, + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "functionHashes": { + "type": "object", + "additionalProperties": true + }, + "gasEstimates": { + "properties": { + "creation": { + "type": "object", + "properties": { + "codeDepositCost": { + "type": "string" + }, + "executionCost": { + "type": "string" + }, + "totalCost": { + "type": "string" + } + } + }, + "external": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "XdaiTransactionConfig": { + "type": "object", + "additionalProperties": true, + "properties": { + "rawTransaction": { + "type": "string", + "nullable": false + }, + "from": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "to": { + "oneOf": [ + { + "type": "string" + } + ] + }, + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "gas": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "gasPrice": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "nonce": { + "type": "number" + }, + "data": { + "oneOf": [ + { + "type": "string" + } + ] + } + } + }, + "Web3TransactionReceipt": { + "type": "object", + "required": [ + "blockHash", + "blockNumber", + "transactionHash", + "transactionIndex", + "status", + "from", + "to", + "gasUsed" + ], + "additionalProperties": true, + "properties": { + "status": { + "type": "boolean", + "nullable": false + }, + "transactionHash": { + "type": "string", + "minLength": 64, + "maxLength": 64, + "pattern": "/^0x([A-Fa-f0-9]{64})$/" + }, + "transactionIndex": { + "type": "number", + "nullable": false + }, + "blockHash": { + "type": "string", + "minLength": 64, + "maxLength": 64, + "pattern": "/^0x([A-Fa-f0-9]{64})$/" + }, + "blockNumber": { + "type": "number", + "nullable": false + }, + "gasUsed": { + "type": "number", + "nullable": false + }, + "contractAddress": { + "type": "string", + "nullable": true + }, + "from": { + "type": "string", + "nullable": false + }, + "to": { + "type": "string", + "nullable": false + } + } + }, + "RunTransactionV1Request": { + "type": "object", + "required": [ + "web3SigningCredential", + "transactionConfig", + "consistencyStrategy" + ], + "properties": { + "web3SigningCredential": { + "$ref": "#/components/schemas/Web3SigningCredential", + "nullable": false + }, + "transactionConfig": { + "$ref": "#/components/schemas/XdaiTransactionConfig", + "nullable": false + }, + "consistencyStrategy": { + "$ref": "#/components/schemas/ConsistencyStrategy" + } + } + }, + "RunTransactionV1Response": { + "type": "object", + "required": [ + "transactionReceipt" + ], + "properties": { + "transactionReceipt": { + "$ref": "#/components/schemas/Web3TransactionReceipt" + } + } + }, + "DeployContractV1Request": { + "type": "object", + "required": [ + "contractName", + "contractAbi", + "bytecode", + "web3SigningCredential", + "keychainId", + "constructorArgs" + ], + "properties": { + "contractName": { + "type": "string", + "description": "The contract name for retrieve the contracts json on the keychain.", + "minLength": 1, + "maxLength": 100, + "nullable": false + }, + "contractAbi": { + "description": "The application binary interface of the solidity contract", + "type": "array", + "items": {}, + "nullable": false + }, + "constructorArgs": { + "type": "array", + "items": {}, + "default": [] + }, + "web3SigningCredential": { + "$ref": "#/components/schemas/Web3SigningCredential", + "nullable": false + }, + "bytecode": { + "type": "string", + "nullable": false, + "minLength": 1, + "maxLength": 24576, + "description": "See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode" + }, + "keychainId": { + "type": "string", + "description": "The keychainId for retrieve the contracts json.", + "minLength": 1, + "maxLength": 100, + "nullable": false + }, + "gas": { + "type": "number", + "nullable": false + }, + "gasPrice": { + "type": "string", + "nullable": false + }, + "timeoutMs": { + "type": "number", + "description": "The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing.", + "minimum": 0, + "default": 60000, + "nullable": false + } + } + }, + "DeployContractV1Response": { + "type": "object", + "required": [ + "transactionReceipt" + ], + "properties": { + "transactionReceipt": { + "$ref": "#/components/schemas/Web3TransactionReceipt" + } + } + }, + "InvokeContractV1Request": { + "type": "object", + "required": [ + "contractName", + "signingCredential", + "invocationType", + "methodName", + "params" + ], + "properties": { + "contractName": { + "type": "string", + "nullable": false + }, + "signingCredential": { + "$ref": "#/components/schemas/Web3SigningCredential", + "nullable": false + }, + "invocationType": { + "$ref": "#/components/schemas/EthContractInvocationType", + "nullable": false, + "description": "Indicates wether it is a CALL or a SEND type of invocation where only SEND ends up creating an actual transaction on the ledger." + }, + "methodName": { + "description": "The name of the contract method to invoke.", + "type": "string", + "nullable": false, + "minLength": 1, + "maxLength": 2048 + }, + "params": { + "description": "The list of arguments to pass in to the contract method being invoked.", + "type": "array", + "default": [], + "items": {} + }, + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "gas": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "gasPrice": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "nonce": { + "type": "number" + }, + "timeoutMs": { + "type": "number", + "description": "The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND", + "minimum": 0, + "default": 60000, + "nullable": false + }, + "keychainId": { + "type": "string", + "description": "The keychainId for retrieve the contracts json.", + "minLength": 1, + "maxLength": 100 + } + } + }, + "InvokeContractV1Response": { + "type": "object", + "required": [ + "success" + ], + "properties": { + "transactionReceipt": { + "$ref": "#/components/schemas/Web3TransactionReceipt" + }, + "callOutput": {}, + "success": { + "type": "boolean", + "nullable": false + } + } + }, + "PrometheusExporterMetricsResponse": { + "type": "string", + "nullable": false + } + } + }, + "paths": { + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode": { + "post": { + "x-hyperledger-cactus": { + "http": { + "verbLowerCase": "post", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode" + } + }, + "operationId": "deployContractV1", + "summary": "Deploys the bytecode of a Solidity contract.", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeployContractV1Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeployContractV1Response" + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction": { + "post": { + "x-hyperledger-cactus": { + "http": { + "verbLowerCase": "post", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction" + } + }, + "operationId": "runTransactionV1", + "summary": "Executes a transaction on a xdai ledger", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunTransactionV1Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunTransactionV1Response" + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract": { + "post": { + "x-hyperledger-cactus": { + "http": { + "verbLowerCase": "post", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract" + } + }, + "operationId": "invokeContractV1", + "summary": "Invokeds a contract on a xdai ledger", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvokeContractV1Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvokeContractV1Response" + } + } + } + } + } + } + }, + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics": { + "get": { + "x-hyperledger-cactus": { + "http": { + "verbLowerCase": "get", + "path": "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics" + } + }, + "operationId": "getPrometheusExporterMetricsV1", + "summary": "Get the Prometheus Metrics", + "parameters": [], + "responses": { + "200": { + "description": "OK", + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/PrometheusExporterMetricsResponse" + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator-ignore new file mode 100644 index 0000000000..6ff76cf80a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator-ignore @@ -0,0 +1,27 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +.npmignore +.gitignore +git_push.sh \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/FILES new file mode 100644 index 0000000000..c123dd7d45 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/FILES @@ -0,0 +1,4 @@ +api.ts +base.ts +configuration.ts +index.ts diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION new file mode 100644 index 0000000000..1a487e1a2e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-beta2 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/api.ts new file mode 100644 index 0000000000..a955b72d52 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -0,0 +1,887 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from './configuration'; +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; + +/** + * + * @export + * @interface ConsistencyStrategy + */ +export interface ConsistencyStrategy { + /** + * + * @type {ReceiptType} + * @memberof ConsistencyStrategy + */ + receiptType: ReceiptType; + /** + * The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrancy is a broader topic not in scope to discuss here, but it is important to mention it. + * @type {number} + * @memberof ConsistencyStrategy + */ + timeoutMs?: number; + /** + * The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + * @type {number} + * @memberof ConsistencyStrategy + */ + blockConfirmations: number; +} +/** + * + * @export + * @interface DeployContractV1Request + */ +export interface DeployContractV1Request { + /** + * The contract name for retrieve the contracts json on the keychain. + * @type {string} + * @memberof DeployContractV1Request + */ + contractName: string; + /** + * The application binary interface of the solidity contract + * @type {Array} + * @memberof DeployContractV1Request + */ + contractAbi: Array; + /** + * + * @type {Array} + * @memberof DeployContractV1Request + */ + constructorArgs: Array; + /** + * + * @type {Web3SigningCredential} + * @memberof DeployContractV1Request + */ + web3SigningCredential: Web3SigningCredential; + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @type {string} + * @memberof DeployContractV1Request + */ + bytecode: string; + /** + * The keychainId for retrieve the contracts json. + * @type {string} + * @memberof DeployContractV1Request + */ + keychainId: string; + /** + * + * @type {number} + * @memberof DeployContractV1Request + */ + gas?: number; + /** + * + * @type {string} + * @memberof DeployContractV1Request + */ + gasPrice?: string; + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * @type {number} + * @memberof DeployContractV1Request + */ + timeoutMs?: number; +} +/** + * + * @export + * @interface DeployContractV1Response + */ +export interface DeployContractV1Response { + /** + * + * @type {Web3TransactionReceipt} + * @memberof DeployContractV1Response + */ + transactionReceipt: Web3TransactionReceipt; +} +/** + * + * @export + * @enum {string} + */ +export enum EthContractInvocationType { + SEND = 'SEND', + CALL = 'CALL' +} + +/** + * + * @export + * @interface InvokeContractV1Request + */ +export interface InvokeContractV1Request { + /** + * + * @type {string} + * @memberof InvokeContractV1Request + */ + contractName: string; + /** + * + * @type {Web3SigningCredential} + * @memberof InvokeContractV1Request + */ + signingCredential: Web3SigningCredential; + /** + * + * @type {EthContractInvocationType} + * @memberof InvokeContractV1Request + */ + invocationType: EthContractInvocationType; + /** + * The name of the contract method to invoke. + * @type {string} + * @memberof InvokeContractV1Request + */ + methodName: string; + /** + * The list of arguments to pass in to the contract method being invoked. + * @type {Array} + * @memberof InvokeContractV1Request + */ + params: Array; + /** + * + * @type {string | number} + * @memberof InvokeContractV1Request + */ + value?: string | number; + /** + * + * @type {string | number} + * @memberof InvokeContractV1Request + */ + gas?: string | number; + /** + * + * @type {string | number} + * @memberof InvokeContractV1Request + */ + gasPrice?: string | number; + /** + * + * @type {number} + * @memberof InvokeContractV1Request + */ + nonce?: number; + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * @type {number} + * @memberof InvokeContractV1Request + */ + timeoutMs?: number; + /** + * The keychainId for retrieve the contracts json. + * @type {string} + * @memberof InvokeContractV1Request + */ + keychainId?: string; +} +/** + * + * @export + * @interface InvokeContractV1Response + */ +export interface InvokeContractV1Response { + /** + * + * @type {Web3TransactionReceipt} + * @memberof InvokeContractV1Response + */ + transactionReceipt?: Web3TransactionReceipt; + /** + * + * @type {any} + * @memberof InvokeContractV1Response + */ + callOutput?: any | null; + /** + * + * @type {boolean} + * @memberof InvokeContractV1Response + */ + success: boolean; +} +/** + * Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. + * @export + * @enum {string} + */ +export enum ReceiptType { + NODETXPOOLACK = 'NODE_TX_POOL_ACK', + LEDGERBLOCKACK = 'LEDGER_BLOCK_ACK' +} + +/** + * + * @export + * @interface RunTransactionV1Request + */ +export interface RunTransactionV1Request { + /** + * + * @type {Web3SigningCredential} + * @memberof RunTransactionV1Request + */ + web3SigningCredential: Web3SigningCredential; + /** + * + * @type {XdaiTransactionConfig} + * @memberof RunTransactionV1Request + */ + transactionConfig: XdaiTransactionConfig; + /** + * + * @type {ConsistencyStrategy} + * @memberof RunTransactionV1Request + */ + consistencyStrategy: ConsistencyStrategy; +} +/** + * + * @export + * @interface RunTransactionV1Response + */ +export interface RunTransactionV1Response { + /** + * + * @type {Web3TransactionReceipt} + * @memberof RunTransactionV1Response + */ + transactionReceipt: Web3TransactionReceipt; +} +/** + * + * @export + * @interface SolidityContractJsonArtifact + */ +export interface SolidityContractJsonArtifact { + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifact + */ + contractName: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifact + */ + metadata?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifact + */ + bytecode?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifact + */ + deployedBytecode?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifact + */ + sourceMap?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifact + */ + deployedSourceMap?: string; + /** + * + * @type {string} + * @memberof SolidityContractJsonArtifact + */ + sourcePath?: string; + /** + * + * @type {{ [key: string]: object; }} + * @memberof SolidityContractJsonArtifact + */ + compiler?: { [key: string]: object; }; + /** + * + * @type {{ [key: string]: object; }} + * @memberof SolidityContractJsonArtifact + */ + functionHashes?: { [key: string]: object; }; + /** + * + * @type {object} + * @memberof SolidityContractJsonArtifact + */ + gasEstimates?: object; +} +/** + * @type Web3SigningCredential + * @export + */ +export type Web3SigningCredential = Web3SigningCredentialCactusKeychainRef | Web3SigningCredentialNone | Web3SigningCredentialPrivateKeyHex; + +/** + * + * @export + * @interface Web3SigningCredentialCactusKeychainRef + */ +export interface Web3SigningCredentialCactusKeychainRef { + /** + * + * @type {Web3SigningCredentialType} + * @memberof Web3SigningCredentialCactusKeychainRef + */ + type: Web3SigningCredentialType; + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @type {string} + * @memberof Web3SigningCredentialCactusKeychainRef + */ + ethAccount: string; + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @type {string} + * @memberof Web3SigningCredentialCactusKeychainRef + */ + keychainEntryKey: string; + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @type {string} + * @memberof Web3SigningCredentialCactusKeychainRef + */ + keychainId: string; +} +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + * @export + * @interface Web3SigningCredentialNone + */ +export interface Web3SigningCredentialNone { + /** + * + * @type {Web3SigningCredentialType} + * @memberof Web3SigningCredentialNone + */ + type: Web3SigningCredentialType; +} +/** + * + * @export + * @interface Web3SigningCredentialPrivateKeyHex + */ +export interface Web3SigningCredentialPrivateKeyHex { + /** + * + * @type {Web3SigningCredentialType} + * @memberof Web3SigningCredentialPrivateKeyHex + */ + type: Web3SigningCredentialType; + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @type {string} + * @memberof Web3SigningCredentialPrivateKeyHex + */ + ethAccount: string; + /** + * The HEX encoded private key of an eth account. + * @type {string} + * @memberof Web3SigningCredentialPrivateKeyHex + */ + secret: string; +} +/** + * + * @export + * @enum {string} + */ +export enum Web3SigningCredentialType { + CACTUSKEYCHAINREF = 'CACTUS_KEYCHAIN_REF', + GETHKEYCHAINPASSWORD = 'GETH_KEYCHAIN_PASSWORD', + PRIVATEKEYHEX = 'PRIVATE_KEY_HEX', + NONE = 'NONE' +} + +/** + * + * @export + * @interface Web3TransactionReceipt + */ +export interface Web3TransactionReceipt { + [key: string]: object | any; + + /** + * + * @type {boolean} + * @memberof Web3TransactionReceipt + */ + status: boolean; + /** + * + * @type {string} + * @memberof Web3TransactionReceipt + */ + transactionHash: string; + /** + * + * @type {number} + * @memberof Web3TransactionReceipt + */ + transactionIndex: number; + /** + * + * @type {string} + * @memberof Web3TransactionReceipt + */ + blockHash: string; + /** + * + * @type {number} + * @memberof Web3TransactionReceipt + */ + blockNumber: number; + /** + * + * @type {number} + * @memberof Web3TransactionReceipt + */ + gasUsed: number; + /** + * + * @type {string} + * @memberof Web3TransactionReceipt + */ + contractAddress?: string | null; + /** + * + * @type {string} + * @memberof Web3TransactionReceipt + */ + from: string; + /** + * + * @type {string} + * @memberof Web3TransactionReceipt + */ + to: string; +} +/** + * + * @export + * @interface XdaiTransactionConfig + */ +export interface XdaiTransactionConfig { + [key: string]: object | any; + + /** + * + * @type {string} + * @memberof XdaiTransactionConfig + */ + rawTransaction?: string; + /** + * + * @type {string | number} + * @memberof XdaiTransactionConfig + */ + from?: string | number; + /** + * + * @type {string} + * @memberof XdaiTransactionConfig + */ + to?: string; + /** + * + * @type {string | number} + * @memberof XdaiTransactionConfig + */ + value?: string | number; + /** + * + * @type {string | number} + * @memberof XdaiTransactionConfig + */ + gas?: string | number; + /** + * + * @type {string | number} + * @memberof XdaiTransactionConfig + */ + gasPrice?: string | number; + /** + * + * @type {number} + * @memberof XdaiTransactionConfig + */ + nonce?: number; + /** + * + * @type {string} + * @memberof XdaiTransactionConfig + */ + data?: string; +} + +/** + * DefaultApi - axios parameter creator + * @export + */ +export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Deploys the bytecode of a Solidity contract. + * @param {DeployContractV1Request} [deployContractV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deployContractV1: async (deployContractV1Request?: DeployContractV1Request, options: any = {}): Promise => { + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof deployContractV1Request !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(deployContractV1Request !== undefined ? deployContractV1Request : {}) : (deployContractV1Request || ""); + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get the Prometheus Metrics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPrometheusExporterMetricsV1: async (options: any = {}): Promise => { + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Invokeds a contract on a xdai ledger + * @param {InvokeContractV1Request} [invokeContractV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + invokeContractV1: async (invokeContractV1Request?: InvokeContractV1Request, options: any = {}): Promise => { + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof invokeContractV1Request !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(invokeContractV1Request !== undefined ? invokeContractV1Request : {}) : (invokeContractV1Request || ""); + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Executes a transaction on a xdai ledger + * @param {RunTransactionV1Request} [runTransactionV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + runTransactionV1: async (runTransactionV1Request?: RunTransactionV1Request, options: any = {}): Promise => { + const localVarPath = `/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof runTransactionV1Request !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(runTransactionV1Request !== undefined ? runTransactionV1Request : {}) : (runTransactionV1Request || ""); + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * DefaultApi - functional programming interface + * @export + */ +export const DefaultApiFp = function(configuration?: Configuration) { + return { + /** + * + * @summary Deploys the bytecode of a Solidity contract. + * @param {DeployContractV1Request} [deployContractV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deployContractV1(deployContractV1Request?: DeployContractV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).deployContractV1(deployContractV1Request, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Get the Prometheus Metrics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPrometheusExporterMetricsV1(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).getPrometheusExporterMetricsV1(options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Invokeds a contract on a xdai ledger + * @param {InvokeContractV1Request} [invokeContractV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).invokeContractV1(invokeContractV1Request, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Executes a transaction on a xdai ledger + * @param {RunTransactionV1Request} [runTransactionV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async runTransactionV1(runTransactionV1Request?: RunTransactionV1Request, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).runTransactionV1(runTransactionV1Request, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * DefaultApi - factory interface + * @export + */ +export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * + * @summary Deploys the bytecode of a Solidity contract. + * @param {DeployContractV1Request} [deployContractV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deployContractV1(deployContractV1Request?: DeployContractV1Request, options?: any): AxiosPromise { + return DefaultApiFp(configuration).deployContractV1(deployContractV1Request, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get the Prometheus Metrics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPrometheusExporterMetricsV1(options?: any): AxiosPromise { + return DefaultApiFp(configuration).getPrometheusExporterMetricsV1(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Invokeds a contract on a xdai ledger + * @param {InvokeContractV1Request} [invokeContractV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any): AxiosPromise { + return DefaultApiFp(configuration).invokeContractV1(invokeContractV1Request, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Executes a transaction on a xdai ledger + * @param {RunTransactionV1Request} [runTransactionV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + runTransactionV1(runTransactionV1Request?: RunTransactionV1Request, options?: any): AxiosPromise { + return DefaultApiFp(configuration).runTransactionV1(runTransactionV1Request, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * DefaultApi - object-oriented interface + * @export + * @class DefaultApi + * @extends {BaseAPI} + */ +export class DefaultApi extends BaseAPI { + /** + * + * @summary Deploys the bytecode of a Solidity contract. + * @param {DeployContractV1Request} [deployContractV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public deployContractV1(deployContractV1Request?: DeployContractV1Request, options?: any) { + return DefaultApiFp(this.configuration).deployContractV1(deployContractV1Request, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get the Prometheus Metrics + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public getPrometheusExporterMetricsV1(options?: any) { + return DefaultApiFp(this.configuration).getPrometheusExporterMetricsV1(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Invokeds a contract on a xdai ledger + * @param {InvokeContractV1Request} [invokeContractV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public invokeContractV1(invokeContractV1Request?: InvokeContractV1Request, options?: any) { + return DefaultApiFp(this.configuration).invokeContractV1(invokeContractV1Request, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Executes a transaction on a xdai ledger + * @param {RunTransactionV1Request} [runTransactionV1Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public runTransactionV1(runTransactionV1Request?: RunTransactionV1Request, options?: any) { + return DefaultApiFp(this.configuration).runTransactionV1(runTransactionV1Request, options).then((request) => request(this.axios, this.basePath)); + } +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/base.ts new file mode 100644 index 0000000000..95b52fcfb5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/base.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; + +export const BASE_PATH = "https://www.cactus.stream".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/configuration.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/configuration.ts new file mode 100644 index 0000000000..ee216166d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/configuration.ts @@ -0,0 +1,76 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + baseOptions?: any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/index.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/index.ts new file mode 100644 index 0000000000..bfb97ee8c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/generated/openapi/typescript-axios/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: 0.0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/index.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/index.ts new file mode 100755 index 0000000000..87cb558397 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/index.ts @@ -0,0 +1 @@ +export * from "./public-api"; diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/index.web.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/index.web.ts new file mode 100755 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/index.web.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/model-type-guards.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/model-type-guards.ts new file mode 100644 index 0000000000..5760c215cc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/model-type-guards.ts @@ -0,0 +1,22 @@ +import { + Web3SigningCredentialNone, + Web3SigningCredentialPrivateKeyHex, + Web3SigningCredentialType, +} from "./generated/openapi/typescript-axios/api"; + +export function isWeb3SigningCredentialPrivateKeyHex( + x: unknown, +): x is Web3SigningCredentialPrivateKeyHex { + return ( + (x as Web3SigningCredentialPrivateKeyHex)?.type === + Web3SigningCredentialType.PRIVATEKEYHEX + ); +} + +export function isWeb3SigningCredentialNone( + x: unknown, +): x is Web3SigningCredentialNone { + return ( + (x as Web3SigningCredentialNone)?.type === Web3SigningCredentialType.NONE + ); +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-factory-ledger-connector.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-factory-ledger-connector.ts new file mode 100644 index 0000000000..0061331aaa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-factory-ledger-connector.ts @@ -0,0 +1,20 @@ +import { + IPluginFactoryOptions, + PluginFactory, +} from "@hyperledger/cactus-core-api"; +import { + IPluginLedgerConnectorXdaiOptions, + PluginLedgerConnectorXdai, +} from "./plugin-ledger-connector-xdai"; + +export class PluginFactoryLedgerConnector extends PluginFactory< + PluginLedgerConnectorXdai, + IPluginLedgerConnectorXdaiOptions, + IPluginFactoryOptions +> { + async create( + pluginOptions: IPluginLedgerConnectorXdaiOptions, + ): Promise { + return new PluginLedgerConnectorXdai(pluginOptions); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-ledger-connector-xdai.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-ledger-connector-xdai.ts new file mode 100644 index 0000000000..a816146351 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/plugin-ledger-connector-xdai.ts @@ -0,0 +1,600 @@ +import { Server } from "http"; +import { Server as SecureServer } from "https"; + +import { Express } from "express"; +import { promisify } from "util"; +import { Optional } from "typescript-optional"; +import Web3 from "web3"; +import { AbiItem } from "web3-utils"; + +import { Contract, ContractSendMethod } from "web3-eth-contract"; +import { TransactionReceipt } from "web3-eth"; + +import { + ConsensusAlgorithmFamily, + IPluginLedgerConnector, + IWebServiceEndpoint, + IPluginWebService, + PluginAspect, + ICactusPlugin, + ICactusPluginOptions, + IPluginKeychain, +} from "@hyperledger/cactus-core-api"; + +import { PluginRegistry } from "@hyperledger/cactus-core"; + +import { + Checks, + Logger, + LoggerProvider, + LogLevelDesc, +} from "@hyperledger/cactus-common"; + +import { DeployContractSolidityBytecodeEndpoint } from "./web-services/deploy-contract-solidity-bytecode-endpoint"; + +import { + ConsistencyStrategy, + DeployContractV1Request, + DeployContractV1Response, + EthContractInvocationType, + InvokeContractV1Request, + InvokeContractV1Response, + ReceiptType, + RunTransactionV1Request, + RunTransactionV1Response, + Web3SigningCredentialCactusKeychainRef, + Web3SigningCredentialPrivateKeyHex, + Web3SigningCredentialType, +} from "./generated/openapi/typescript-axios"; + +import { RunTransactionEndpoint } from "./web-services/run-transaction-endpoint"; +import { InvokeContractEndpoint } from "./web-services/invoke-contract-endpoint"; +import { isWeb3SigningCredentialNone } from "./model-type-guards"; +import { PrometheusExporter } from "./prometheus-exporter/prometheus-exporter"; +import { + GetPrometheusExporterMetricsEndpointV1, + IGetPrometheusExporterMetricsEndpointV1Options, +} from "./web-services/get-prometheus-exporter-metrics-endpoint-v1"; + +export const E_KEYCHAIN_NOT_FOUND = "cactus.connector.xdai.keychain_not_found"; + +export interface IPluginLedgerConnectorXdaiOptions + extends ICactusPluginOptions { + rpcApiHttpHost: string; + pluginRegistry: PluginRegistry; + prometheusExporter?: PrometheusExporter; + logLevel?: LogLevelDesc; +} + +export class PluginLedgerConnectorXdai + implements + IPluginLedgerConnector< + DeployContractV1Request, + DeployContractV1Response, + RunTransactionV1Request, + RunTransactionV1Response + >, + ICactusPlugin, + IPluginWebService { + private readonly instanceId: string; + public prometheusExporter: PrometheusExporter; + private readonly log: Logger; + private readonly web3: Web3; + private readonly pluginRegistry: PluginRegistry; + private contracts: { + [name: string]: Contract; + } = {}; + + private endpoints: IWebServiceEndpoint[] | undefined; + private httpServer: Server | SecureServer | null = null; + + public static readonly CLASS_NAME = "PluginLedgerConnectorXdai"; + + public get className(): string { + return PluginLedgerConnectorXdai.CLASS_NAME; + } + + constructor(public readonly options: IPluginLedgerConnectorXdaiOptions) { + const fnTag = `${this.className}#constructor()`; + Checks.truthy(options, `${fnTag} arg options`); + Checks.truthy(options.rpcApiHttpHost, `${fnTag} options.rpcApiHttpHost`); + Checks.truthy(options.instanceId, `${fnTag} options.instanceId`); + Checks.truthy(options.pluginRegistry, `${fnTag} options.pluginRegistry`); + + const level = this.options.logLevel || "INFO"; + const label = this.className; + this.log = LoggerProvider.getOrCreate({ level, label }); + + const web3Provider = new Web3.providers.HttpProvider( + this.options.rpcApiHttpHost, + ); + this.web3 = new Web3(web3Provider); + this.instanceId = options.instanceId; + this.pluginRegistry = options.pluginRegistry; + this.prometheusExporter = + options.prometheusExporter || + new PrometheusExporter({ pollingIntervalInMin: 1 }); + Checks.truthy( + this.prometheusExporter, + `${fnTag} options.prometheusExporter`, + ); + + this.prometheusExporter.startMetricsCollection(); + } + + public getPrometheusExporter(): PrometheusExporter { + return this.prometheusExporter; + } + + public async getPrometheusExporterMetrics(): Promise { + const res: string = await this.prometheusExporter.getPrometheusMetrics(); + this.log.debug(`getPrometheusExporterMetrics() response: %o`, res); + return res; + } + + public getInstanceId(): string { + return this.instanceId; + } + + public getHttpServer(): Optional { + return Optional.ofNullable(this.httpServer); + } + + public async shutdown(): Promise { + const serverMaybe = this.getHttpServer(); + if (serverMaybe.isPresent()) { + const server = serverMaybe.get(); + await promisify(server.close.bind(server))(); + } + } + + async registerWebServices(app: Express): Promise { + const webServices = await this.getOrCreateWebServices(); + await Promise.all(webServices.map((ws) => ws.registerExpress(app))); + return webServices; + } + + public async getOrCreateWebServices(): Promise { + if (Array.isArray(this.endpoints)) { + return this.endpoints; + } + + const endpoints: IWebServiceEndpoint[] = []; + { + const endpoint = new DeployContractSolidityBytecodeEndpoint({ + connector: this, + logLevel: this.options.logLevel, + }); + endpoints.push(endpoint); + } + { + const endpoint = new RunTransactionEndpoint({ + connector: this, + logLevel: this.options.logLevel, + }); + endpoints.push(endpoint); + } + { + const endpoint = new InvokeContractEndpoint({ + connector: this, + logLevel: this.options.logLevel, + }); + endpoints.push(endpoint); + } + { + const opts: IGetPrometheusExporterMetricsEndpointV1Options = { + connector: this, + logLevel: this.options.logLevel, + }; + const endpoint = new GetPrometheusExporterMetricsEndpointV1(opts); + endpoints.push(endpoint); + } + this.endpoints = endpoints; + return endpoints; + } + + public getPackageName(): string { + return `@hyperledger/cactus-plugin-ledger-connector-xdai`; + } + + public getAspect(): PluginAspect { + return PluginAspect.LEDGER_CONNECTOR; + } + + public async getConsensusAlgorithmFamily(): Promise< + ConsensusAlgorithmFamily + > { + return ConsensusAlgorithmFamily.AUTHORITY; + } + + public async invokeContract( + req: InvokeContractV1Request, + ): Promise { + const fnTag = `${this.className}#invokeContract()`; + const contractName = req.contractName; + + if (req.keychainId != undefined) { + const networkId = await this.web3.eth.net.getId(); + const keychainPlugin = this.pluginRegistry.findOneByKeychainId( + req.keychainId, + ); + Checks.truthy( + keychainPlugin, + `${fnTag} keychain for ID:"${req.keychainId}"`, + ); + if (!keychainPlugin.has(contractName)) { + throw new Error( + `${fnTag} Cannot create an instance of the contract because the contractName and the contractName of the JSON doesn't match`, + ); + } + const contractJSON = (await keychainPlugin.get(contractName)) as any; + if ( + contractJSON.networks === undefined || + contractJSON.networks[networkId] === undefined || + contractJSON.networks[networkId].address === undefined + ) { + if (isWeb3SigningCredentialNone(req.signingCredential)) { + throw new Error(`${fnTag} Cannot deploy contract with pre-signed TX`); + } + const web3SigningCredential = req.signingCredential as + | Web3SigningCredentialPrivateKeyHex + | Web3SigningCredentialCactusKeychainRef; + + const receipt = await this.transact({ + transactionConfig: { + data: `0x${contractJSON.bytecode}`, + from: web3SigningCredential.ethAccount, + gas: req.gas, + gasPrice: req.gasPrice, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NODETXPOOLACK, + timeoutMs: req.timeoutMs || 60000, + }, + web3SigningCredential, + }); + + const address = { + address: receipt.transactionReceipt.contractAddress, + }; + const network = { [networkId]: address }; + contractJSON.networks = network; + keychainPlugin.set(contractName, contractJSON); + } + const contract = new this.web3.eth.Contract( + contractJSON.abi, + contractJSON.networks[networkId].address, + ); + this.contracts[contractName] = contract; + } else { + throw new Error( + `${fnTag} Cannot invoke a contract without contract instance, the keychainId param is needed`, + ); + } + + const contractInstance = this.contracts[contractName]; + const methodRef = contractInstance.methods[req.methodName]; + Checks.truthy(methodRef, `${fnTag} YourContract.${req.methodName}`); + const method: ContractSendMethod = methodRef(...req.params); + + if (req.invocationType === EthContractInvocationType.CALL) { + const callOutput = await (method as any).call(); + const success = true; + return { success, callOutput }; + } else if (req.invocationType === EthContractInvocationType.SEND) { + if (isWeb3SigningCredentialNone(req.signingCredential)) { + throw new Error(`${fnTag} Cannot deploy contract with pre-signed TX`); + } + const web3SigningCredential = req.signingCredential as + | Web3SigningCredentialPrivateKeyHex + | Web3SigningCredentialCactusKeychainRef; + const payload = (method.send as any).request(); + const { params } = payload; + const [transactionConfig] = params; + if (req.gas == undefined) { + req.gas = await this.web3.eth.estimateGas(transactionConfig); + } + transactionConfig.from = web3SigningCredential.ethAccount; + transactionConfig.gas = req.gas; + transactionConfig.gasPrice = req.gasPrice; + transactionConfig.value = req.value; + transactionConfig.nonce = req.nonce; + const txReq: RunTransactionV1Request = { + transactionConfig, + web3SigningCredential, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NODETXPOOLACK, + timeoutMs: req.timeoutMs || 60000, + }, + }; + const out = await this.transact(txReq); + //const transactionReceipt = out.transactionReceipt; + const success = out.transactionReceipt.status; + const data = { success, out }; + return data; + } else { + throw new Error( + `${fnTag} Unsupported invocation type ${req.invocationType}`, + ); + } + } + + public async transact( + req: RunTransactionV1Request, + ): Promise { + const fnTag = `${this.className}#transact()`; + + switch (req.web3SigningCredential.type) { + // Web3SigningCredentialType.GETHKEYCHAINPASSWORD is removed as Hyperledger Xdai doesn't support the PERSONAL api + // for --rpc-http-api as per the discussion mentioned here + // https://chat.hyperledger.org/channel/xdai-contributors?msg=GqQXfW3k79ygRtx5Q + case Web3SigningCredentialType.CACTUSKEYCHAINREF: { + return this.transactCactusKeychainRef(req); + } + case Web3SigningCredentialType.PRIVATEKEYHEX: { + return this.transactPrivateKey(req); + } + case Web3SigningCredentialType.NONE: { + if (req.transactionConfig.rawTransaction) { + return this.transactSigned(req); + } else { + throw new Error( + `${fnTag} Expected pre-signed raw transaction ` + + ` since signing credential is specified as` + + `Web3SigningCredentialType.NONE`, + ); + } + } + default: { + throw new Error( + `${fnTag} Unrecognized Web3SigningCredentialType: ` + + `${req.web3SigningCredential.type} Supported ones are: ` + + `${Object.values(Web3SigningCredentialType).join(";")}`, + ); + } + } + } + + public async transactSigned( + req: RunTransactionV1Request, + ): Promise { + const fnTag = `${this.className}#transactSigned()`; + + Checks.truthy(req.consistencyStrategy, `${fnTag}:req.consistencyStrategy`); + Checks.truthy( + req.transactionConfig.rawTransaction, + `${fnTag}:req.transactionConfig.rawTransaction`, + ); + const rawTx = req.transactionConfig.rawTransaction as string; + this.log.debug("Starting web3.eth.sendSignedTransaction(rawTransaction) "); + const txPoolReceipt = await this.web3.eth.sendSignedTransaction(rawTx); + this.log.debug("Received preliminary receipt from Xdai node."); + + if (txPoolReceipt instanceof Error) { + this.log.debug(`${fnTag} sendSignedTransaction failed`, txPoolReceipt); + throw txPoolReceipt; + } + this.prometheusExporter.addCurrentTransaction(); + + if ( + req.consistencyStrategy.receiptType === ReceiptType.NODETXPOOLACK && + req.consistencyStrategy.blockConfirmations > 0 + ) { + throw new Error( + `${fnTag} Conflicting parameters for consistency` + + ` strategy: Cannot wait for >0 block confirmations AND only wait ` + + ` for the tx pool ACK at the same time.`, + ); + } + + switch (req.consistencyStrategy.receiptType) { + case ReceiptType.NODETXPOOLACK: + return { transactionReceipt: txPoolReceipt }; + case ReceiptType.LEDGERBLOCKACK: + this.log.debug("Starting poll for ledger TX receipt ..."); + const txHash = txPoolReceipt.transactionHash; + const { consistencyStrategy } = req; + const ledgerReceipt = await this.pollForTxReceipt( + txHash, + consistencyStrategy, + ); + this.log.debug( + "Finished poll for ledger TX receipt: %o", + ledgerReceipt, + ); + return { transactionReceipt: ledgerReceipt }; + default: + throw new Error( + `${fnTag} Unrecognized ReceiptType: ${req.consistencyStrategy.receiptType}`, + ); + } + } + + public async transactPrivateKey( + req: RunTransactionV1Request, + ): Promise { + const fnTag = `${this.className}#transactPrivateKey()`; + const { transactionConfig, web3SigningCredential } = req; + const { + secret, + } = web3SigningCredential as Web3SigningCredentialPrivateKeyHex; + + const signedTx = await this.web3.eth.accounts.signTransaction( + transactionConfig, + secret, + ); + + if (signedTx.rawTransaction) { + req.transactionConfig.rawTransaction = signedTx.rawTransaction; + return this.transactSigned(req); + } else { + throw new Error( + `${fnTag} Failed to sign eth transaction. ` + + `signedTransaction.rawTransaction is blank after .signTransaction().`, + ); + } + } + + public async transactCactusKeychainRef( + req: RunTransactionV1Request, + ): Promise { + const fnTag = `${this.className}#transactCactusKeychainRef()`; + const { transactionConfig, web3SigningCredential } = req; + const { + ethAccount, + keychainEntryKey, + keychainId, + } = web3SigningCredential as Web3SigningCredentialCactusKeychainRef; + + // locate the keychain plugin that has access to the keychain backend + // denoted by the keychainID from the request. + const keychainPlugin = this.pluginRegistry + .findManyByAspect(PluginAspect.KEYCHAIN) + .find((k) => k.getKeychainId() === keychainId); + + Checks.truthy(keychainPlugin, `${fnTag} keychain for ID:"${keychainId}"`); + + // Now use the found keychain plugin to actually perform the lookup of + // the private key that we need to run the transaction. + const privateKeyHex = await keychainPlugin?.get(keychainEntryKey); + + return this.transactPrivateKey({ + transactionConfig, + web3SigningCredential: { + ethAccount, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + secret: privateKeyHex, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NODETXPOOLACK, + timeoutMs: 60000, + }, + }); + } + + public async pollForTxReceipt( + txHash: string, + consistencyStrategy: ConsistencyStrategy, + ): Promise { + const fnTag = `${this.className}#pollForTxReceipt()`; + let txReceipt; + let timedOut = false; + let tries = 0; + let confirmationCount = 0; + const timeoutMs = consistencyStrategy.timeoutMs || Number.MAX_SAFE_INTEGER; + const startedAt = new Date(); + + do { + tries++; + timedOut = Date.now() >= startedAt.getTime() + timeoutMs; + if (timedOut) { + break; + } + + txReceipt = await this.web3.eth.getTransactionReceipt(txHash); + if (!txReceipt) { + continue; + } + + const latestBlockNo = await this.web3.eth.getBlockNumber(); + confirmationCount = latestBlockNo - txReceipt.blockNumber; + } while (confirmationCount >= consistencyStrategy.blockConfirmations); + + if (!txReceipt) { + throw new Error(`${fnTag} Timed out ${timeoutMs}ms, polls=${tries}`); + } + return txReceipt; + } + + public async deployContract( + req: DeployContractV1Request, + ): Promise { + const fnTag = `${this.className}#deployContract()`; + Checks.truthy(req, `${fnTag} req`); + if (isWeb3SigningCredentialNone(req.web3SigningCredential)) { + throw new Error(`${fnTag} Cannot deploy contract with pre-signed TX`); + } + const { contractName } = req; + if (req.keychainId != undefined && req.contractName != undefined) { + const keychainPlugin = this.pluginRegistry.findOneByKeychainId( + req.keychainId, + ); + Checks.truthy( + keychainPlugin, + `${fnTag} keychain for ID:"${req.keychainId}"`, + ); + if (!keychainPlugin.has(req.contractName)) { + throw new Error( + `${fnTag} Cannot create an instance of the contract because the contractName and the contractName on the keychain does not match`, + ); + } + const networkId = await this.web3.eth.net.getId(); + + const tmpContract = new this.web3.eth.Contract(req.contractAbi); + const deployment = tmpContract.deploy({ + data: req.bytecode, + arguments: req.constructorArgs, + }); + + const abi = deployment.encodeABI(); + const data = abi.startsWith("0x") ? abi : `0x${abi}`; + this.log.debug(`Deploying "${req.contractName}" with data %o`, data); + + const web3SigningCredential = req.web3SigningCredential as + | Web3SigningCredentialPrivateKeyHex + | Web3SigningCredentialCactusKeychainRef; + const runTxResponse = await this.transact({ + transactionConfig: { + data, + from: web3SigningCredential.ethAccount, + gas: req.gas, + gasPrice: req.gasPrice, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NODETXPOOLACK, + timeoutMs: req.timeoutMs || 60000, + }, + web3SigningCredential, + }); + + const keychainHasContract = await keychainPlugin.has(contractName); + if (keychainHasContract) { + this.log.debug(`Keychain has the contract, updating networks...`); + + const { transactionReceipt: receipt } = runTxResponse; + const { status, contractAddress } = receipt; + + if (status && contractAddress) { + const networkInfo = { address: contractAddress }; + + type SolcJson = { + abi: AbiItem[]; + networks: unknown; + }; + const contractJSON = await keychainPlugin.get(contractName); + + this.log.debug("Contract JSON: \n%o", JSON.stringify(contractJSON)); + + const contract = new this.web3.eth.Contract( + contractJSON.abi, + contractAddress, + ); + this.contracts[contractName] = contract; + + const network = { [networkId]: networkInfo }; + contractJSON.networks = network; + + keychainPlugin.set(contractName, contractJSON); + } + } + return runTxResponse; + } + throw new Error( + `${fnTag} Cannot deploy contract without keychainId and the contractName`, + ); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/data-fetcher.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/data-fetcher.ts new file mode 100644 index 0000000000..ef6375f804 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/data-fetcher.ts @@ -0,0 +1,8 @@ +import { Transactions } from "./response.type"; + +import { totalTxCount, K_CACTUS_XDAI_TOTAL_TX_COUNT } from "./metrics"; + +export async function collectMetrics(transactions: Transactions) { + transactions.counter++; + totalTxCount.labels(K_CACTUS_XDAI_TOTAL_TX_COUNT).set(transactions.counter); +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/metrics.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/metrics.ts new file mode 100644 index 0000000000..0a46752f6f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/metrics.ts @@ -0,0 +1,9 @@ +import { Gauge } from "prom-client"; + +export const K_CACTUS_XDAI_TOTAL_TX_COUNT = "cactus_xdai_total_tx_count"; + +export const totalTxCount = new Gauge({ + name: "cactus_xdai_total_tx_count", + help: "Total transactions executed", + labelNames: ["type"], +}); diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/prometheus-exporter.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/prometheus-exporter.ts new file mode 100644 index 0000000000..43bfbdc710 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/prometheus-exporter.ts @@ -0,0 +1,37 @@ +import promClient from "prom-client"; +import { Transactions } from "./response.type"; +import { collectMetrics } from "./data-fetcher"; +import { K_CACTUS_XDAI_TOTAL_TX_COUNT } from "./metrics"; + +export interface IPrometheusExporterOptions { + pollingIntervalInMin?: number; +} + +export class PrometheusExporter { + public readonly metricsPollingIntervalInMin: number; + public readonly transactions: Transactions = { counter: 0 }; + + constructor( + public readonly prometheusExporterOptions: IPrometheusExporterOptions, + ) { + this.metricsPollingIntervalInMin = + prometheusExporterOptions.pollingIntervalInMin || 1; + } + + public addCurrentTransaction(): void { + collectMetrics(this.transactions); + } + + public async getPrometheusMetrics(): Promise { + const result = await promClient.register.getSingleMetricAsString( + K_CACTUS_XDAI_TOTAL_TX_COUNT, + ); + return result; + } + + public startMetricsCollection(): void { + const Registry = promClient.Registry; + const register = new Registry(); + promClient.collectDefaultMetrics({ register }); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/response.type.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/response.type.ts new file mode 100644 index 0000000000..3f1bc7f491 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/prometheus-exporter/response.type.ts @@ -0,0 +1,3 @@ +export type Transactions = { + counter: number; +}; diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/public-api.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/public-api.ts new file mode 100755 index 0000000000..fc480bfa66 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/public-api.ts @@ -0,0 +1,17 @@ +export { + E_KEYCHAIN_NOT_FOUND, + IPluginLedgerConnectorXdaiOptions, + PluginLedgerConnectorXdai, +} from "./plugin-ledger-connector-xdai"; +export { PluginFactoryLedgerConnector } from "./plugin-factory-ledger-connector"; + +import { IPluginFactoryOptions } from "@hyperledger/cactus-core-api"; +import { PluginFactoryLedgerConnector } from "./plugin-factory-ledger-connector"; + +export * from "./generated/openapi/typescript-axios/index"; + +export async function createPluginFactory( + pluginFactoryOptions: IPluginFactoryOptions, +): Promise { + return new PluginFactoryLedgerConnector(pluginFactoryOptions); +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/deploy-contract-solidity-bytecode-endpoint.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/deploy-contract-solidity-bytecode-endpoint.ts new file mode 100644 index 0000000000..adeb9a0a5f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/deploy-contract-solidity-bytecode-endpoint.ts @@ -0,0 +1,104 @@ +import { Express, Request, Response } from "express"; + +import { + IWebServiceEndpoint, + IExpressRequestHandler, + IEndpointAuthzOptions, +} from "@hyperledger/cactus-core-api"; + +import { + Logger, + Checks, + LogLevelDesc, + LoggerProvider, + IAsyncProvider, +} from "@hyperledger/cactus-common"; + +import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; + +import { PluginLedgerConnectorXdai } from "../plugin-ledger-connector-xdai"; +import { DeployContractV1Request } from "../generated/openapi/typescript-axios"; +import OAS from "../../json/openapi.json"; + +export interface IDeployContractSolidityBytecodeOptions { + logLevel?: LogLevelDesc; + connector: PluginLedgerConnectorXdai; +} + +export class DeployContractSolidityBytecodeEndpoint + implements IWebServiceEndpoint { + public static readonly CLASS_NAME = "DeployContractSolidityBytecodeEndpoint"; + + private readonly log: Logger; + + public get className(): string { + return DeployContractSolidityBytecodeEndpoint.CLASS_NAME; + } + + constructor(public readonly options: IDeployContractSolidityBytecodeOptions) { + const fnTag = `${this.className}#constructor()`; + Checks.truthy(options, `${fnTag} arg options`); + Checks.truthy(options.connector, `${fnTag} arg options.connector`); + + const level = this.options.logLevel || "INFO"; + const label = this.className; + this.log = LoggerProvider.getOrCreate({ level, label }); + } + + public getOasPath() { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode" + ]; + } + + public getPath(): string { + const apiPath = this.getOasPath(); + return apiPath.post["x-hyperledger-cactus"].http.path; + } + + public getVerbLowerCase(): string { + const apiPath = this.getOasPath(); + return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase; + } + + public getOperationId(): string { + return this.getOasPath().post.operationId; + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + // TODO: make this an injectable dependency in the constructor + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + }), + }; + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + public async handleRequest(req: Request, res: Response): Promise { + const reqTag = `${this.getVerbLowerCase()} - ${this.getPath()}`; + this.log.debug(reqTag); + const reqBody: DeployContractV1Request = req.body; + try { + const resBody = await this.options.connector.deployContract(reqBody); + res.json(resBody); + } catch (ex) { + this.log.error(`Crash while serving ${reqTag}`, ex); + res.status(500).json({ + message: "Internal Server Error", + error: ex?.stack || ex?.message, + }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/get-prometheus-exporter-metrics-endpoint-v1.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/get-prometheus-exporter-metrics-endpoint-v1.ts new file mode 100644 index 0000000000..be480af418 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/get-prometheus-exporter-metrics-endpoint-v1.ts @@ -0,0 +1,94 @@ +import { Express, Request, Response } from "express"; + +import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; + +import OAS from "../../json/openapi.json"; + +import { + IWebServiceEndpoint, + IExpressRequestHandler, + IEndpointAuthzOptions, +} from "@hyperledger/cactus-core-api"; + +import { + LogLevelDesc, + Logger, + LoggerProvider, + Checks, + IAsyncProvider, +} from "@hyperledger/cactus-common"; + +import { PluginLedgerConnectorXdai } from "../plugin-ledger-connector-xdai"; + +export interface IGetPrometheusExporterMetricsEndpointV1Options { + connector: PluginLedgerConnectorXdai; + logLevel?: LogLevelDesc; +} + +export class GetPrometheusExporterMetricsEndpointV1 + implements IWebServiceEndpoint { + private readonly log: Logger; + + constructor( + public readonly options: IGetPrometheusExporterMetricsEndpointV1Options, + ) { + const fnTag = "GetPrometheusExporterMetricsEndpointV1#constructor()"; + + Checks.truthy(options, `${fnTag} options`); + Checks.truthy(options.connector, `${fnTag} options.connector`); + + const label = "get-prometheus-exporter-metrics-endpoint"; + const level = options.logLevel || "INFO"; + this.log = LoggerProvider.getOrCreate({ label, level }); + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + // TODO: make this an injectable dependency in the constructor + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + }), + }; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + getPath(): string { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics" + ].get["x-hyperledger-cactus"].http.path; + } + + getVerbLowerCase(): string { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics" + ].get["x-hyperledger-cactus"].http.verbLowerCase; + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + + async handleRequest(req: Request, res: Response): Promise { + const fnTag = "GetPrometheusExporterMetrics#handleRequest()"; + const verbUpper = this.getVerbLowerCase().toUpperCase(); + this.log.debug(`${verbUpper} ${this.getPath()}`); + + try { + const resBody = await this.options.connector.getPrometheusExporterMetrics(); + res.status(200); + res.send(resBody); + } catch (ex) { + this.log.error(`${fnTag} failed to serve request`, ex); + res.status(500); + res.statusMessage = ex.message; + res.json({ error: ex.stack }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/invoke-contract-endpoint.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/invoke-contract-endpoint.ts new file mode 100644 index 0000000000..b34c769fe4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/invoke-contract-endpoint.ts @@ -0,0 +1,101 @@ +import { Express, Request, Response } from "express"; + +import { + Logger, + Checks, + LogLevelDesc, + LoggerProvider, + IAsyncProvider, +} from "@hyperledger/cactus-common"; +import { + IEndpointAuthzOptions, + IExpressRequestHandler, + IWebServiceEndpoint, +} from "@hyperledger/cactus-core-api"; +import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; + +import { PluginLedgerConnectorXdai } from "../plugin-ledger-connector-xdai"; + +import OAS from "../../json/openapi.json"; + +export interface IInvokeContractEndpointOptions { + logLevel?: LogLevelDesc; + connector: PluginLedgerConnectorXdai; +} + +export class InvokeContractEndpoint implements IWebServiceEndpoint { + public static readonly CLASS_NAME = "InvokeContractEndpoint"; + + private readonly log: Logger; + + public get className(): string { + return InvokeContractEndpoint.CLASS_NAME; + } + + constructor(public readonly options: IInvokeContractEndpointOptions) { + const fnTag = `${this.className}#constructor()`; + Checks.truthy(options, `${fnTag} arg options`); + Checks.truthy(options.connector, `${fnTag} arg options.connector`); + + const level = this.options.logLevel || "INFO"; + const label = this.className; + this.log = LoggerProvider.getOrCreate({ level, label }); + } + + public getOasPath() { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract" + ]; + } + + public getPath(): string { + const apiPath = this.getOasPath(); + return apiPath.post["x-hyperledger-cactus"].http.path; + } + + public getVerbLowerCase(): string { + const apiPath = this.getOasPath(); + return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase; + } + + public getOperationId(): string { + return this.getOasPath().post.operationId; + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + // TODO: make this an injectable dependency in the constructor + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + }), + }; + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + public async handleRequest(req: Request, res: Response): Promise { + const reqTag = `${this.getVerbLowerCase()} - ${this.getPath()}`; + this.log.debug(reqTag); + const reqBody = req.body; + try { + const resBody = await this.options.connector.invokeContract(reqBody); + res.json(resBody); + } catch (ex) { + this.log.error(`Crash while serving ${reqTag}`, ex); + res.status(500).json({ + message: "Internal Server Error", + error: ex?.stack || ex?.message, + }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/run-transaction-endpoint.ts b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/run-transaction-endpoint.ts new file mode 100644 index 0000000000..96d9dd0919 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/typescript/web-services/run-transaction-endpoint.ts @@ -0,0 +1,101 @@ +import { Express, Request, Response } from "express"; + +import { + Logger, + Checks, + LogLevelDesc, + LoggerProvider, + IAsyncProvider, +} from "@hyperledger/cactus-common"; +import { + IEndpointAuthzOptions, + IExpressRequestHandler, + IWebServiceEndpoint, +} from "@hyperledger/cactus-core-api"; +import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; + +import { PluginLedgerConnectorXdai } from "../plugin-ledger-connector-xdai"; + +import OAS from "../../json/openapi.json"; + +export interface IRunTransactionEndpointOptions { + logLevel?: LogLevelDesc; + connector: PluginLedgerConnectorXdai; +} + +export class RunTransactionEndpoint implements IWebServiceEndpoint { + public static readonly CLASS_NAME = "RunTransactionEndpoint"; + + private readonly log: Logger; + + public get className(): string { + return RunTransactionEndpoint.CLASS_NAME; + } + + constructor(public readonly options: IRunTransactionEndpointOptions) { + const fnTag = `${this.className}#constructor()`; + Checks.truthy(options, `${fnTag} arg options`); + Checks.truthy(options.connector, `${fnTag} arg options.connector`); + + const level = this.options.logLevel || "INFO"; + const label = this.className; + this.log = LoggerProvider.getOrCreate({ level, label }); + } + + public getOasPath() { + return OAS.paths[ + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction" + ]; + } + + public getPath(): string { + const apiPath = this.getOasPath(); + return apiPath.post["x-hyperledger-cactus"].http.path; + } + + public getVerbLowerCase(): string { + const apiPath = this.getOasPath(); + return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase; + } + + public getOperationId(): string { + return this.getOasPath().post.operationId; + } + + getAuthorizationOptionsProvider(): IAsyncProvider { + // TODO: make this an injectable dependency in the constructor + return { + get: async () => ({ + isProtected: true, + requiredRoles: [], + }), + }; + } + + public async registerExpress( + expressApp: Express, + ): Promise { + await registerWebServiceEndpoint(expressApp, this); + return this; + } + + public getExpressRequestHandler(): IExpressRequestHandler { + return this.handleRequest.bind(this); + } + + public async handleRequest(req: Request, res: Response): Promise { + const reqTag = `${this.getVerbLowerCase()} - ${this.getPath()}`; + this.log.debug(reqTag); + const reqBody = req.body; + try { + const resBody = await this.options.connector.transact(reqBody); + res.json({ success: true, data: resBody }); + } catch (ex) { + this.log.error(`Crash while serving ${reqTag}`, ex); + res.status(500).json({ + message: "Internal Server Error", + error: ex?.stack || ex?.message, + }); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/test/solidity/hello-world-contract/HelloWorld.json b/packages/cactus-plugin-ledger-connector-xdai/src/test/solidity/hello-world-contract/HelloWorld.json new file mode 100644 index 0000000000..286294b996 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/test/solidity/hello-world-contract/HelloWorld.json @@ -0,0 +1,5619 @@ +{ + "contractName": "HelloWorld", + "abi": [ + { + "inputs": [], + "name": "sayHello", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getName", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getNameByIndex", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newName", + "type": "string" + } + ], + "name": "setName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getNameByIndex\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sayHello\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newName\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/jordigironamezcua/pruebas/contracts/HelloWorld.sol\":\"HelloWorld\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/jordigironamezcua/pruebas/contracts/HelloWorld.sol\":{\"keccak256\":\"0x1e97027d32e8c3433b793d7b2b45e30ea2d341c96a3943508ba068dea106efab\",\"urls\":[\"bzz-raw://96e37a0bb119b1fe14a4e71627c077b180f4deb9acc4284aa987a3ca1a6f45b1\",\"dweb:/ipfs/QmTAiGsxb38hMgDgbrtLLdYxc76CposiN9moBuJXAg2Mgk\"]}},\"version\":1}", + "bytecode": "60806040526040518060400160405280600d81526020017f4361707461696e436163747573000000000000000000000000000000000000008152506000908051906020019061004f929190610062565b5034801561005c57600080fd5b50610166565b82805461006e90610105565b90600052602060002090601f01602090048101928261009057600085556100d7565b82601f106100a957805160ff19168380011785556100d7565b828001600101855582156100d7579182015b828111156100d65782518255916020019190600101906100bb565b5b5090506100e491906100e8565b5090565b5b808211156101015760008160009055506001016100e9565b5090565b6000600282049050600182168061011d57607f821691505b6020821081141561013157610130610137565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b61082c806101756000396000f3fe60806040526004361061004a5760003560e01c806317d7de7c1461004f57806359c293f11461007a578063c47f0027146100b7578063d0e30db0146100e0578063ef5fb05b146100ea575b600080fd5b34801561005b57600080fd5b50610064610115565b60405161007191906105ae565b60405180910390f35b34801561008657600080fd5b506100a1600480360381019061009c919061050c565b6101a7565b6040516100ae91906105ae565b60405180910390f35b3480156100c357600080fd5b506100de60048036038101906100d991906104cb565b61027d565b005b6100e86102d3565b005b3480156100f657600080fd5b506100ff61036e565b60405161010c91906105ae565b60405180910390f35b6060600080546101249061070f565b80601f01602080910402602001604051908101604052809291908181526020018280546101509061070f565b801561019d5780601f106101725761010080835404028352916020019161019d565b820191906000526020600020905b81548152906001019060200180831161018057829003601f168201915b5050505050905090565b6060600282815481106101e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200180546101f89061070f565b80601f01602080910402602001604051908101604052809291908181526020018280546102249061070f565b80156102715780601f1061024657610100808354040283529160200191610271565b820191906000526020600020905b81548152906001019060200180831161025457829003601f168201915b50505050509050919050565b80600090805190602001906102939291906103ab565b506002819080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906102cf9291906103ab565b5050565b60003411610316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161030d906105d0565b60405180910390fd5b34600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610365919061066d565b92505081905550565b60606040518060400160405280600c81526020017f48656c6c6f20576f726c64210000000000000000000000000000000000000000815250905090565b8280546103b79061070f565b90600052602060002090601f0160209004810192826103d95760008555610420565b82601f106103f257805160ff1916838001178555610420565b82800160010185558215610420579182015b8281111561041f578251825591602001919060010190610404565b5b50905061042d9190610431565b5090565b5b8082111561044a576000816000905550600101610432565b5090565b600061046161045c84610621565b6105f0565b90508281526020810184848401111561047957600080fd5b6104848482856106cd565b509392505050565b600082601f83011261049d57600080fd5b81356104ad84826020860161044e565b91505092915050565b6000813590506104c5816107df565b92915050565b6000602082840312156104dd57600080fd5b600082013567ffffffffffffffff8111156104f757600080fd5b6105038482850161048c565b91505092915050565b60006020828403121561051e57600080fd5b600061052c848285016104b6565b91505092915050565b600061054082610651565b61054a818561065c565b935061055a8185602086016106dc565b610563816107ce565b840191505092915050565b600061057b601b8361065c565b91507f56616c7565206d757374206265206469666572656e74206f66203000000000006000830152602082019050919050565b600060208201905081810360008301526105c88184610535565b905092915050565b600060208201905081810360008301526105e98161056e565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156106175761061661079f565b5b8060405250919050565b600067ffffffffffffffff82111561063c5761063b61079f565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000610678826106c3565b9150610683836106c3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156106b8576106b7610741565b5b828201905092915050565b6000819050919050565b82818337600083830152505050565b60005b838110156106fa5780820151818401526020810190506106df565b83811115610709576000848401525b50505050565b6000600282049050600182168061072757607f821691505b6020821081141561073b5761073a610770565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6107e8816106c3565b81146107f357600080fd5b5056fea2646970667358221220450aa5d16069485df7d037ffe43b6593e232f4ac514d9169ba271384cc5d841964736f6c63430008000033", + "deployedBytecode": "60806040526004361061004a5760003560e01c806317d7de7c1461004f57806359c293f11461007a578063c47f0027146100b7578063d0e30db0146100e0578063ef5fb05b146100ea575b600080fd5b34801561005b57600080fd5b50610064610115565b60405161007191906105ae565b60405180910390f35b34801561008657600080fd5b506100a1600480360381019061009c919061050c565b6101a7565b6040516100ae91906105ae565b60405180910390f35b3480156100c357600080fd5b506100de60048036038101906100d991906104cb565b61027d565b005b6100e86102d3565b005b3480156100f657600080fd5b506100ff61036e565b60405161010c91906105ae565b60405180910390f35b6060600080546101249061070f565b80601f01602080910402602001604051908101604052809291908181526020018280546101509061070f565b801561019d5780601f106101725761010080835404028352916020019161019d565b820191906000526020600020905b81548152906001019060200180831161018057829003601f168201915b5050505050905090565b6060600282815481106101e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200180546101f89061070f565b80601f01602080910402602001604051908101604052809291908181526020018280546102249061070f565b80156102715780601f1061024657610100808354040283529160200191610271565b820191906000526020600020905b81548152906001019060200180831161025457829003601f168201915b50505050509050919050565b80600090805190602001906102939291906103ab565b506002819080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906102cf9291906103ab565b5050565b60003411610316576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161030d906105d0565b60405180910390fd5b34600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610365919061066d565b92505081905550565b60606040518060400160405280600c81526020017f48656c6c6f20576f726c64210000000000000000000000000000000000000000815250905090565b8280546103b79061070f565b90600052602060002090601f0160209004810192826103d95760008555610420565b82601f106103f257805160ff1916838001178555610420565b82800160010185558215610420579182015b8281111561041f578251825591602001919060010190610404565b5b50905061042d9190610431565b5090565b5b8082111561044a576000816000905550600101610432565b5090565b600061046161045c84610621565b6105f0565b90508281526020810184848401111561047957600080fd5b6104848482856106cd565b509392505050565b600082601f83011261049d57600080fd5b81356104ad84826020860161044e565b91505092915050565b6000813590506104c5816107df565b92915050565b6000602082840312156104dd57600080fd5b600082013567ffffffffffffffff8111156104f757600080fd5b6105038482850161048c565b91505092915050565b60006020828403121561051e57600080fd5b600061052c848285016104b6565b91505092915050565b600061054082610651565b61054a818561065c565b935061055a8185602086016106dc565b610563816107ce565b840191505092915050565b600061057b601b8361065c565b91507f56616c7565206d757374206265206469666572656e74206f66203000000000006000830152602082019050919050565b600060208201905081810360008301526105c88184610535565b905092915050565b600060208201905081810360008301526105e98161056e565b9050919050565b6000604051905081810181811067ffffffffffffffff821117156106175761061661079f565b5b8060405250919050565b600067ffffffffffffffff82111561063c5761063b61079f565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b6000610678826106c3565b9150610683836106c3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156106b8576106b7610741565b5b828201905092915050565b6000819050919050565b82818337600083830152505050565b60005b838110156106fa5780820151818401526020810190506106df565b83811115610709576000848401525b50505050565b6000600282049050600182168061072757607f821691505b6020821081141561073b5761073a610770565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6107e8816106c3565b81146107f357600080fd5b5056fea2646970667358221220450aa5d16069485df7d037ffe43b6593e232f4ac514d9169ba271384cc5d841964736f6c63430008000033", + "immutableReferences": {}, + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:516:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "58:269:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "68:22:2", + "value": { + "arguments": [ + { + "name": "data", + "nodeType": "YulIdentifier", + "src": "82:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "88:1:2", + "type": "", + "value": "2" + } + ], + "functionName": { + "name": "div", + "nodeType": "YulIdentifier", + "src": "78:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "78:12:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "68:6:2" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "99:38:2", + "value": { + "arguments": [ + { + "name": "data", + "nodeType": "YulIdentifier", + "src": "129:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "135:1:2", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "125:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "125:12:2" + }, + "variables": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulTypedName", + "src": "103:18:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "176:51:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "190:27:2", + "value": { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "204:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "212:4:2", + "type": "", + "value": "0x7f" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "200:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "200:17:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "190:6:2" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulIdentifier", + "src": "156:18:2" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "149:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "149:26:2" + }, + "nodeType": "YulIf", + "src": "146:2:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "279:42:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x22", + "nodeType": "YulIdentifier", + "src": "293:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "293:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "293:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulIdentifier", + "src": "243:18:2" + }, + { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "266:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "274:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "lt", + "nodeType": "YulIdentifier", + "src": "263:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "263:14:2" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "240:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "240:38:2" + }, + "nodeType": "YulIf", + "src": "237:2:2" + } + ] + }, + "name": "extract_byte_array_length", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "data", + "nodeType": "YulTypedName", + "src": "42:4:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "51:6:2", + "type": "" + } + ], + "src": "7:320:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "361:152:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "378:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "381:77:2", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "371:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "371:88:2" + }, + "nodeType": "YulExpressionStatement", + "src": "371:88:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "475:1:2", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "478:4:2", + "type": "", + "value": "0x22" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "468:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "468:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "468:15:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "499:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "502:4:2", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "492:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "492:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "492:15:2" + } + ] + }, + "name": "panic_error_0x22", + "nodeType": "YulFunctionDefinition", + "src": "333:180:2" + } + ] + }, + "contents": "{\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n}\n", + "id": 2, + "language": "Yul", + "name": "#utility.yul" + } + ], + "deployedGeneratedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:5780:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "91:260:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "101:74:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "167:6:2" + } + ], + "functionName": { + "name": "array_allocation_size_t_string_memory_ptr", + "nodeType": "YulIdentifier", + "src": "125:41:2" + }, + "nodeType": "YulFunctionCall", + "src": "125:49:2" + } + ], + "functionName": { + "name": "allocateMemory", + "nodeType": "YulIdentifier", + "src": "110:14:2" + }, + "nodeType": "YulFunctionCall", + "src": "110:65:2" + }, + "variableNames": [ + { + "name": "array", + "nodeType": "YulIdentifier", + "src": "101:5:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "array", + "nodeType": "YulIdentifier", + "src": "191:5:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "198:6:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "184:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "184:21:2" + }, + "nodeType": "YulExpressionStatement", + "src": "184:21:2" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "214:27:2", + "value": { + "arguments": [ + { + "name": "array", + "nodeType": "YulIdentifier", + "src": "229:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "236:4:2", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "225:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "225:16:2" + }, + "variables": [ + { + "name": "dst", + "nodeType": "YulTypedName", + "src": "218:3:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "279:16:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "288:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "291:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "281:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "281:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "281:12:2" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "src", + "nodeType": "YulIdentifier", + "src": "260:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "265:6:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "256:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "256:16:2" + }, + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "274:3:2" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "253:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "253:25:2" + }, + "nodeType": "YulIf", + "src": "250:2:2" + }, + { + "expression": { + "arguments": [ + { + "name": "src", + "nodeType": "YulIdentifier", + "src": "328:3:2" + }, + { + "name": "dst", + "nodeType": "YulIdentifier", + "src": "333:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "338:6:2" + } + ], + "functionName": { + "name": "copy_calldata_to_memory", + "nodeType": "YulIdentifier", + "src": "304:23:2" + }, + "nodeType": "YulFunctionCall", + "src": "304:41:2" + }, + "nodeType": "YulExpressionStatement", + "src": "304:41:2" + } + ] + }, + "name": "abi_decode_available_length_t_string_memory_ptr", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "src", + "nodeType": "YulTypedName", + "src": "64:3:2", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "69:6:2", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "77:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "array", + "nodeType": "YulTypedName", + "src": "85:5:2", + "type": "" + } + ], + "src": "7:344:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "433:211:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "482:16:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "491:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "494:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "484:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "484:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "484:12:2" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "461:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "469:4:2", + "type": "", + "value": "0x1f" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "457:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "457:17:2" + }, + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "476:3:2" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "453:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "453:27:2" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "446:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "446:35:2" + }, + "nodeType": "YulIf", + "src": "443:2:2" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "507:34:2", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "534:6:2" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "521:12:2" + }, + "nodeType": "YulFunctionCall", + "src": "521:20:2" + }, + "variables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "511:6:2", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "550:88:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "611:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "619:4:2", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "607:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "607:17:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "626:6:2" + }, + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "634:3:2" + } + ], + "functionName": { + "name": "abi_decode_available_length_t_string_memory_ptr", + "nodeType": "YulIdentifier", + "src": "559:47:2" + }, + "nodeType": "YulFunctionCall", + "src": "559:79:2" + }, + "variableNames": [ + { + "name": "array", + "nodeType": "YulIdentifier", + "src": "550:5:2" + } + ] + } + ] + }, + "name": "abi_decode_t_string_memory_ptr", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "411:6:2", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "419:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "array", + "nodeType": "YulTypedName", + "src": "427:5:2", + "type": "" + } + ], + "src": "371:273:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "702:87:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "712:29:2", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "734:6:2" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "721:12:2" + }, + "nodeType": "YulFunctionCall", + "src": "721:20:2" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "712:5:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "777:5:2" + } + ], + "functionName": { + "name": "validator_revert_t_uint256", + "nodeType": "YulIdentifier", + "src": "750:26:2" + }, + "nodeType": "YulFunctionCall", + "src": "750:33:2" + }, + "nodeType": "YulExpressionStatement", + "src": "750:33:2" + } + ] + }, + "name": "abi_decode_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "680:6:2", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "688:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "696:5:2", + "type": "" + } + ], + "src": "650:139:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "871:299:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "917:16:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "926:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "929:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "919:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "919:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "919:12:2" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "892:7:2" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "901:9:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "888:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "888:23:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "913:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "884:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "884:32:2" + }, + "nodeType": "YulIf", + "src": "881:2:2" + }, + { + "nodeType": "YulBlock", + "src": "943:220:2", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "958:45:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "989:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1000:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "985:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "985:17:2" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "972:12:2" + }, + "nodeType": "YulFunctionCall", + "src": "972:31:2" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "962:6:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1050:16:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1059:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1062:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1052:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "1052:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "1052:12:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "1022:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1030:18:2", + "type": "", + "value": "0xffffffffffffffff" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "1019:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "1019:30:2" + }, + "nodeType": "YulIf", + "src": "1016:2:2" + }, + { + "nodeType": "YulAssignment", + "src": "1080:73:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1125:9:2" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "1136:6:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1121:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1121:22:2" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "1145:7:2" + } + ], + "functionName": { + "name": "abi_decode_t_string_memory_ptr", + "nodeType": "YulIdentifier", + "src": "1090:30:2" + }, + "nodeType": "YulFunctionCall", + "src": "1090:63:2" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "1080:6:2" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_string_memory_ptr", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "841:9:2", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "852:7:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "864:6:2", + "type": "" + } + ], + "src": "795:375:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1242:196:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "1288:16:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1297:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1300:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1290:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "1290:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "1290:12:2" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "1263:7:2" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1272:9:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1259:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1259:23:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1284:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1255:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1255:32:2" + }, + "nodeType": "YulIf", + "src": "1252:2:2" + }, + { + "nodeType": "YulBlock", + "src": "1314:117:2", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "1329:15:2", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1343:1:2", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "1333:6:2", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "1358:63:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "1393:9:2" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "1404:6:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1389:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1389:22:2" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "1413:7:2" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "1368:20:2" + }, + "nodeType": "YulFunctionCall", + "src": "1368:53:2" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "1358:6:2" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "1212:9:2", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "1223:7:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "1235:6:2", + "type": "" + } + ], + "src": "1176:262:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1536:272:2", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "1546:53:2", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1593:5:2" + } + ], + "functionName": { + "name": "array_length_t_string_memory_ptr", + "nodeType": "YulIdentifier", + "src": "1560:32:2" + }, + "nodeType": "YulFunctionCall", + "src": "1560:39:2" + }, + "variables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "1550:6:2", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "1608:78:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1674:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1679:6:2" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1615:58:2" + }, + "nodeType": "YulFunctionCall", + "src": "1615:71:2" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1608:3:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1721:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1728:4:2", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1717:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1717:16:2" + }, + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1735:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1740:6:2" + } + ], + "functionName": { + "name": "copy_memory_to_memory", + "nodeType": "YulIdentifier", + "src": "1695:21:2" + }, + "nodeType": "YulFunctionCall", + "src": "1695:52:2" + }, + "nodeType": "YulExpressionStatement", + "src": "1695:52:2" + }, + { + "nodeType": "YulAssignment", + "src": "1756:46:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1767:3:2" + }, + { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1794:6:2" + } + ], + "functionName": { + "name": "round_up_to_mul_of_32", + "nodeType": "YulIdentifier", + "src": "1772:21:2" + }, + "nodeType": "YulFunctionCall", + "src": "1772:29:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1763:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1763:39:2" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "1756:3:2" + } + ] + } + ] + }, + "name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1517:5:2", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "1524:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "1532:3:2", + "type": "" + } + ], + "src": "1444:364:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1960:179:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1970:74:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "2036:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2041:2:2", + "type": "", + "value": "27" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1977:58:2" + }, + "nodeType": "YulFunctionCall", + "src": "1977:67:2" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1970:3:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "2065:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2070:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2061:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2061:11:2" + }, + { + "kind": "string", + "nodeType": "YulLiteral", + "src": "2074:29:2", + "type": "", + "value": "Value must be diferent of 0" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2054:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "2054:50:2" + }, + "nodeType": "YulExpressionStatement", + "src": "2054:50:2" + }, + { + "nodeType": "YulAssignment", + "src": "2114:19:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "2125:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2130:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2121:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2121:12:2" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "2114:3:2" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "1948:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "1956:3:2", + "type": "" + } + ], + "src": "1814:325:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2263:195:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "2273:26:2", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2285:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2296:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2281:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2281:18:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2273:4:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2320:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2331:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2316:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2316:17:2" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2339:4:2" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2345:9:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "2335:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2335:20:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2309:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "2309:47:2" + }, + "nodeType": "YulExpressionStatement", + "src": "2309:47:2" + }, + { + "nodeType": "YulAssignment", + "src": "2365:86:2", + "value": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "2437:6:2" + }, + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2446:4:2" + } + ], + "functionName": { + "name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "2373:63:2" + }, + "nodeType": "YulFunctionCall", + "src": "2373:78:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2365:4:2" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_string_memory_ptr__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "2235:9:2", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "2247:6:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "2258:4:2", + "type": "" + } + ], + "src": "2145:313:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2635:248:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "2645:26:2", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2657:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2668:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2653:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2653:18:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2645:4:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2692:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2703:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2688:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2688:17:2" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2711:4:2" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2717:9:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "2707:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2707:20:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2681:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "2681:47:2" + }, + "nodeType": "YulExpressionStatement", + "src": "2681:47:2" + }, + { + "nodeType": "YulAssignment", + "src": "2737:139:2", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2871:4:2" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "2745:124:2" + }, + "nodeType": "YulFunctionCall", + "src": "2745:131:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2737:4:2" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "2615:9:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "2630:4:2", + "type": "" + } + ], + "src": "2464:419:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2929:243:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "2939:19:2", + "value": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2955:2:2", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "2949:5:2" + }, + "nodeType": "YulFunctionCall", + "src": "2949:9:2" + }, + "variableNames": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "2939:6:2" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "2967:35:2", + "value": { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "2989:6:2" + }, + { + "name": "size", + "nodeType": "YulIdentifier", + "src": "2997:4:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2985:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2985:17:2" + }, + "variables": [ + { + "name": "newFreePtr", + "nodeType": "YulTypedName", + "src": "2971:10:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "3113:22:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nodeType": "YulIdentifier", + "src": "3115:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "3115:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "3115:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "newFreePtr", + "nodeType": "YulIdentifier", + "src": "3056:10:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3068:18:2", + "type": "", + "value": "0xffffffffffffffff" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "3053:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "3053:34:2" + }, + { + "arguments": [ + { + "name": "newFreePtr", + "nodeType": "YulIdentifier", + "src": "3092:10:2" + }, + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "3104:6:2" + } + ], + "functionName": { + "name": "lt", + "nodeType": "YulIdentifier", + "src": "3089:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "3089:22:2" + } + ], + "functionName": { + "name": "or", + "nodeType": "YulIdentifier", + "src": "3050:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "3050:62:2" + }, + "nodeType": "YulIf", + "src": "3047:2:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3151:2:2", + "type": "", + "value": "64" + }, + { + "name": "newFreePtr", + "nodeType": "YulIdentifier", + "src": "3155:10:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "3144:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "3144:22:2" + }, + "nodeType": "YulExpressionStatement", + "src": "3144:22:2" + } + ] + }, + "name": "allocateMemory", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "size", + "nodeType": "YulTypedName", + "src": "2913:4:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "2922:6:2", + "type": "" + } + ], + "src": "2889:283:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "3245:265:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "3350:22:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x41", + "nodeType": "YulIdentifier", + "src": "3352:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "3352:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "3352:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "3322:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3330:18:2", + "type": "", + "value": "0xffffffffffffffff" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "3319:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "3319:30:2" + }, + "nodeType": "YulIf", + "src": "3316:2:2" + }, + { + "nodeType": "YulAssignment", + "src": "3402:41:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "3418:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3426:4:2", + "type": "", + "value": "0x1f" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "3414:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3414:17:2" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3437:4:2", + "type": "", + "value": "0x1f" + } + ], + "functionName": { + "name": "not", + "nodeType": "YulIdentifier", + "src": "3433:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3433:9:2" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "3410:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3410:33:2" + }, + "variableNames": [ + { + "name": "size", + "nodeType": "YulIdentifier", + "src": "3402:4:2" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "3480:23:2", + "value": { + "arguments": [ + { + "name": "size", + "nodeType": "YulIdentifier", + "src": "3492:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3498:4:2", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "3488:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3488:15:2" + }, + "variableNames": [ + { + "name": "size", + "nodeType": "YulIdentifier", + "src": "3480:4:2" + } + ] + } + ] + }, + "name": "array_allocation_size_t_string_memory_ptr", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "3229:6:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "size", + "nodeType": "YulTypedName", + "src": "3240:4:2", + "type": "" + } + ], + "src": "3178:332:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "3575:40:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "3586:22:2", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "3602:5:2" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "3596:5:2" + }, + "nodeType": "YulFunctionCall", + "src": "3596:12:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "3586:6:2" + } + ] + } + ] + }, + "name": "array_length_t_string_memory_ptr", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "3558:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "3568:6:2", + "type": "" + } + ], + "src": "3516:99:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "3717:73:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "3734:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "3739:6:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "3727:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "3727:19:2" + }, + "nodeType": "YulExpressionStatement", + "src": "3727:19:2" + }, + { + "nodeType": "YulAssignment", + "src": "3755:29:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "3774:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3779:4:2", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "3770:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3770:14:2" + }, + "variableNames": [ + { + "name": "updated_pos", + "nodeType": "YulIdentifier", + "src": "3755:11:2" + } + ] + } + ] + }, + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "3689:3:2", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "3694:6:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "updated_pos", + "nodeType": "YulTypedName", + "src": "3705:11:2", + "type": "" + } + ], + "src": "3621:169:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "3840:261:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "3850:25:2", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "3873:1:2" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "3855:17:2" + }, + "nodeType": "YulFunctionCall", + "src": "3855:20:2" + }, + "variableNames": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "3850:1:2" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "3884:25:2", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "3907:1:2" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "3889:17:2" + }, + "nodeType": "YulFunctionCall", + "src": "3889:20:2" + }, + "variableNames": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "3884:1:2" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4047:22:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "4049:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "4049:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4049:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "3968:1:2" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3975:66:2", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "4043:1:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "3971:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3971:74:2" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "3965:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "3965:81:2" + }, + "nodeType": "YulIf", + "src": "3962:2:2" + }, + { + "nodeType": "YulAssignment", + "src": "4079:16:2", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "4090:1:2" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "4093:1:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4086:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4086:9:2" + }, + "variableNames": [ + { + "name": "sum", + "nodeType": "YulIdentifier", + "src": "4079:3:2" + } + ] + } + ] + }, + "name": "checked_add_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "3827:1:2", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "3830:1:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nodeType": "YulTypedName", + "src": "3836:3:2", + "type": "" + } + ], + "src": "3796:305:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4152:32:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "4162:16:2", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "4173:5:2" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "4162:7:2" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "4134:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "4144:7:2", + "type": "" + } + ], + "src": "4107:77:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4241:103:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "dst", + "nodeType": "YulIdentifier", + "src": "4264:3:2" + }, + { + "name": "src", + "nodeType": "YulIdentifier", + "src": "4269:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4274:6:2" + } + ], + "functionName": { + "name": "calldatacopy", + "nodeType": "YulIdentifier", + "src": "4251:12:2" + }, + "nodeType": "YulFunctionCall", + "src": "4251:30:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4251:30:2" + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "dst", + "nodeType": "YulIdentifier", + "src": "4322:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4327:6:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4318:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4318:16:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4336:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "4311:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "4311:27:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4311:27:2" + } + ] + }, + "name": "copy_calldata_to_memory", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "src", + "nodeType": "YulTypedName", + "src": "4223:3:2", + "type": "" + }, + { + "name": "dst", + "nodeType": "YulTypedName", + "src": "4228:3:2", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "4233:6:2", + "type": "" + } + ], + "src": "4190:154:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4399:258:2", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "4409:10:2", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4418:1:2", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nodeType": "YulTypedName", + "src": "4413:1:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4478:63:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "dst", + "nodeType": "YulIdentifier", + "src": "4503:3:2" + }, + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "4508:1:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4499:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4499:11:2" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "src", + "nodeType": "YulIdentifier", + "src": "4522:3:2" + }, + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "4527:1:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4518:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4518:11:2" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "4512:5:2" + }, + "nodeType": "YulFunctionCall", + "src": "4512:18:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "4492:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "4492:39:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4492:39:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "4439:1:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4442:6:2" + } + ], + "functionName": { + "name": "lt", + "nodeType": "YulIdentifier", + "src": "4436:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "4436:13:2" + }, + "nodeType": "YulForLoop", + "post": { + "nodeType": "YulBlock", + "src": "4450:19:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "4452:15:2", + "value": { + "arguments": [ + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "4461:1:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4464:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4457:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4457:10:2" + }, + "variableNames": [ + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "4452:1:2" + } + ] + } + ] + }, + "pre": { + "nodeType": "YulBlock", + "src": "4432:3:2", + "statements": [] + }, + "src": "4428:113:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4575:76:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "dst", + "nodeType": "YulIdentifier", + "src": "4625:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4630:6:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4621:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4621:16:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4639:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "4614:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "4614:27:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4614:27:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "4556:1:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4559:6:2" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "4553:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "4553:13:2" + }, + "nodeType": "YulIf", + "src": "4550:2:2" + } + ] + }, + "name": "copy_memory_to_memory", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "src", + "nodeType": "YulTypedName", + "src": "4381:3:2", + "type": "" + }, + { + "name": "dst", + "nodeType": "YulTypedName", + "src": "4386:3:2", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "4391:6:2", + "type": "" + } + ], + "src": "4350:307:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4714:269:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "4724:22:2", + "value": { + "arguments": [ + { + "name": "data", + "nodeType": "YulIdentifier", + "src": "4738:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4744:1:2", + "type": "", + "value": "2" + } + ], + "functionName": { + "name": "div", + "nodeType": "YulIdentifier", + "src": "4734:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4734:12:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4724:6:2" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "4755:38:2", + "value": { + "arguments": [ + { + "name": "data", + "nodeType": "YulIdentifier", + "src": "4785:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4791:1:2", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "4781:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4781:12:2" + }, + "variables": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulTypedName", + "src": "4759:18:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4832:51:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "4846:27:2", + "value": { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4860:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4868:4:2", + "type": "", + "value": "0x7f" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "4856:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4856:17:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4846:6:2" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulIdentifier", + "src": "4812:18:2" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "4805:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "4805:26:2" + }, + "nodeType": "YulIf", + "src": "4802:2:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4935:42:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x22", + "nodeType": "YulIdentifier", + "src": "4949:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "4949:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4949:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulIdentifier", + "src": "4899:18:2" + }, + { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "4922:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4930:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "lt", + "nodeType": "YulIdentifier", + "src": "4919:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "4919:14:2" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "4896:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "4896:38:2" + }, + "nodeType": "YulIf", + "src": "4893:2:2" + } + ] + }, + "name": "extract_byte_array_length", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "data", + "nodeType": "YulTypedName", + "src": "4698:4:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "4707:6:2", + "type": "" + } + ], + "src": "4663:320:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5017:152:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5034:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5037:77:2", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "5027:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5027:88:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5027:88:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5131:1:2", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5134:4:2", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "5124:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5124:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5124:15:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5155:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5158:4:2", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "5148:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5148:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5148:15:2" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "4989:180:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5203:152:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5220:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5223:77:2", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "5213:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5213:88:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5213:88:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5317:1:2", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5320:4:2", + "type": "", + "value": "0x22" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "5310:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5310:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5310:15:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5341:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5344:4:2", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "5334:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5334:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5334:15:2" + } + ] + }, + "name": "panic_error_0x22", + "nodeType": "YulFunctionDefinition", + "src": "5175:180:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5389:152:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5406:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5409:77:2", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "5399:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5399:88:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5399:88:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5503:1:2", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5506:4:2", + "type": "", + "value": "0x41" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "5496:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5496:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5496:15:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5527:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5530:4:2", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "5520:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5520:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5520:15:2" + } + ] + }, + "name": "panic_error_0x41", + "nodeType": "YulFunctionDefinition", + "src": "5361:180:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5595:54:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "5605:38:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "5623:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5630:2:2", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "5619:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "5619:14:2" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5639:2:2", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nodeType": "YulIdentifier", + "src": "5635:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "5635:7:2" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "5615:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "5615:28:2" + }, + "variableNames": [ + { + "name": "result", + "nodeType": "YulIdentifier", + "src": "5605:6:2" + } + ] + } + ] + }, + "name": "round_up_to_mul_of_32", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "5578:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "result", + "nodeType": "YulTypedName", + "src": "5588:6:2", + "type": "" + } + ], + "src": "5547:102:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5698:79:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "5755:16:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5764:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5767:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "5757:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5757:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5757:12:2" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "5721:5:2" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "5746:5:2" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "5728:17:2" + }, + "nodeType": "YulFunctionCall", + "src": "5728:24:2" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "5718:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "5718:35:2" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "5711:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5711:43:2" + }, + "nodeType": "YulIf", + "src": "5708:2:2" + } + ] + }, + "name": "validator_revert_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "5691:5:2", + "type": "" + } + ], + "src": "5655:122:2" + } + ] + }, + "contents": "{\n\n function abi_decode_available_length_t_string_memory_ptr(src, length, end) -> array {\n array := allocateMemory(array_allocation_size_t_string_memory_ptr(length))\n mstore(array, length)\n let dst := add(array, 0x20)\n if gt(add(src, length), end) { revert(0, 0) }\n copy_calldata_to_memory(src, dst, length)\n }\n\n // string\n function abi_decode_t_string_memory_ptr(offset, end) -> array {\n if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }\n let length := calldataload(offset)\n array := abi_decode_available_length_t_string_memory_ptr(add(offset, 0x20), length, end)\n }\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_string_memory_ptr(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := calldataload(add(headStart, 0))\n if gt(offset, 0xffffffffffffffff) { revert(0, 0) }\n\n value0 := abi_decode_t_string_memory_ptr(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value, pos) -> end {\n let length := array_length_t_string_memory_ptr(value)\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length)\n copy_memory_to_memory(add(value, 0x20), pos, length)\n end := add(pos, round_up_to_mul_of_32(length))\n }\n\n function abi_encode_t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 27)\n\n mstore(add(pos, 0), \"Value must be diferent of 0\")\n\n end := add(pos, 32)\n }\n\n function abi_encode_tuple_t_string_memory_ptr__to_t_string_memory_ptr__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value0, tail)\n\n }\n\n function abi_encode_tuple_t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function allocateMemory(size) -> memPtr {\n memPtr := mload(64)\n let newFreePtr := add(memPtr, size)\n // protect against overflow\n if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }\n mstore(64, newFreePtr)\n }\n\n function array_allocation_size_t_string_memory_ptr(length) -> size {\n // Make sure we can allocate memory without overflow\n if gt(length, 0xffffffffffffffff) { panic_error_0x41() }\n\n // round up\n size := and(add(length, 0x1f), not(0x1f))\n\n // add length slot\n size := add(size, 0x20)\n\n }\n\n function array_length_t_string_memory_ptr(value) -> length {\n\n length := mload(value)\n\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function checked_add_t_uint256(x, y) -> sum {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x > (maxValue - y)\n if gt(x, sub(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, y)) { panic_error_0x11() }\n\n sum := add(x, y)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function copy_calldata_to_memory(src, dst, length) {\n calldatacopy(dst, src, length)\n // clear end\n mstore(add(dst, length), 0)\n }\n\n function copy_memory_to_memory(src, dst, length) {\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(dst, i), mload(add(src, i)))\n }\n if gt(i, length)\n {\n // clear end\n mstore(add(dst, length), 0)\n }\n }\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n function panic_error_0x41() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x41)\n revert(0, 0x24)\n }\n\n function round_up_to_mul_of_32(value) -> result {\n result := and(add(value, 31), not(31))\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n", + "id": 2, + "language": "Yul", + "name": "#utility.yul" + } + ], + "sourceMap": "439:671:0:-:0;;;463:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;439:671;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;7:320:2:-;;88:1;82:4;78:12;68:22;;135:1;129:4;125:12;156:18;146:2;;212:4;204:6;200:17;190:27;;146:2;274;266:6;263:14;243:18;240:38;237:2;;;293:18;;:::i;:::-;237:2;58:269;;;;:::o;333:180::-;381:77;378:1;371:88;478:4;475:1;468:15;502:4;499:1;492:15;439:671:0;;;;;;;", + "deployedSourceMap": "439:671:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;666:81;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;751:109;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;864:103;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;971:137;;;:::i;:::-;;573:89;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;666:81;706:13;738:4;731:11;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;666:81;:::o;751:109::-;811:13;843:5;849;843:12;;;;;;;;;;;;;;;;;;;;;;;836:19;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;751:109;;;:::o;864:103::-;928:7;921:4;:14;;;;;;;;;;;;:::i;:::-;;943:5;954:7;943:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;864:103;:::o;971:137::-;1031:1;1019:9;:13;1011:53;;;;;;;;;;;;:::i;:::-;;;;;;;;;1094:9;1070:8;:20;1079:10;1070:20;;;;;;;;;;;;;;;;:33;;;;;;;:::i;:::-;;;;;;;;971:137::o;573:89::-;615:13;636:21;;;;;;;;;;;;;;;;;;;573:89;:::o;-1:-1:-1:-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;7:344:2:-;;110:65;125:49;167:6;125:49;:::i;:::-;110:65;:::i;:::-;101:74;;198:6;191:5;184:21;236:4;229:5;225:16;274:3;265:6;260:3;256:16;253:25;250:2;;;291:1;288;281:12;250:2;304:41;338:6;333:3;328;304:41;:::i;:::-;91:260;;;;;;:::o;371:273::-;;476:3;469:4;461:6;457:17;453:27;443:2;;494:1;491;484:12;443:2;534:6;521:20;559:79;634:3;626:6;619:4;611:6;607:17;559:79;:::i;:::-;550:88;;433:211;;;;;:::o;650:139::-;;734:6;721:20;712:29;;750:33;777:5;750:33;:::i;:::-;702:87;;;;:::o;795:375::-;;913:2;901:9;892:7;888:23;884:32;881:2;;;929:1;926;919:12;881:2;1000:1;989:9;985:17;972:31;1030:18;1022:6;1019:30;1016:2;;;1062:1;1059;1052:12;1016:2;1090:63;1145:7;1136:6;1125:9;1121:22;1090:63;:::i;:::-;1080:73;;943:220;871:299;;;;:::o;1176:262::-;;1284:2;1272:9;1263:7;1259:23;1255:32;1252:2;;;1300:1;1297;1290:12;1252:2;1343:1;1368:53;1413:7;1404:6;1393:9;1389:22;1368:53;:::i;:::-;1358:63;;1314:117;1242:196;;;;:::o;1444:364::-;;1560:39;1593:5;1560:39;:::i;:::-;1615:71;1679:6;1674:3;1615:71;:::i;:::-;1608:78;;1695:52;1740:6;1735:3;1728:4;1721:5;1717:16;1695:52;:::i;:::-;1772:29;1794:6;1772:29;:::i;:::-;1767:3;1763:39;1756:46;;1536:272;;;;;:::o;1814:325::-;;1977:67;2041:2;2036:3;1977:67;:::i;:::-;1970:74;;2074:29;2070:1;2065:3;2061:11;2054:50;2130:2;2125:3;2121:12;2114:19;;1960:179;;;:::o;2145:313::-;;2296:2;2285:9;2281:18;2273:26;;2345:9;2339:4;2335:20;2331:1;2320:9;2316:17;2309:47;2373:78;2446:4;2437:6;2373:78;:::i;:::-;2365:86;;2263:195;;;;:::o;2464:419::-;;2668:2;2657:9;2653:18;2645:26;;2717:9;2711:4;2707:20;2703:1;2692:9;2688:17;2681:47;2745:131;2871:4;2745:131;:::i;:::-;2737:139;;2635:248;;;:::o;2889:283::-;;2955:2;2949:9;2939:19;;2997:4;2989:6;2985:17;3104:6;3092:10;3089:22;3068:18;3056:10;3053:34;3050:62;3047:2;;;3115:18;;:::i;:::-;3047:2;3155:10;3151:2;3144:22;2929:243;;;;:::o;3178:332::-;;3330:18;3322:6;3319:30;3316:2;;;3352:18;;:::i;:::-;3316:2;3437:4;3433:9;3426:4;3418:6;3414:17;3410:33;3402:41;;3498:4;3492;3488:15;3480:23;;3245:265;;;:::o;3516:99::-;;3602:5;3596:12;3586:22;;3575:40;;;:::o;3621:169::-;;3739:6;3734:3;3727:19;3779:4;3774:3;3770:14;3755:29;;3717:73;;;;:::o;3796:305::-;;3855:20;3873:1;3855:20;:::i;:::-;3850:25;;3889:20;3907:1;3889:20;:::i;:::-;3884:25;;4043:1;3975:66;3971:74;3968:1;3965:81;3962:2;;;4049:18;;:::i;:::-;3962:2;4093:1;4090;4086:9;4079:16;;3840:261;;;;:::o;4107:77::-;;4173:5;4162:16;;4152:32;;;:::o;4190:154::-;4274:6;4269:3;4264;4251:30;4336:1;4327:6;4322:3;4318:16;4311:27;4241:103;;;:::o;4350:307::-;4418:1;4428:113;4442:6;4439:1;4436:13;4428:113;;;4527:1;4522:3;4518:11;4512:18;4508:1;4503:3;4499:11;4492:39;4464:2;4461:1;4457:10;4452:15;;4428:113;;;4559:6;4556:1;4553:13;4550:2;;;4639:1;4630:6;4625:3;4621:16;4614:27;4550:2;4399:258;;;;:::o;4663:320::-;;4744:1;4738:4;4734:12;4724:22;;4791:1;4785:4;4781:12;4812:18;4802:2;;4868:4;4860:6;4856:17;4846:27;;4802:2;4930;4922:6;4919:14;4899:18;4896:38;4893:2;;;4949:18;;:::i;:::-;4893:2;4714:269;;;;:::o;4989:180::-;5037:77;5034:1;5027:88;5134:4;5131:1;5124:15;5158:4;5155:1;5148:15;5175:180;5223:77;5220:1;5213:88;5320:4;5317:1;5310:15;5344:4;5341:1;5334:15;5361:180;5409:77;5406:1;5399:88;5506:4;5503:1;5496:15;5530:4;5527:1;5520:15;5547:102;;5639:2;5635:7;5630:2;5623:5;5619:14;5615:28;5605:38;;5595:54;;;:::o;5655:122::-;5728:24;5746:5;5728:24;:::i;:::-;5721:5;5718:35;5708:2;;5767:1;5764;5757:12;5708:2;5698:79;:::o", + "source": "// *****************************************************************************\n// IMPORTANT: If you update this code then make sure to recompile\n// it and update the .json file as well so that they\n// remain in sync for consistent test executions.\n// With that said, there shouldn't be any reason to recompile this, like ever...\n// *****************************************************************************\n\npragma solidity >=0.7.0;\n\ncontract HelloWorld {\n string private name = \"CaptainCactus\";\n mapping (address => uint256) deposits;\n string[] private names; \n\n function sayHello () public pure returns (string memory) {\n return 'Hello World!';\n }\n\n function getName() public view returns (string memory)\n {\n return name;\n }\n\n function getNameByIndex(uint256 index) public view returns (string memory)\n {\n return names[index];\n }\n\n function setName(string memory newName) public\n {\n name = newName;\n names.push(newName);\n }\n\n function deposit() public payable {\n require(msg.value > 0, \"Value must be diferent of 0\");\n deposits[msg.sender] += msg.value;\n }\n}\n", + "sourcePath": "/Users/jordigironamezcua/pruebas/contracts/HelloWorld.sol", + "ast": { + "absolutePath": "/Users/jordigironamezcua/pruebas/contracts/HelloWorld.sol", + "exportedSymbols": { + "HelloWorld": [ + 76 + ] + }, + "id": 77, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + ">=", + "0.7", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "413:24:0" + }, + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 76, + "linearizedBaseContracts": [ + 76 + ], + "name": "HelloWorld", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 4, + "mutability": "mutable", + "name": "name", + "nodeType": "VariableDeclaration", + "scope": 76, + "src": "463:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string" + }, + "typeName": { + "id": 2, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "463:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "hexValue": "4361707461696e436163747573", + "id": 3, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "485:15:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_bdd2f21877c99489ddcc32737686677f40d460368c7982ce22ce4f72b41b0312", + "typeString": "literal_string \"CaptainCactus\"" + }, + "value": "CaptainCactus" + }, + "visibility": "private" + }, + { + "constant": false, + "id": 8, + "mutability": "mutable", + "name": "deposits", + "nodeType": "VariableDeclaration", + "scope": 76, + "src": "504:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 7, + "keyType": { + "id": 5, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "513:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "504:28:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueType": { + "id": 6, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "524:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 11, + "mutability": "mutable", + "name": "names", + "nodeType": "VariableDeclaration", + "scope": 76, + "src": "545:22:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_string_storage_$dyn_storage", + "typeString": "string[]" + }, + "typeName": { + "baseType": { + "id": 9, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "545:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "id": 10, + "nodeType": "ArrayTypeName", + "src": "545:8:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_string_storage_$dyn_storage_ptr", + "typeString": "string[]" + } + }, + "visibility": "private" + }, + { + "body": { + "id": 18, + "nodeType": "Block", + "src": "630:32:0", + "statements": [ + { + "expression": { + "hexValue": "48656c6c6f20576f726c6421", + "id": 16, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "643:14:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3ea2f1d0abf3fc66cf29eebb70cbd4e7fe762ef8a09bcc06c8edf641230afec0", + "typeString": "literal_string \"Hello World!\"" + }, + "value": "Hello World!" + }, + "functionReturnParameters": 15, + "id": 17, + "nodeType": "Return", + "src": "636:21:0" + } + ] + }, + "functionSelector": "ef5fb05b", + "id": 19, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "sayHello", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 12, + "nodeType": "ParameterList", + "parameters": [], + "src": "591:2:0" + }, + "returnParameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "615:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 13, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "615:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "614:15:0" + }, + "scope": 76, + "src": "573:89:0", + "stateMutability": "pure", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 26, + "nodeType": "Block", + "src": "723:24:0", + "statements": [ + { + "expression": { + "id": 24, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "738:4:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "functionReturnParameters": 23, + "id": 25, + "nodeType": "Return", + "src": "731:11:0" + } + ] + }, + "functionSelector": "17d7de7c", + "id": 27, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getName", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 20, + "nodeType": "ParameterList", + "parameters": [], + "src": "682:2:0" + }, + "returnParameters": { + "id": 23, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 22, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 27, + "src": "706:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 21, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "706:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "705:15:0" + }, + "scope": 76, + "src": "666:81:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 38, + "nodeType": "Block", + "src": "828:32:0", + "statements": [ + { + "expression": { + "baseExpression": { + "id": 34, + "name": "names", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11, + "src": "843:5:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_string_storage_$dyn_storage", + "typeString": "string storage ref[] storage ref" + } + }, + "id": 36, + "indexExpression": { + "id": 35, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29, + "src": "849:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "843:12:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "functionReturnParameters": 33, + "id": 37, + "nodeType": "Return", + "src": "836:19:0" + } + ] + }, + "functionSelector": "59c293f1", + "id": 39, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNameByIndex", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 30, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29, + "mutability": "mutable", + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 39, + "src": "775:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 28, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "775:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "774:15:0" + }, + "returnParameters": { + "id": 33, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 32, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 39, + "src": "811:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 31, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "811:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "810:15:0" + }, + "scope": 76, + "src": "751:109:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 54, + "nodeType": "Block", + "src": "913:54:0", + "statements": [ + { + "expression": { + "id": 46, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 44, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "921:4:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 45, + "name": "newName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 41, + "src": "928:7:0", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "src": "921:14:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "id": 47, + "nodeType": "ExpressionStatement", + "src": "921:14:0" + }, + { + "expression": { + "arguments": [ + { + "id": 51, + "name": "newName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 41, + "src": "954:7:0", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "expression": { + "id": 48, + "name": "names", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11, + "src": "943:5:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_string_storage_$dyn_storage", + "typeString": "string storage ref[] storage ref" + } + }, + "id": 50, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "src": "943:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_string_storage_$returns$__$", + "typeString": "function (string storage ref)" + } + }, + "id": 52, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "943:19:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 53, + "nodeType": "ExpressionStatement", + "src": "943:19:0" + } + ] + }, + "functionSelector": "c47f0027", + "id": 55, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setName", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 42, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 41, + "mutability": "mutable", + "name": "newName", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "881:21:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 40, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "881:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "880:23:0" + }, + "returnParameters": { + "id": 43, + "nodeType": "ParameterList", + "parameters": [], + "src": "913:0:0" + }, + "scope": 76, + "src": "864:103:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 74, + "nodeType": "Block", + "src": "1005:103:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 62, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 59, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4294967281, + "src": "1019:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 60, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "src": "1019:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 61, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1031:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1019:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "56616c7565206d757374206265206469666572656e74206f662030", + "id": 63, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1034:29:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e", + "typeString": "literal_string \"Value must be diferent of 0\"" + }, + "value": "Value must be diferent of 0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e", + "typeString": "literal_string \"Value must be diferent of 0\"" + } + ], + "id": 58, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4294967278, + 4294967278 + ], + "referencedDeclaration": 4294967278, + "src": "1011:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 64, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1011:53:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 65, + "nodeType": "ExpressionStatement", + "src": "1011:53:0" + }, + { + "expression": { + "id": 72, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 66, + "name": "deposits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8, + "src": "1070:8:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 69, + "indexExpression": { + "expression": { + "id": 67, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4294967281, + "src": "1079:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 68, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "1079:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1070:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "expression": { + "id": 70, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4294967281, + "src": "1094:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 71, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "src": "1094:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1070:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 73, + "nodeType": "ExpressionStatement", + "src": "1070:33:0" + } + ] + }, + "functionSelector": "d0e30db0", + "id": 75, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "deposit", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 56, + "nodeType": "ParameterList", + "parameters": [], + "src": "987:2:0" + }, + "returnParameters": { + "id": 57, + "nodeType": "ParameterList", + "parameters": [], + "src": "1005:0:0" + }, + "scope": 76, + "src": "971:137:0", + "stateMutability": "payable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 77, + "src": "439:671:0" + } + ], + "src": "413:698:0" + }, + "legacyAST": { + "absolutePath": "/Users/jordigironamezcua/pruebas/contracts/HelloWorld.sol", + "exportedSymbols": { + "HelloWorld": [ + 76 + ] + }, + "id": 77, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + ">=", + "0.7", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "413:24:0" + }, + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 76, + "linearizedBaseContracts": [ + 76 + ], + "name": "HelloWorld", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 4, + "mutability": "mutable", + "name": "name", + "nodeType": "VariableDeclaration", + "scope": 76, + "src": "463:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string" + }, + "typeName": { + "id": 2, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "463:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "hexValue": "4361707461696e436163747573", + "id": 3, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "485:15:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_bdd2f21877c99489ddcc32737686677f40d460368c7982ce22ce4f72b41b0312", + "typeString": "literal_string \"CaptainCactus\"" + }, + "value": "CaptainCactus" + }, + "visibility": "private" + }, + { + "constant": false, + "id": 8, + "mutability": "mutable", + "name": "deposits", + "nodeType": "VariableDeclaration", + "scope": 76, + "src": "504:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "typeName": { + "id": 7, + "keyType": { + "id": 5, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "513:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "504:28:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + }, + "valueType": { + "id": 6, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "524:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 11, + "mutability": "mutable", + "name": "names", + "nodeType": "VariableDeclaration", + "scope": 76, + "src": "545:22:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_string_storage_$dyn_storage", + "typeString": "string[]" + }, + "typeName": { + "baseType": { + "id": 9, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "545:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "id": 10, + "nodeType": "ArrayTypeName", + "src": "545:8:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_string_storage_$dyn_storage_ptr", + "typeString": "string[]" + } + }, + "visibility": "private" + }, + { + "body": { + "id": 18, + "nodeType": "Block", + "src": "630:32:0", + "statements": [ + { + "expression": { + "hexValue": "48656c6c6f20576f726c6421", + "id": 16, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "643:14:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3ea2f1d0abf3fc66cf29eebb70cbd4e7fe762ef8a09bcc06c8edf641230afec0", + "typeString": "literal_string \"Hello World!\"" + }, + "value": "Hello World!" + }, + "functionReturnParameters": 15, + "id": 17, + "nodeType": "Return", + "src": "636:21:0" + } + ] + }, + "functionSelector": "ef5fb05b", + "id": 19, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "sayHello", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 12, + "nodeType": "ParameterList", + "parameters": [], + "src": "591:2:0" + }, + "returnParameters": { + "id": 15, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 14, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 19, + "src": "615:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 13, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "615:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "614:15:0" + }, + "scope": 76, + "src": "573:89:0", + "stateMutability": "pure", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 26, + "nodeType": "Block", + "src": "723:24:0", + "statements": [ + { + "expression": { + "id": 24, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "738:4:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "functionReturnParameters": 23, + "id": 25, + "nodeType": "Return", + "src": "731:11:0" + } + ] + }, + "functionSelector": "17d7de7c", + "id": 27, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getName", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 20, + "nodeType": "ParameterList", + "parameters": [], + "src": "682:2:0" + }, + "returnParameters": { + "id": 23, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 22, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 27, + "src": "706:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 21, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "706:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "705:15:0" + }, + "scope": 76, + "src": "666:81:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 38, + "nodeType": "Block", + "src": "828:32:0", + "statements": [ + { + "expression": { + "baseExpression": { + "id": 34, + "name": "names", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11, + "src": "843:5:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_string_storage_$dyn_storage", + "typeString": "string storage ref[] storage ref" + } + }, + "id": 36, + "indexExpression": { + "id": 35, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 29, + "src": "849:5:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "843:12:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "functionReturnParameters": 33, + "id": 37, + "nodeType": "Return", + "src": "836:19:0" + } + ] + }, + "functionSelector": "59c293f1", + "id": 39, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getNameByIndex", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 30, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 29, + "mutability": "mutable", + "name": "index", + "nodeType": "VariableDeclaration", + "scope": 39, + "src": "775:13:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 28, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "775:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "774:15:0" + }, + "returnParameters": { + "id": 33, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 32, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 39, + "src": "811:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 31, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "811:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "810:15:0" + }, + "scope": 76, + "src": "751:109:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 54, + "nodeType": "Block", + "src": "913:54:0", + "statements": [ + { + "expression": { + "id": 46, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 44, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "921:4:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 45, + "name": "newName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 41, + "src": "928:7:0", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "src": "921:14:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "id": 47, + "nodeType": "ExpressionStatement", + "src": "921:14:0" + }, + { + "expression": { + "arguments": [ + { + "id": 51, + "name": "newName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 41, + "src": "954:7:0", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "expression": { + "id": 48, + "name": "names", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 11, + "src": "943:5:0", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_string_storage_$dyn_storage", + "typeString": "string storage ref[] storage ref" + } + }, + "id": 50, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "src": "943:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_string_storage_$returns$__$", + "typeString": "function (string storage ref)" + } + }, + "id": 52, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "943:19:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 53, + "nodeType": "ExpressionStatement", + "src": "943:19:0" + } + ] + }, + "functionSelector": "c47f0027", + "id": 55, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setName", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 42, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 41, + "mutability": "mutable", + "name": "newName", + "nodeType": "VariableDeclaration", + "scope": 55, + "src": "881:21:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 40, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "881:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "880:23:0" + }, + "returnParameters": { + "id": 43, + "nodeType": "ParameterList", + "parameters": [], + "src": "913:0:0" + }, + "scope": 76, + "src": "864:103:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 74, + "nodeType": "Block", + "src": "1005:103:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 62, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "expression": { + "id": 59, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4294967281, + "src": "1019:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 60, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "src": "1019:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 61, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1031:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1019:13:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "56616c7565206d757374206265206469666572656e74206f662030", + "id": 63, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1034:29:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e", + "typeString": "literal_string \"Value must be diferent of 0\"" + }, + "value": "Value must be diferent of 0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e2e49ac39a44b46c7e6b37baa540d6e7db7dbdc5b2c6632b03592f4b15517e5e", + "typeString": "literal_string \"Value must be diferent of 0\"" + } + ], + "id": 58, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4294967278, + 4294967278 + ], + "referencedDeclaration": 4294967278, + "src": "1011:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 64, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1011:53:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 65, + "nodeType": "ExpressionStatement", + "src": "1011:53:0" + }, + { + "expression": { + "id": 72, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 66, + "name": "deposits", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 8, + "src": "1070:8:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", + "typeString": "mapping(address => uint256)" + } + }, + "id": 69, + "indexExpression": { + "expression": { + "id": 67, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4294967281, + "src": "1079:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 68, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "1079:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1070:20:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "expression": { + "id": 70, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4294967281, + "src": "1094:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 71, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "src": "1094:9:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1070:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 73, + "nodeType": "ExpressionStatement", + "src": "1070:33:0" + } + ] + }, + "functionSelector": "d0e30db0", + "id": 75, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "deposit", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 56, + "nodeType": "ParameterList", + "parameters": [], + "src": "987:2:0" + }, + "returnParameters": { + "id": 57, + "nodeType": "ParameterList", + "parameters": [], + "src": "1005:0:0" + }, + "scope": 76, + "src": "971:137:0", + "stateMutability": "payable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 77, + "src": "439:671:0" + } + ], + "src": "413:698:0" + }, + "compiler": { + "name": "solc", + "version": "0.8.0+commit.c7dfd78e.Emscripten.clang" + }, + "networks": {}, + "schemaVersion": "3.3.3", + "updatedAt": "2021-02-12T11:15:58.676Z", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/test/solidity/hello-world-contract/HelloWorld.sol b/packages/cactus-plugin-ledger-connector-xdai/src/test/solidity/hello-world-contract/HelloWorld.sol new file mode 100644 index 0000000000..30bc8f7134 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/test/solidity/hello-world-contract/HelloWorld.sol @@ -0,0 +1,40 @@ +// ***************************************************************************** +// IMPORTANT: If you update this code then make sure to recompile +// it and update the .json file as well so that they +// remain in sync for consistent test executions. +// With that said, there shouldn't be any reason to recompile this, like ever... +// ***************************************************************************** + +pragma solidity >=0.7.0; + +contract HelloWorld { + string private name = "CaptainCactus"; + mapping (address => uint256) deposits; + string[] private names; + + function sayHello () public pure returns (string memory) { + return 'Hello World!'; + } + + function getName() public view returns (string memory) + { + return name; + } + + function getNameByIndex(uint256 index) public view returns (string memory) + { + return names[index]; + } + + function setName(string memory newName) public + { + name = newName; + names.push(newName); + } + + function deposit() public payable { + require(msg.value > 0, "Value must be diferent of 0"); + deposits[msg.sender] += msg.value; + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/api-surface.test.ts b/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/api-surface.test.ts new file mode 100644 index 0000000000..2637bbec4c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/api-surface.test.ts @@ -0,0 +1,7 @@ +import test, { Test } from "tape-promise/tape"; +import { PluginFactoryLedgerConnector } from "../../../main/typescript/public-api"; + +test("Library can be loaded", (t: Test) => { + t.ok(PluginFactoryLedgerConnector); + t.end(); +}); diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/deploy-contract-from-json-xdai.test.ts b/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/deploy-contract-from-json-xdai.test.ts new file mode 100644 index 0000000000..184ecad391 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/deploy-contract-from-json-xdai.test.ts @@ -0,0 +1,442 @@ +import test, { Test } from "tape-promise/tape"; +import { v4 as uuidv4 } from "uuid"; +import { PluginRegistry } from "@hyperledger/cactus-core"; +import { + EthContractInvocationType, + Web3SigningCredentialType, + PluginLedgerConnectorXdai, + PluginFactoryLedgerConnector, + Web3SigningCredentialCactusKeychainRef, + ReceiptType, + DefaultApi as XdaiApi, +} from "../../../main/typescript/public-api"; +import { PluginKeychainMemory } from "@hyperledger/cactus-plugin-keychain-memory"; +import { + K_DEV_WHALE_ACCOUNT_PRIVATE_KEY, + K_DEV_WHALE_ACCOUNT_PUBLIC_KEY, + OpenEthereumTestLedger, + pruneDockerAllIfGithubAction, +} from "@hyperledger/cactus-test-tooling"; +import { + LogLevelDesc, + IListenOptions, + Servers, +} from "@hyperledger/cactus-common"; +import HelloWorldContractJson from "../../solidity/hello-world-contract/HelloWorld.json"; +import Web3 from "web3"; +import { PluginImportType } from "@hyperledger/cactus-core-api"; +import express from "express"; +import bodyParser from "body-parser"; +import http from "http"; +import { AddressInfo } from "net"; +import { K_CACTUS_XDAI_TOTAL_TX_COUNT } from "../../../main/typescript/prometheus-exporter/metrics"; + +const testCase = "deploys contract via .json file"; +const logLevel: LogLevelDesc = "TRACE"; +const contractName = "HelloWorld"; + +test("BEFORE " + testCase, async (t: Test) => { + const pruning = pruneDockerAllIfGithubAction({ logLevel }); + await t.doesNotReject(pruning, "Pruning didnt throw OK"); + t.end(); +}); + +test(testCase, async (t: Test) => { + const ledger = new OpenEthereumTestLedger({}); + await ledger.start(); + + test.onFinish(async () => { + await ledger.stop(); + await ledger.destroy(); + }); + + const rpcApiHttpHost = await ledger.getRpcApiHttpHost(); + + const whalePubKey = K_DEV_WHALE_ACCOUNT_PUBLIC_KEY; + const whalePrivKey = K_DEV_WHALE_ACCOUNT_PRIVATE_KEY; + + const web3 = new Web3(rpcApiHttpHost); + const testEthAccount = web3.eth.accounts.create(uuidv4()); + + const keychainEntryKey = uuidv4(); + const keychainEntryValue = testEthAccount.privateKey; + const keychainPlugin = new PluginKeychainMemory({ + instanceId: uuidv4(), + keychainId: uuidv4(), + // pre-provision keychain with mock backend holding the private key of the + // test account that we'll reference while sending requests with the + // signing credential pointing to this keychain entry. + backend: new Map([[keychainEntryKey, keychainEntryValue]]), + logLevel, + }); + keychainPlugin.set( + HelloWorldContractJson.contractName, + HelloWorldContractJson, + ); + const factory = new PluginFactoryLedgerConnector({ + pluginImportType: PluginImportType.LOCAL, + }); + const connector: PluginLedgerConnectorXdai = await factory.create({ + rpcApiHttpHost, + logLevel, + instanceId: uuidv4(), + pluginRegistry: new PluginRegistry({ plugins: [keychainPlugin] }), + }); + + const expressApp = express(); + expressApp.use(bodyParser.json({ limit: "250mb" })); + const server = http.createServer(expressApp); + const listenOptions: IListenOptions = { + hostname: "0.0.0.0", + port: 0, + server, + }; + const addressInfo = (await Servers.listen(listenOptions)) as AddressInfo; + test.onFinish(async () => await Servers.shutdown(server)); + const { address, port } = addressInfo; + const apiHost = `http://${address}:${port}`; + const apiClient = new XdaiApi({ basePath: apiHost }); + + await connector.getOrCreateWebServices(); + await connector.registerWebServices(expressApp); + + await connector.transact({ + web3SigningCredential: { + ethAccount: whalePubKey, + secret: whalePrivKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + transactionConfig: { + from: whalePubKey, + to: testEthAccount.address, + value: 10e9, + gas: 1000000, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NODETXPOOLACK, + timeoutMs: 60000, + }, + }); + + const balance = await web3.eth.getBalance(testEthAccount.address); + t.ok(balance, "Retrieved balance of test account OK"); + t.equals(parseInt(balance, 10), 10e9, "Balance of test account is OK"); + + let contractAddress: string; + + test("deploys contract via .json file", async (t2: Test) => { + const deployOut = await connector.deployContract({ + keychainId: keychainPlugin.getKeychainId(), + contractName: HelloWorldContractJson.contractName, + contractAbi: HelloWorldContractJson.abi, + constructorArgs: [], + web3SigningCredential: { + ethAccount: whalePubKey, + secret: whalePrivKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + bytecode: HelloWorldContractJson.bytecode, + gas: 1000000, + }); + t2.ok(deployOut, "deployContract() output is truthy OK"); + t2.ok( + deployOut.transactionReceipt, + "deployContract() output.transactionReceipt is truthy OK", + ); + t2.ok( + deployOut.transactionReceipt.contractAddress, + "deployContract() output.transactionReceipt.contractAddress is truthy OK", + ); + + contractAddress = deployOut.transactionReceipt.contractAddress as string; + t2.ok( + typeof contractAddress === "string", + "contractAddress typeof string OK", + ); + + const { callOutput: helloMsg } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "sayHello", + params: [], + signingCredential: { + ethAccount: whalePubKey, + secret: whalePrivKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + }); + t2.ok(helloMsg, "sayHello() output is truthy"); + t2.true( + typeof helloMsg === "string", + "sayHello() output is type of string", + ); + }); + + test("invoke Web3SigningCredentialType.NONE", async (t2: Test) => { + const testEthAccount2 = web3.eth.accounts.create(uuidv4()); + + const { rawTransaction } = await web3.eth.accounts.signTransaction( + { + from: testEthAccount.address, + to: testEthAccount2.address, + value: 10e6, + gas: 1000000, + }, + testEthAccount.privateKey, + ); + + await connector.transact({ + web3SigningCredential: { + type: Web3SigningCredentialType.NONE, + }, + transactionConfig: { + rawTransaction, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NODETXPOOLACK, + timeoutMs: 60000, + }, + }); + + const balance2 = await web3.eth.getBalance(testEthAccount2.address); + t2.ok(balance2, "Retrieved balance of test account 2 OK"); + t2.equals(parseInt(balance2, 10), 10e6, "Balance of test account2 is OK"); + t2.end(); + }); + + test("invoke Web3SigningCredentialType.PRIVATEKEYHEX", async (t2: Test) => { + const newName = `DrCactus${uuidv4()}`; + const setNameOut = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "setName", + params: [newName], + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + nonce: 1, + }); + t2.ok(setNameOut, "setName() invocation #1 output is truthy OK"); + + try { + const setNameOutInvalid = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "setName", + params: [newName], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + nonce: 1, + }); + t2.ifError(setNameOutInvalid); + } catch (error) { + t2.notStrictEqual( + error, + "Nonce too low", + "setName() invocation with invalid nonce", + ); + } + const { callOutput: getNameOut } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "getName", + params: [], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + }); + t2.equal(getNameOut, newName, `getName() output reflects the update OK`); + + const getNameOut2 = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "getName", + params: [], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + }); + t2.ok(getNameOut2, "getName() invocation #2 output is truthy OK"); + + const response = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "deposit", + params: [], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + value: 10, + }); + t2.ok(response, "deposit() payable invocation output is truthy OK"); + + const { callOutput } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "getNameByIndex", + params: [0], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + }); + t2.equal( + callOutput, + newName, + `getNameByIndex() output reflects the update OK`, + ); + + t2.end(); + }); + + test("invoke Web3SigningCredentialType.CACTUSKEYCHAINREF", async (t2: Test) => { + const newName = `DrCactus${uuidv4()}`; + + const signingCredential: Web3SigningCredentialCactusKeychainRef = { + ethAccount: testEthAccount.address, + keychainEntryKey, + keychainId: keychainPlugin.getKeychainId(), + type: Web3SigningCredentialType.CACTUSKEYCHAINREF, + }; + + const setNameOut = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "setName", + params: [newName], + gas: 1000000, + signingCredential, + nonce: 4, + }); + t2.ok(setNameOut, "setName() invocation #1 output is truthy OK"); + + try { + const setNameOutInvalid = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "setName", + params: [newName], + gas: 1000000, + signingCredential, + nonce: 4, + }); + t2.ifError(setNameOutInvalid); + } catch (error) { + t2.notStrictEqual( + error, + "Nonce too low", + "setName() invocation with invalid nonce", + ); + } + + const { callOutput: getNameOut } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "getName", + params: [], + gas: 1000000, + signingCredential, + }); + t2.equal(getNameOut, newName, `getName() output reflects the update OK`); + + const getNameOut2 = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "getName", + params: [], + gas: 1000000, + signingCredential, + }); + t2.ok(getNameOut2, "getName() invocation #2 output is truthy OK"); + + const response = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "deposit", + params: [], + gas: 1000000, + signingCredential, + value: 10, + }); + t2.ok(response, "deposit() payable invocation output is truthy OK"); + + const { callOutput } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "getNameByIndex", + params: [1], + gas: 1000000, + signingCredential, + }); + t2.equal( + callOutput, + newName, + `getNameByIndex() output reflects the update OK`, + ); + + t2.end(); + }); + + test("get prometheus exporter metrics", async (t2: Test) => { + const res = await apiClient.getPrometheusExporterMetricsV1(); + const promMetricsOutput = + "# HELP " + + K_CACTUS_XDAI_TOTAL_TX_COUNT + + " Total transactions executed\n" + + "# TYPE " + + K_CACTUS_XDAI_TOTAL_TX_COUNT + + " gauge\n" + + K_CACTUS_XDAI_TOTAL_TX_COUNT + + '{type="' + + K_CACTUS_XDAI_TOTAL_TX_COUNT + + '"} 9'; + t2.ok(res); + t2.ok(res.data); + t2.equal(res.status, 200); + t2.true( + res.data.includes(promMetricsOutput), + "Total Transaction Count of 9 recorded as expected. RESULT OK.", + ); + t2.end(); + }); + + t.end(); +}); + +test("AFTER " + testCase, async (t: Test) => { + const pruning = pruneDockerAllIfGithubAction({ logLevel }); + await t.doesNotReject(pruning, "Pruning didnt throw OK"); + t.end(); +}); diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/invoke-contract-xdai.test.ts b/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/invoke-contract-xdai.test.ts new file mode 100644 index 0000000000..0518b184de --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/invoke-contract-xdai.test.ts @@ -0,0 +1,374 @@ +import test, { Test } from "tape"; +import { v4 as uuidv4 } from "uuid"; +import { PluginRegistry } from "@hyperledger/cactus-core"; +import { + EthContractInvocationType, + Web3SigningCredentialType, + PluginLedgerConnectorXdai, + PluginFactoryLedgerConnector, + Web3SigningCredentialCactusKeychainRef, + ReceiptType, +} from "../../../main/typescript/public-api"; +import { PluginKeychainMemory } from "@hyperledger/cactus-plugin-keychain-memory"; +import { + K_DEV_WHALE_ACCOUNT_PRIVATE_KEY, + K_DEV_WHALE_ACCOUNT_PUBLIC_KEY, + OpenEthereumTestLedger, +} from "@hyperledger/cactus-test-tooling"; +import { LogLevelDesc } from "@hyperledger/cactus-common"; +import HelloWorldContractJson from "../../solidity/hello-world-contract/HelloWorld.json"; +import Web3 from "web3"; +import { PluginImportType } from "@hyperledger/cactus-core-api"; + +test("deploys contract via .json file", async (t: Test) => { + const logLevel: LogLevelDesc = "TRACE"; + const xdaiTestLedger = new OpenEthereumTestLedger({}); + await xdaiTestLedger.start(); + + test.onFinish(async () => { + await xdaiTestLedger.stop(); + await xdaiTestLedger.destroy(); + }); + + const rpcApiHttpHost = await xdaiTestLedger.getRpcApiHttpHost(); + + const whalePubKey = K_DEV_WHALE_ACCOUNT_PUBLIC_KEY; + const whalePrivKey = K_DEV_WHALE_ACCOUNT_PRIVATE_KEY; + + const contractName = "HelloWorld"; + + const web3 = new Web3(rpcApiHttpHost); + const testEthAccount = web3.eth.accounts.create(uuidv4()); + + const keychainEntryKey = uuidv4(); + const keychainEntryValue = testEthAccount.privateKey; + const keychainPlugin = new PluginKeychainMemory({ + instanceId: uuidv4(), + keychainId: uuidv4(), + // pre-provision keychain with mock backend holding the private key of the + // test account that we'll reference while sending requests with the + // signing credential pointing to this keychain entry. + backend: new Map([[keychainEntryKey, keychainEntryValue]]), + logLevel, + }); + keychainPlugin.set( + HelloWorldContractJson.contractName, + HelloWorldContractJson, + ); + const factory = new PluginFactoryLedgerConnector({ + pluginImportType: PluginImportType.LOCAL, + }); + const connector: PluginLedgerConnectorXdai = await factory.create({ + rpcApiHttpHost, + instanceId: uuidv4(), + pluginRegistry: new PluginRegistry({ plugins: [keychainPlugin] }), + }); + + await connector.transact({ + web3SigningCredential: { + ethAccount: whalePubKey, + secret: whalePrivKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NODETXPOOLACK, + }, + transactionConfig: { + from: whalePubKey, + to: testEthAccount.address, + value: 10e9, + gas: 1000000, + }, + }); + + const balance = await web3.eth.getBalance(testEthAccount.address); + t.ok(balance, "Retrieved balance of test account OK"); + t.equals(parseInt(balance, 10), 10e9, "Balance of test account is OK"); + + let contractAddress: string; + + test("deploys contract via .json file", async (t2: Test) => { + const deployOut = await connector.deployContract({ + keychainId: keychainPlugin.getKeychainId(), + contractName: HelloWorldContractJson.contractName, + contractAbi: HelloWorldContractJson.abi, + constructorArgs: [], + web3SigningCredential: { + ethAccount: whalePubKey, + secret: whalePrivKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + bytecode: HelloWorldContractJson.bytecode, + gas: 1000000, + }); + t2.ok(deployOut, "deployContract() output is truthy OK"); + t2.ok( + deployOut.transactionReceipt, + "deployContract() output.transactionReceipt is truthy OK", + ); + t2.ok( + deployOut.transactionReceipt.contractAddress, + "deployContract() output.transactionReceipt.contractAddress is truthy OK", + ); + + contractAddress = deployOut.transactionReceipt.contractAddress as string; + t2.ok( + typeof contractAddress === "string", + "contractAddress typeof string OK", + ); + + const { callOutput: helloMsg } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "sayHello", + params: [], + signingCredential: { + ethAccount: whalePubKey, + secret: whalePrivKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + }); + t2.ok(helloMsg, "sayHello() output is truthy"); + t2.true( + typeof helloMsg === "string", + "sayHello() output is type of string", + ); + }); + + test("invoke Web3SigningCredentialType.NONE", async (t2: Test) => { + const testEthAccount2 = web3.eth.accounts.create(uuidv4()); + + const { rawTransaction } = await web3.eth.accounts.signTransaction( + { + from: testEthAccount.address, + to: testEthAccount2.address, + value: 10e6, + gas: 1000000, + }, + testEthAccount.privateKey, + ); + + await connector.transact({ + web3SigningCredential: { + type: Web3SigningCredentialType.NONE, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NODETXPOOLACK, + }, + transactionConfig: { + rawTransaction, + }, + }); + + const balance2 = await web3.eth.getBalance(testEthAccount2.address); + t2.ok(balance2, "Retrieved balance of test account 2 OK"); + t2.equals(parseInt(balance2, 10), 10e6, "Balance of test account2 is OK"); + t2.end(); + }); + + test("invoke Web3SigningCredentialType.PRIVATEKEYHEX", async (t2: Test) => { + const newName = `DrCactus${uuidv4()}`; + const setNameOut = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "setName", + params: [newName], + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + nonce: 1, + }); + t2.ok(setNameOut, "setName() invocation #1 output is truthy OK"); + + try { + const setNameOutInvalid = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "setName", + params: [newName], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + nonce: 1, + }); + t2.ifError(setNameOutInvalid.transactionReceipt); + } catch (error) { + t2.notStrictEqual( + error, + "Nonce too low", + "setName() invocation with invalid nonce", + ); + } + const { callOutput: getNameOut } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "getName", + params: [], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + }); + t2.equal(getNameOut, newName, `getName() output reflects the update OK`); + + const getNameOut2 = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "getName", + params: [], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + }); + t2.ok(getNameOut2, "getName() invocation #2 output is truthy OK"); + + const response = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "deposit", + params: [], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + value: 10, + }); + t2.ok(response, "deposit() payable invocation output is truthy OK"); + + const { callOutput } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "getNameByIndex", + params: [0], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PRIVATEKEYHEX, + }, + }); + t2.equal( + callOutput, + newName, + `getNameByIndex() output reflects the update OK`, + ); + + t2.end(); + }); + + test("invoke Web3SigningCredentialType.CACTUSKEYCHAINREF", async (t2: Test) => { + const newName = `DrCactus${uuidv4()}`; + const signingCredential: Web3SigningCredentialCactusKeychainRef = { + ethAccount: testEthAccount.address, + keychainEntryKey, + keychainId: keychainPlugin.getKeychainId(), + type: Web3SigningCredentialType.CACTUSKEYCHAINREF, + }; + + const setNameOut = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "setName", + params: [newName], + gas: 1000000, + signingCredential, + nonce: 4, + }); + t2.ok(setNameOut, "setName() invocation #1 output is truthy OK"); + + try { + const setNameOutInvalid = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "setName", + params: [newName], + gas: 1000000, + signingCredential, + nonce: 4, + }); + t2.ifError(setNameOutInvalid.transactionReceipt); + } catch (error) { + t2.notStrictEqual( + error, + "Nonce too low", + "setName() invocation with invalid nonce", + ); + } + + const { callOutput: getNameOut } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "getName", + params: [], + gas: 1000000, + signingCredential, + }); + t2.equal(getNameOut, newName, `getName() output reflects the update OK`); + + const getNameOut2 = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "getName", + params: [], + gas: 1000000, + signingCredential, + }); + t2.ok(getNameOut2, "getName() invocation #2 output is truthy OK"); + + const response = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.SEND, + methodName: "deposit", + params: [], + gas: 1000000, + signingCredential, + value: 10, + }); + t2.ok(response, "deposit() payable invocation output is truthy OK"); + + const { callOutput: callOut } = await connector.invokeContract({ + contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.CALL, + methodName: "getNameByIndex", + params: [1], + gas: 1000000, + signingCredential, + }); + t2.equal( + callOut, + newName, + `getNameByIndex() output reflects the update OK`, + ); + + t2.end(); + }); + + t.end(); +}); diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/unit/api-surface.test.ts b/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/unit/api-surface.test.ts new file mode 100644 index 0000000000..2637bbec4c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/unit/api-surface.test.ts @@ -0,0 +1,7 @@ +import test, { Test } from "tape-promise/tape"; +import { PluginFactoryLedgerConnector } from "../../../main/typescript/public-api"; + +test("Library can be loaded", (t: Test) => { + t.ok(PluginFactoryLedgerConnector); + t.end(); +}); diff --git a/packages/cactus-plugin-ledger-connector-xdai/tsconfig.json b/packages/cactus-plugin-ledger-connector-xdai/tsconfig.json new file mode 100644 index 0000000000..4ffb3de00a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist/lib/", /* Redirect output structure to the directory. */ + "declarationDir": "dist/types", + "resolveJsonModule": true, + }, + "include": [ + "./src" + ] +} \ No newline at end of file