From 9bded169e8f765f2e9279dca599c2175ce81dbbd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Mar 2022 16:47:58 -0300 Subject: [PATCH 01/81] Update lockfile (#3229) Co-authored-by: Renovate Bot --- package-lock.json | 3103 +++++++++++++++++++++++++-------------------- 1 file changed, 1739 insertions(+), 1364 deletions(-) diff --git a/package-lock.json b/package-lock.json index edb9a38c1..f7b1ecf88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,15 +47,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" + "@babel/highlight": "^7.10.4" } }, "node_modules/@babel/helper-validator-identifier": { @@ -122,6 +119,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1550,15 +1556,15 @@ "dev": true }, "node_modules/@oclif/parser": { - "version": "3.8.6", - "resolved": "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.6.tgz", - "integrity": "sha512-tXb0NKgSgNxmf6baN6naK+CCwOueaFk93FG9u202U7mTBHUKsioOUlw1SG/iPi9aJM3WE4pHLXmty59pci0OEw==", + "version": "3.8.7", + "resolved": "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.7.tgz", + "integrity": "sha512-b11xBmIUK+LuuwVGJpFs4LwQN2xj2cBWj2c4z1FtiXGrJ85h9xV6q+k136Hw0tGg1jQoRXuvuBnqQ7es7vO9/Q==", "dev": true, "dependencies": { - "@oclif/errors": "^1.2.2", + "@oclif/errors": "^1.3.5", "@oclif/linewrap": "^1.0.0", "chalk": "^4.1.0", - "tslib": "^2.0.0" + "tslib": "^2.3.1" }, "engines": { "node": ">=8.0.0" @@ -1980,9 +1986,9 @@ } }, "node_modules/@truffle/abi-utils": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.8.tgz", - "integrity": "sha512-n/9ojMthWuP1hg9JveuxctxWoRoKTh+/17RTSwlTlXTyP/kfoNxr1JcLecybXUDOIsLJ4uskqxVUZQDvj1B0PQ==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.9.tgz", + "integrity": "sha512-Nv4MGsA2vdI7G34nI0DfR/eSd5pbAUu+5EafYNqzgrS46y0LWhbIrSZ1NcM7cbhIrkpUn6OfNk49AjNM67TkSg==", "dev": true, "dependencies": { "change-case": "3.0.2", @@ -2071,9 +2077,9 @@ } }, "node_modules/@truffle/compile-common": { - "version": "0.7.27", - "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.27.tgz", - "integrity": "sha512-gs266BQTRnVoskoWj7wNrNGACMOhU6Yt+8YhaSp6k5e4/a2NBEluxXWxKIi32yWz4q7Ip306do1wcQR2fFOf8w==", + "version": "0.7.28", + "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.28.tgz", + "integrity": "sha512-mZCEQ6fkOqbKYCJDT82q0vZCxOEsKRQ0zrPfKuSJEb0gF9DXIQcnMkyJpBSWzmyvien9/A7/jPiGQoC7PmNEUg==", "dev": true, "dependencies": { "@truffle/error": "^0.1.0", @@ -2087,15 +2093,15 @@ "dev": true }, "node_modules/@truffle/contract": { - "version": "4.4.8", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.4.8.tgz", - "integrity": "sha512-zZVgIJ4zbdKX1dWubX5m9w7StMpcdEXuQorSpPQ23SUD1RwzSgnRi9Iw2rmSLNbHcO+w6L6+JFeVzFrfmI/VKA==", + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.4.10.tgz", + "integrity": "sha512-UsAZuVZ9V0oRNLR599VLuOQd5sPc5kjXRKRRGEYfB3mmnPfrJCnlSzfC5bzbGHanx6hmct3epD4Y/EFhoAit4A==", "dev": true, "dependencies": { "@ensdomains/ensjs": "^2.0.1", "@truffle/blockchain-utils": "^0.1.0", - "@truffle/contract-schema": "^3.4.4", - "@truffle/debug-utils": "^6.0.8", + "@truffle/contract-schema": "^3.4.5", + "@truffle/debug-utils": "^6.0.10", "@truffle/error": "^0.1.0", "@truffle/interface-adapter": "^0.5.11", "bignumber.js": "^7.2.1", @@ -2109,9 +2115,9 @@ } }, "node_modules/@truffle/contract-schema": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.4.tgz", - "integrity": "sha512-xWgrm6WRM2jmT04w7dP7aVbS2qyP9XPmH/mybQtFXMjJ/8BZlp0yltC8QOs8sGl6q8Ws7acp19YtRkLdK6SsmQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.5.tgz", + "integrity": "sha512-heaGV9QWqef259HaF+0is/tsmhlZIbUSWhqvj0iwKmxoN92fghKijWwdVYhPIbsmGlrQuwPTZHSCnaOlO+gsFg==", "dev": true, "dependencies": { "ajv": "^6.10.0", @@ -2142,13 +2148,13 @@ "dev": true }, "node_modules/@truffle/contract/node_modules/@truffle/codec": { - "version": "0.11.26", - "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.11.26.tgz", - "integrity": "sha512-wNVw66vSL5RSzgNMkiQVIExz7ZF1ZDNdOSPTnFlTiZCvkpJn8QJ9OpDiow9w8HmXIftt+YjueBsKu4ByyBuAPA==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.0.tgz", + "integrity": "sha512-DE/26w5jtBPPqVBseLX1cL0i3b3IUnHaHtKmQvqkEatd6T+uZfPIaiI15ru8cynR7KrYNhuSfeq9k8/N+OFN1Q==", "dev": true, "dependencies": { - "@truffle/abi-utils": "^0.2.8", - "@truffle/compile-common": "^0.7.27", + "@truffle/abi-utils": "^0.2.9", + "@truffle/compile-common": "^0.7.28", "big.js": "^5.2.2", "bn.js": "^5.1.3", "cbor": "^5.1.0", @@ -2169,17 +2175,17 @@ "dev": true }, "node_modules/@truffle/contract/node_modules/@truffle/debug-utils": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.8.tgz", - "integrity": "sha512-bkrHQZj6OVw5FCs0li69e0f6gdW+6FuOR8dgedfy8qpsVVtGQB+8cN7hnoFUwMs60vo7vW90grZu1c4855zVQw==", + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.10.tgz", + "integrity": "sha512-ZK9gwhfqJLnrPBIWe4tUmdm01KnLcbzoJHze18/Z4/dJxp7xfLAW/iL6RiKSA3+LBy85g49gt508DCYtQkDs9w==", "dev": true, "dependencies": { - "@truffle/codec": "^0.11.26", - "@trufflesuite/chromafi": "^2.2.2", + "@truffle/codec": "^0.12.0", + "@trufflesuite/chromafi": "^3.0.0", "bn.js": "^5.1.3", "chalk": "^2.4.2", "debug": "^4.3.1", - "highlightjs-solidity": "^2.0.3" + "highlightjs-solidity": "^2.0.4" } }, "node_modules/@truffle/contract/node_modules/@truffle/debug-utils/node_modules/bn.js": { @@ -2211,6 +2217,22 @@ "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", "dev": true }, + "node_modules/@truffle/contract/node_modules/@trufflesuite/chromafi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@trufflesuite/chromafi/-/chromafi-3.0.0.tgz", + "integrity": "sha512-oqWcOqn8nT1bwlPPfidfzS55vqcIDdpfzo3HbU9EnUmcSTX+I8z0UyUFI3tZQjByVJulbzxHxUGS3ZJPwK/GPQ==", + "dev": true, + "dependencies": { + "camelcase": "^4.1.0", + "chalk": "^2.3.2", + "cheerio": "^1.0.0-rc.2", + "detect-indent": "^5.0.0", + "highlight.js": "^10.4.1", + "lodash.merge": "^4.6.2", + "strip-ansi": "^4.0.0", + "strip-indent": "^2.0.0" + } + }, "node_modules/@truffle/contract/node_modules/@types/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", @@ -2267,6 +2289,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/@truffle/contract/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@truffle/contract/node_modules/eth-lib": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", @@ -2287,10 +2318,19 @@ "node": ">=4" } }, + "node_modules/@truffle/contract/node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/@truffle/contract/node_modules/highlightjs-solidity": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.3.tgz", - "integrity": "sha512-tjFm5dtIE61VQBzjlZmkCtY5fLs3CaEABbVuUNyXeW+UuOCsxMg3MsPFy0kCelHP74hPpkoqDejLrbnV1axAIw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.4.tgz", + "integrity": "sha512-jsmfDXrjjxt4LxWfzp27j4CX6qYk6B8uK8sxzEDyGts8Ut1IuVlFCysAu6n5RrgHnuEKA+SCIcGPweO7qlPhCg==", "dev": true }, "node_modules/@truffle/contract/node_modules/supports-color": { @@ -2716,6 +2756,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/@truffle/debug-utils/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@truffle/debug-utils/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -3195,9 +3244,9 @@ "dev": true }, "node_modules/@truffle/provider": { - "version": "0.2.46", - "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.46.tgz", - "integrity": "sha512-nYZNzONLrksWQJn6iiiUvXJ+EE4IDOouyvJfD1xO75ELTHcRMXh216EacJ/4Irp7uDuANHsbdrLgFT7nN6uUGw==", + "version": "0.2.47", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.47.tgz", + "integrity": "sha512-Y9VRLsdMcfEicZjxxcwA0y9pqnwJx0JX/UDeHDHZmymx3KIJwI3VpxRPighfHAmvDRksic6Yj4iL0CmiEDR5kg==", "dev": true, "dependencies": { "@truffle/error": "^0.1.0", @@ -3708,6 +3757,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/@trufflesuite/chromafi/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@trufflesuite/chromafi/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -3833,9 +3891,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.18.tgz", - "integrity": "sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA==", + "version": "17.0.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", + "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==", "dev": true }, "node_modules/@types/pbkdf2": { @@ -3910,11 +3968,10 @@ } }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -4083,6 +4140,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/ansi-mark/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/ansi-mark/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -4340,12 +4406,12 @@ "dev": true }, "node_modules/astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/async": { @@ -4650,35 +4716,26 @@ "dev": true }, "node_modules/body-parser": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz", - "integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", "dev": true, "dependencies": { - "bytes": "3.1.1", + "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", "depd": "~1.1.2", "http-errors": "1.8.1", "iconv-lite": "0.4.24", "on-finished": "~2.3.0", - "qs": "6.9.6", - "raw-body": "2.4.2", + "qs": "6.9.7", + "raw-body": "2.4.3", "type-is": "~1.6.18" }, "engines": { "node": ">= 0.8" } }, - "node_modules/body-parser/node_modules/bytes": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz", - "integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/body-parser/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -4697,6 +4754,22 @@ "node": ">= 0.6" } }, + "node_modules/body-parser/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/body-parser/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -4704,9 +4777,9 @@ "dev": true }, "node_modules/body-parser/node_modules/qs": { - "version": "6.9.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", - "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==", + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", "dev": true, "engines": { "node": ">=0.6" @@ -4716,12 +4789,12 @@ } }, "node_modules/body-parser/node_modules/raw-body": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.2.tgz", - "integrity": "sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", + "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", "dev": true, "dependencies": { - "bytes": "3.1.1", + "bytes": "3.1.2", "http-errors": "1.8.1", "iconv-lite": "0.4.24", "unpipe": "1.0.0" @@ -5369,16 +5442,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/clean-stack/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "restore-cursor": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=4" } }, "node_modules/cli-table3": { @@ -5397,6 +5470,12 @@ "colors": "^1.1.2" } }, + "node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -5700,9 +5779,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.0.tgz", - "integrity": "sha512-VaJUunCZLnxuDbo1rNOzwbet9E1K9joiXS5+DQMPtgxd24wfsZbJZMMfQLGYMlCUvSxLfsRUUhoOR2x28mFfeg==", + "version": "3.21.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.1.tgz", + "integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==", "dev": true, "hasInstallScript": true, "funding": { @@ -5820,28 +5899,17 @@ } }, "node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "engines": { - "node": ">=4.8" - } - }, - "node_modules/cross-spawn/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" + "node": ">= 8" } }, "node_modules/crypt": { @@ -6526,12 +6594,15 @@ "dev": true }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/escodegen": { @@ -6578,6 +6649,57 @@ "node": ">=0.10.0" } }, + "node_modules/escodegen/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/eslint": { "version": "7.32.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", @@ -6788,33 +6910,6 @@ "eslint": ">=4.19.1" } }, - "node_modules/eslint-plugin-es/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-plugin-es/node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/eslint-plugin-import": { "version": "2.25.4", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", @@ -6903,15 +6998,6 @@ "eslint": ">=5" } }, - "node_modules/eslint-plugin-mocha/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -6932,21 +7018,6 @@ "eslint": ">=5.16.0" } }, - "node_modules/eslint-plugin-node/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/eslint-plugin-node/node_modules/ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -6991,18 +7062,21 @@ } }, "node_modules/eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "dependencies": { "eslint-visitor-keys": "^1.1.0" }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/eslint-visitor-keys": { + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", @@ -7011,13 +7085,13 @@ "node": ">=4" } }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" + "engines": { + "node": ">=10" } }, "node_modules/eslint/node_modules/ansi-regex": { @@ -7029,15 +7103,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -7054,238 +7119,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/eslint/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/eslint/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/eslint/node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/eslint/node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true - }, - "node_modules/eslint/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/eslint/node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint/node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/eslint/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -7298,65 +7131,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/eslint/node_modules/table/node_modules/ajv": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/eslint/node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/espree": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", @@ -7371,16 +7145,13 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/espree/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, - "bin": { - "acorn": "bin/acorn" - }, "engines": { - "node": ">=0.4.0" + "node": ">=4" } }, "node_modules/esprima": { @@ -7999,17 +7770,17 @@ "dev": true }, "node_modules/express": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.2.tgz", - "integrity": "sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==", + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", + "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", "dev": true, "dependencies": { - "accepts": "~1.3.7", + "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.1", + "body-parser": "1.19.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.1", + "cookie": "0.4.2", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", @@ -8024,7 +7795,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.9.6", + "qs": "6.9.7", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.17.2", @@ -8039,15 +7810,6 @@ "node": ">= 0.10.0" } }, - "node_modules/express/node_modules/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/express/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -8073,9 +7835,9 @@ "dev": true }, "node_modules/express/node_modules/qs": { - "version": "6.9.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", - "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==", + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", "dev": true, "engines": { "node": ">=0.6" @@ -8292,18 +8054,39 @@ "node": ">=0.8.0" } }, - "node_modules/file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "dependencies": { - "flat-cache": "^2.0.1" + "escape-string-regexp": "^1.0.5" }, "engines": { "node": ">=4" } }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -8381,41 +8164,28 @@ } }, "node_modules/flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "dependencies": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=4" - } - }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, "node_modules/follow-redirects": { - "version": "1.14.8", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", - "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==", + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", "dev": true, "funding": [ { @@ -8714,6 +8484,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/ghost-testrpc/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/ghost-testrpc/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -8803,6 +8582,18 @@ "node": ">=6" } }, + "node_modules/global-prefix/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/globals": { "version": "13.12.1", "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", @@ -9067,6 +8858,15 @@ "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, + "node_modules/hardhat/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/hardhat/node_modules/find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -9541,28 +9341,28 @@ "dev": true }, "node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "dependencies": { - "depd": "~1.1.2", + "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", + "statuses": "2.0.1", "toidentifier": "1.0.1" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.8" } }, - "node_modules/http-errors/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, "engines": { - "node": ">= 0.6" + "node": ">= 0.8" } }, "node_modules/http-https": { @@ -9741,6 +9541,131 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "node_modules/inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/inquirer/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/inquirer/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/internal-slot": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", @@ -10703,13 +10628,13 @@ } }, "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -11252,6 +11177,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/log-symbols/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/log-symbols/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -11467,9 +11401,9 @@ } }, "node_modules/merkletreejs": { - "version": "0.2.27", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.27.tgz", - "integrity": "sha512-6fPGBdfbDyTiprK5JBBAxg+0u33xI3UM8EOeIz7Zy+5czuXH8vOhLMK1hMZFWPdCNgETWkpj+GOMKKhKZPOvaQ==", + "version": "0.2.30", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.30.tgz", + "integrity": "sha512-gBKGRAx8CUjAneaE48U92ObjTp2lD6iYk61ub12NI1YjpNgJ12ROGN+PlZ4G5RyKcs81ArGHRDOt08wkojMGgg==", "dev": true, "dependencies": { "bignumber.js": "^9.0.1", @@ -11559,6 +11493,15 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -11830,6 +11773,15 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/mocha/node_modules/find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -12022,6 +11974,18 @@ "node": ">=6" } }, + "node_modules/mocha/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/mocha/node_modules/wrap-ansi": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", @@ -12146,6 +12110,12 @@ "buffer": "^5.5.0" } }, + "node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, "node_modules/nan": { "version": "2.15.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", @@ -12659,6 +12629,18 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/opn": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/opn/-/opn-6.0.0.tgz", @@ -12673,17 +12655,17 @@ } }, "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" }, "engines": { "node": ">= 0.8.0" @@ -12924,12 +12906,12 @@ "dev": true }, "node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/path-parse": { @@ -13045,9 +13027,9 @@ } }, "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "engines": { "node": ">= 0.8.0" @@ -13103,18 +13085,6 @@ "node": ">=8" } }, - "node_modules/prettier-plugin-solidity/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/prettier-plugin-solidity/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -13362,13 +13332,13 @@ } }, "node_modules/raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dev": true, "dependencies": { "bytes": "3.1.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" }, @@ -13558,12 +13528,15 @@ } }, "node_modules/regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, "engines": { - "node": ">=6.5.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, "node_modules/remove-trailing-separator": { @@ -13773,6 +13746,19 @@ "lowercase-keys": "^1.0.0" } }, + "node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -14022,6 +14008,18 @@ "node": ">=0.8.0" } }, + "node_modules/sc-istanbul/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", @@ -14133,6 +14131,22 @@ "node": ">= 0.6" } }, + "node_modules/send/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -14342,24 +14356,24 @@ } }, "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "dependencies": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/shelljs": { @@ -14440,46 +14454,31 @@ } }, "node_modules/slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" + "node": ">=10" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "dependencies": { - "color-name": "1.1.3" + "engines": { + "node": ">=8" } }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, "node_modules/snake-case": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz", @@ -14861,15 +14860,6 @@ "node": ">=0.4.0" } }, - "node_modules/solhint/node_modules/ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/solhint/node_modules/ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -14891,6 +14881,15 @@ "node": ">=4" } }, + "node_modules/solhint/node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/solhint/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -14905,24 +14904,6 @@ "node": ">=4" } }, - "node_modules/solhint/node_modules/cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "dependencies": { - "restore-cursor": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/solhint/node_modules/cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, "node_modules/solhint/node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -14944,6 +14925,46 @@ "integrity": "sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ==", "dev": true }, + "node_modules/solhint/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/solhint/node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/solhint/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/solhint/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/solhint/node_modules/eslint": { "version": "5.16.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", @@ -15007,6 +15028,27 @@ "node": ">=4.0.0" } }, + "node_modules/solhint/node_modules/eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/solhint/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/solhint/node_modules/eslint/node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -15030,18 +15072,38 @@ "node": ">=6.0.0" } }, - "node_modules/solhint/node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "node_modules/solhint/node_modules/file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "flat-cache": "^2.0.1" }, "engines": { "node": ">=4" } }, + "node_modules/solhint/node_modules/flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "dependencies": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/solhint/node_modules/flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "node_modules/solhint/node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -15060,69 +15122,54 @@ "node": ">=4" } }, - "node_modules/solhint/node_modules/inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "node_modules/solhint/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "dependencies": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" }, "engines": { - "node": ">=6.0.0" + "node": ">= 0.8.0" } }, - "node_modules/solhint/node_modules/inquirer/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "node_modules/solhint/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" }, "engines": { - "node": ">=6" + "node": ">= 0.8.0" } }, - "node_modules/solhint/node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/solhint/node_modules/mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "node_modules/solhint/node_modules/onetime": { + "node_modules/solhint/node_modules/path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true, - "dependencies": { - "mimic-fn": "^1.0.0" - }, "engines": { "node": ">=4" } }, + "node_modules/solhint/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/solhint/node_modules/prettier": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", @@ -15136,17 +15183,25 @@ "node": ">=4" } }, - "node_modules/solhint/node_modules/restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "node_modules/solhint/node_modules/regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true, + "engines": { + "node": ">=6.5.0" + } + }, + "node_modules/solhint/node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "dependencies": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" + "glob": "^7.1.3" }, - "engines": { - "node": ">=4" + "bin": { + "rimraf": "bin.js" } }, "node_modules/solhint/node_modules/semver": { @@ -15158,6 +15213,67 @@ "semver": "bin/semver.js" } }, + "node_modules/solhint/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/solhint/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/solhint/node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/solhint/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/solhint/node_modules/string-width/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/solhint/node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -15179,6 +15295,45 @@ "node": ">=4" } }, + "node_modules/solhint/node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/solhint/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/solhint/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/solidity-ast": { "version": "0.4.30", "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.30.tgz", @@ -15261,6 +15416,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/solidity-coverage/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/solidity-coverage/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -15930,59 +16094,100 @@ } }, "node_modules/table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", + "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", "dev": true, "dependencies": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=6.0.0" + "node": ">=10.0.0" + } + }, + "node_modules/table/node_modules/ajv": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", + "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/table/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/table/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/table/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/table/node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/table/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/table/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/tar": { @@ -16342,12 +16547,12 @@ "dev": true }, "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "dependencies": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" }, "engines": { "node": ">= 0.8.0" @@ -16403,9 +16608,9 @@ } }, "node_modules/uglify-js": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.1.tgz", - "integrity": "sha512-FAGKF12fWdkpvNJZENacOH0e/83eG6JyVQyanIJaBXCN1J11TUQv1T1/z8S+Z0CG0ZPk1nPcreF/c7lrTd0TEQ==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.2.tgz", + "integrity": "sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==", "dev": true, "optional": true, "bin": { @@ -17199,15 +17404,18 @@ } }, "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { "isexe": "^2.0.0" }, "bin": { - "which": "bin/which" + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, "node_modules/which-boxed-primitive": { @@ -17808,9 +18016,9 @@ } }, "node_modules/yargs/node_modules/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", "dev": true, "engines": { "node": ">=12" @@ -17819,12 +18027,12 @@ }, "dependencies": { "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, "requires": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.10.4" } }, "@babel/helper-validator-identifier": { @@ -17879,6 +18087,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -18886,15 +19100,15 @@ "dev": true }, "@oclif/parser": { - "version": "3.8.6", - "resolved": "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.6.tgz", - "integrity": "sha512-tXb0NKgSgNxmf6baN6naK+CCwOueaFk93FG9u202U7mTBHUKsioOUlw1SG/iPi9aJM3WE4pHLXmty59pci0OEw==", + "version": "3.8.7", + "resolved": "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.7.tgz", + "integrity": "sha512-b11xBmIUK+LuuwVGJpFs4LwQN2xj2cBWj2c4z1FtiXGrJ85h9xV6q+k136Hw0tGg1jQoRXuvuBnqQ7es7vO9/Q==", "dev": true, "requires": { - "@oclif/errors": "^1.2.2", + "@oclif/errors": "^1.3.5", "@oclif/linewrap": "^1.0.0", "chalk": "^4.1.0", - "tslib": "^2.0.0" + "tslib": "^2.3.1" }, "dependencies": { "chalk": { @@ -19252,9 +19466,9 @@ } }, "@truffle/abi-utils": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.8.tgz", - "integrity": "sha512-n/9ojMthWuP1hg9JveuxctxWoRoKTh+/17RTSwlTlXTyP/kfoNxr1JcLecybXUDOIsLJ4uskqxVUZQDvj1B0PQ==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.9.tgz", + "integrity": "sha512-Nv4MGsA2vdI7G34nI0DfR/eSd5pbAUu+5EafYNqzgrS46y0LWhbIrSZ1NcM7cbhIrkpUn6OfNk49AjNM67TkSg==", "dev": true, "requires": { "change-case": "3.0.2", @@ -19339,9 +19553,9 @@ } }, "@truffle/compile-common": { - "version": "0.7.27", - "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.27.tgz", - "integrity": "sha512-gs266BQTRnVoskoWj7wNrNGACMOhU6Yt+8YhaSp6k5e4/a2NBEluxXWxKIi32yWz4q7Ip306do1wcQR2fFOf8w==", + "version": "0.7.28", + "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.28.tgz", + "integrity": "sha512-mZCEQ6fkOqbKYCJDT82q0vZCxOEsKRQ0zrPfKuSJEb0gF9DXIQcnMkyJpBSWzmyvien9/A7/jPiGQoC7PmNEUg==", "dev": true, "requires": { "@truffle/error": "^0.1.0", @@ -19357,15 +19571,15 @@ } }, "@truffle/contract": { - "version": "4.4.8", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.4.8.tgz", - "integrity": "sha512-zZVgIJ4zbdKX1dWubX5m9w7StMpcdEXuQorSpPQ23SUD1RwzSgnRi9Iw2rmSLNbHcO+w6L6+JFeVzFrfmI/VKA==", + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.4.10.tgz", + "integrity": "sha512-UsAZuVZ9V0oRNLR599VLuOQd5sPc5kjXRKRRGEYfB3mmnPfrJCnlSzfC5bzbGHanx6hmct3epD4Y/EFhoAit4A==", "dev": true, "requires": { "@ensdomains/ensjs": "^2.0.1", "@truffle/blockchain-utils": "^0.1.0", - "@truffle/contract-schema": "^3.4.4", - "@truffle/debug-utils": "^6.0.8", + "@truffle/contract-schema": "^3.4.5", + "@truffle/debug-utils": "^6.0.10", "@truffle/error": "^0.1.0", "@truffle/interface-adapter": "^0.5.11", "bignumber.js": "^7.2.1", @@ -19402,13 +19616,13 @@ "dev": true }, "@truffle/codec": { - "version": "0.11.26", - "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.11.26.tgz", - "integrity": "sha512-wNVw66vSL5RSzgNMkiQVIExz7ZF1ZDNdOSPTnFlTiZCvkpJn8QJ9OpDiow9w8HmXIftt+YjueBsKu4ByyBuAPA==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.0.tgz", + "integrity": "sha512-DE/26w5jtBPPqVBseLX1cL0i3b3IUnHaHtKmQvqkEatd6T+uZfPIaiI15ru8cynR7KrYNhuSfeq9k8/N+OFN1Q==", "dev": true, "requires": { - "@truffle/abi-utils": "^0.2.8", - "@truffle/compile-common": "^0.7.27", + "@truffle/abi-utils": "^0.2.9", + "@truffle/compile-common": "^0.7.28", "big.js": "^5.2.2", "bn.js": "^5.1.3", "cbor": "^5.1.0", @@ -19431,17 +19645,17 @@ } }, "@truffle/debug-utils": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.8.tgz", - "integrity": "sha512-bkrHQZj6OVw5FCs0li69e0f6gdW+6FuOR8dgedfy8qpsVVtGQB+8cN7hnoFUwMs60vo7vW90grZu1c4855zVQw==", + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.10.tgz", + "integrity": "sha512-ZK9gwhfqJLnrPBIWe4tUmdm01KnLcbzoJHze18/Z4/dJxp7xfLAW/iL6RiKSA3+LBy85g49gt508DCYtQkDs9w==", "dev": true, "requires": { - "@truffle/codec": "^0.11.26", - "@trufflesuite/chromafi": "^2.2.2", + "@truffle/codec": "^0.12.0", + "@trufflesuite/chromafi": "^3.0.0", "bn.js": "^5.1.3", "chalk": "^2.4.2", "debug": "^4.3.1", - "highlightjs-solidity": "^2.0.3" + "highlightjs-solidity": "^2.0.4" }, "dependencies": { "bn.js": { @@ -19477,6 +19691,22 @@ } } }, + "@trufflesuite/chromafi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@trufflesuite/chromafi/-/chromafi-3.0.0.tgz", + "integrity": "sha512-oqWcOqn8nT1bwlPPfidfzS55vqcIDdpfzo3HbU9EnUmcSTX+I8z0UyUFI3tZQjByVJulbzxHxUGS3ZJPwK/GPQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "chalk": "^2.3.2", + "cheerio": "^1.0.0-rc.2", + "detect-indent": "^5.0.0", + "highlight.js": "^10.4.1", + "lodash.merge": "^4.6.2", + "strip-ansi": "^4.0.0", + "strip-indent": "^2.0.0" + } + }, "@types/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", @@ -19527,6 +19757,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "eth-lib": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", @@ -19544,10 +19780,16 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "dev": true + }, "highlightjs-solidity": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.3.tgz", - "integrity": "sha512-tjFm5dtIE61VQBzjlZmkCtY5fLs3CaEABbVuUNyXeW+UuOCsxMg3MsPFy0kCelHP74hPpkoqDejLrbnV1axAIw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.4.tgz", + "integrity": "sha512-jsmfDXrjjxt4LxWfzp27j4CX6qYk6B8uK8sxzEDyGts8Ut1IuVlFCysAu6n5RrgHnuEKA+SCIcGPweO7qlPhCg==", "dev": true }, "supports-color": { @@ -19847,9 +20089,9 @@ } }, "@truffle/contract-schema": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.4.tgz", - "integrity": "sha512-xWgrm6WRM2jmT04w7dP7aVbS2qyP9XPmH/mybQtFXMjJ/8BZlp0yltC8QOs8sGl6q8Ws7acp19YtRkLdK6SsmQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.5.tgz", + "integrity": "sha512-heaGV9QWqef259HaF+0is/tsmhlZIbUSWhqvj0iwKmxoN92fghKijWwdVYhPIbsmGlrQuwPTZHSCnaOlO+gsFg==", "dev": true, "requires": { "ajv": "^6.10.0", @@ -19905,6 +20147,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -20315,9 +20563,9 @@ } }, "@truffle/provider": { - "version": "0.2.46", - "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.46.tgz", - "integrity": "sha512-nYZNzONLrksWQJn6iiiUvXJ+EE4IDOouyvJfD1xO75ELTHcRMXh216EacJ/4Irp7uDuANHsbdrLgFT7nN6uUGw==", + "version": "0.2.47", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.47.tgz", + "integrity": "sha512-Y9VRLsdMcfEicZjxxcwA0y9pqnwJx0JX/UDeHDHZmymx3KIJwI3VpxRPighfHAmvDRksic6Yj4iL0CmiEDR5kg==", "dev": true, "requires": { "@truffle/error": "^0.1.0", @@ -20757,6 +21005,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -20874,9 +21128,9 @@ "dev": true }, "@types/node": { - "version": "17.0.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.18.tgz", - "integrity": "sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA==", + "version": "17.0.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", + "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==", "dev": true }, "@types/pbkdf2": { @@ -20942,11 +21196,10 @@ } }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, - "peer": true + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true }, "acorn-jsx": { "version": "5.3.2", @@ -21072,6 +21325,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -21268,9 +21527,9 @@ "dev": true }, "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, "async": { @@ -21522,29 +21781,23 @@ "dev": true }, "body-parser": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz", - "integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", "dev": true, "requires": { - "bytes": "3.1.1", + "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", "depd": "~1.1.2", "http-errors": "1.8.1", "iconv-lite": "0.4.24", "on-finished": "~2.3.0", - "qs": "6.9.6", - "raw-body": "2.4.2", + "qs": "6.9.7", + "raw-body": "2.4.3", "type-is": "~1.6.18" }, "dependencies": { - "bytes": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz", - "integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==", - "dev": true - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -21560,6 +21813,19 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, + "http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -21567,18 +21833,18 @@ "dev": true }, "qs": { - "version": "6.9.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", - "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==", + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", "dev": true }, "raw-body": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.2.tgz", - "integrity": "sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", + "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", "dev": true, "requires": { - "bytes": "3.1.1", + "bytes": "3.1.2", "http-errors": "1.8.1", "iconv-lite": "0.4.24", "unpipe": "1.0.0" @@ -22118,14 +22384,15 @@ "dev": true, "requires": { "escape-string-regexp": "4.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - } + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" } }, "cli-table3": { @@ -22139,6 +22406,12 @@ "string-width": "^2.1.1" } }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -22403,9 +22676,9 @@ "dev": true }, "core-js-pure": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.0.tgz", - "integrity": "sha512-VaJUunCZLnxuDbo1rNOzwbet9E1K9joiXS5+DQMPtgxd24wfsZbJZMMfQLGYMlCUvSxLfsRUUhoOR2x28mFfeg==", + "version": "3.21.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.1.tgz", + "integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==", "dev": true }, "core-util-is": { @@ -22502,24 +22775,14 @@ } }, "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "crypt": { @@ -23078,9 +23341,9 @@ "dev": true }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, "escodegen": { @@ -23107,6 +23370,45 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } } } }, @@ -23158,27 +23460,12 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -23189,174 +23476,6 @@ "supports-color": "^7.1.0" } }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -23365,51 +23484,6 @@ "requires": { "ansi-regex": "^5.0.1" } - }, - "table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - } - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } } } }, @@ -23519,23 +23593,6 @@ "requires": { "eslint-utils": "^2.0.0", "regexpp": "^3.0.0" - }, - "dependencies": { - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - } } }, "eslint-plugin-import": { @@ -23603,12 +23660,6 @@ "requires": { "eslint-visitor-keys": "^2.0.0" } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true } } }, @@ -23626,15 +23677,6 @@ "semver": "^6.1.0" }, "dependencies": { - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -23667,18 +23709,26 @@ } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true }, "espree": { @@ -23692,10 +23742,10 @@ "eslint-visitor-keys": "^1.3.0" }, "dependencies": { - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true } } @@ -24272,17 +24322,17 @@ } }, "express": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.2.tgz", - "integrity": "sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==", + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", + "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", "dev": true, "requires": { - "accepts": "~1.3.7", + "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.1", + "body-parser": "1.19.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.1", + "cookie": "0.4.2", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", @@ -24297,7 +24347,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.9.6", + "qs": "6.9.7", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.17.2", @@ -24309,12 +24359,6 @@ "vary": "~1.1.2" }, "dependencies": { - "cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", - "dev": true - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -24337,9 +24381,9 @@ "dev": true }, "qs": { - "version": "6.9.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", - "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==", + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", "dev": true } } @@ -24519,13 +24563,30 @@ "websocket-driver": ">=0.5.1" } }, - "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { - "flat-cache": "^2.0.1" + "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + } + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" } }, "file-uri-to-path": { @@ -24595,37 +24656,25 @@ } }, "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - }, - "dependencies": { - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } + "flatted": "^3.1.0", + "rimraf": "^3.0.2" } }, "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, "follow-redirects": { - "version": "1.14.8", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", - "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==", + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", "dev": true }, "for-in": { @@ -24849,6 +24898,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -24917,6 +24972,17 @@ "ini": "^1.3.5", "kind-of": "^6.0.2", "which": "^1.3.1" + }, + "dependencies": { + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } } }, "globals": { @@ -25125,6 +25191,12 @@ "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -25505,22 +25577,22 @@ "dev": true }, "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "requires": { - "depd": "~1.1.2", + "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", + "statuses": "2.0.1", "toidentifier": "1.0.1" }, "dependencies": { - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true } } @@ -25661,6 +25733,106 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "internal-slot": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", @@ -26373,13 +26545,13 @@ } }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "live-server": { @@ -26839,6 +27011,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -27025,9 +27203,9 @@ } }, "merkletreejs": { - "version": "0.2.27", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.27.tgz", - "integrity": "sha512-6fPGBdfbDyTiprK5JBBAxg+0u33xI3UM8EOeIz7Zy+5czuXH8vOhLMK1hMZFWPdCNgETWkpj+GOMKKhKZPOvaQ==", + "version": "0.2.30", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.30.tgz", + "integrity": "sha512-gBKGRAx8CUjAneaE48U92ObjTp2lD6iYk61ub12NI1YjpNgJ12ROGN+PlZ4G5RyKcs81ArGHRDOt08wkojMGgg==", "dev": true, "requires": { "bignumber.js": "^9.0.1", @@ -27092,6 +27270,12 @@ "mime-db": "1.51.0" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -27317,6 +27501,12 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -27459,6 +27649,15 @@ "has-flag": "^3.0.0" } }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, "wrap-ansi": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", @@ -27580,6 +27779,12 @@ } } }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, "nan": { "version": "2.15.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", @@ -27987,6 +28192,15 @@ "wrappy": "1" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, "opn": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/opn/-/opn-6.0.0.tgz", @@ -27997,17 +28211,17 @@ } }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, "os-locale": { @@ -28200,9 +28414,9 @@ "dev": true }, "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { @@ -28291,9 +28505,9 @@ "dev": true }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "prepend-http": { @@ -28328,12 +28542,6 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -28525,13 +28733,13 @@ "dev": true }, "raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dev": true, "requires": { "bytes": "3.1.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" } @@ -28684,9 +28892,9 @@ } }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "remove-trailing-separator": { @@ -28845,6 +29053,16 @@ "lowercase-keys": "^1.0.0" } }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -29025,6 +29243,15 @@ "requires": { "has-flag": "^1.0.0" } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } } } }, @@ -29121,6 +29348,19 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, + "http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + } + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -29298,18 +29538,18 @@ } }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "shelljs": { @@ -29364,38 +29604,20 @@ "dev": true }, "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true } } @@ -29724,12 +29946,6 @@ "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", "dev": true }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -29745,6 +29961,12 @@ "color-convert": "^1.9.0" } }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -29756,21 +29978,6 @@ "supports-color": "^5.3.0" } }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -29792,6 +29999,39 @@ "integrity": "sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ==", "dev": true }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "eslint": { "version": "5.16.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", @@ -29854,6 +30094,21 @@ "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, "espree": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", @@ -29865,15 +30120,32 @@ "eslint-visitor-keys": "^1.0.0" } }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "escape-string-regexp": "^1.0.5" + "flat-cache": "^2.0.1" } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -29886,25 +30158,105 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true, + "optional": true + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" }, "dependencies": { "strip-ansi": { @@ -29918,50 +30270,6 @@ } } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", - "dev": true, - "optional": true - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -29976,6 +30284,36 @@ "requires": { "has-flag": "^3.0.0" } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } } } }, @@ -30052,6 +30390,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -30600,47 +30944,78 @@ } }, "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", + "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", "dev": true, "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" }, "dependencies": { + "ajv": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", + "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.1" } } } @@ -30948,12 +31323,12 @@ "dev": true }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" } }, "type-detect": { @@ -30994,9 +31369,9 @@ } }, "uglify-js": { - "version": "3.15.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.1.tgz", - "integrity": "sha512-FAGKF12fWdkpvNJZENacOH0e/83eG6JyVQyanIJaBXCN1J11TUQv1T1/z8S+Z0CG0ZPk1nPcreF/c7lrTd0TEQ==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.2.tgz", + "integrity": "sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==", "dev": true, "optional": true }, @@ -31666,9 +32041,9 @@ } }, "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -31985,9 +32360,9 @@ } }, "yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", "dev": true } } From f590fcdfe9dfd73d9fb4c11b9e6c58f8fd3ca23c Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Fri, 4 Mar 2022 10:40:20 -0300 Subject: [PATCH 02/81] Fix typo in Proxy.sol --- contracts/proxy/Proxy.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/proxy/Proxy.sol b/contracts/proxy/Proxy.sol index 9e8aa9124..f0e74d22f 100644 --- a/contracts/proxy/Proxy.sol +++ b/contracts/proxy/Proxy.sol @@ -53,7 +53,7 @@ abstract contract Proxy { /** * @dev Delegates the current call to the address returned by `_implementation()`. * - * This function does not return to its internall call site, it will return directly to the external caller. + * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); From c239e1af8d1a1296577108dd6989a17b57434f8e Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 4 Mar 2022 18:36:19 +0000 Subject: [PATCH 03/81] Fix typo (#3241) Fix camelcase of 'lastvalue' to 'lastValue' --- contracts/utils/structs/EnumerableSet.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index 68148e944..bd34a4bd3 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -83,12 +83,12 @@ library EnumerableSet { uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { - bytes32 lastvalue = set._values[lastIndex]; + bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is - set._values[toDeleteIndex] = lastvalue; + set._values[toDeleteIndex] = lastValue; // Update the index for the moved value - set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex + set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored From 212221d6ff86d484eef8dfa172cc787e677aa0af Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 8 Mar 2022 16:24:50 -0300 Subject: [PATCH 04/81] Add mention of OpenZeppelin Defender in readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 40ae3f98a..8eb748e81 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ :mage: **Not sure how to get started?** Check out [Contracts Wizard](https://wizard.openzeppelin.com/) — an interactive smart contract generator. +:building_construction: **Want to scale your decentralized application?** Check out [OpenZeppelin Defender](https://openzeppelin.com/defender) — a secure platform for automating and monitoring your operations. + ## Overview ### Installation From f8bfa560e9a10ffadbc278bfd4cfe8b404e5d300 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 8 Mar 2022 20:34:24 +0100 Subject: [PATCH 05/81] Use _spendAllowance in ERC20FlashMint (#3226) Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + contracts/token/ERC20/extensions/ERC20FlashMint.sol | 4 +--- test/token/ERC20/extensions/ERC20FlashMint.test.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 365c40146..31e5a1912 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * `ERC1155`: Add a `_afterTokenTransfer` hook for improved extensibility. ([#3166](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3166)) * `DoubleEndedQueue`: a new data structure that supports efficient push and pop to both front and back, useful for FIFO and LIFO queues. ([#3153](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3153)) * `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147)) + * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. ### Breaking changes diff --git a/contracts/token/ERC20/extensions/ERC20FlashMint.sol b/contracts/token/ERC20/extensions/ERC20FlashMint.sol index cbcf3b60f..3d526c2d7 100644 --- a/contracts/token/ERC20/extensions/ERC20FlashMint.sol +++ b/contracts/token/ERC20/extensions/ERC20FlashMint.sol @@ -73,9 +73,7 @@ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { receiver.onFlashLoan(msg.sender, token, amount, fee, data) == _RETURN_VALUE, "ERC20FlashMint: invalid return value" ); - uint256 currentAllowance = allowance(address(receiver), address(this)); - require(currentAllowance >= amount + fee, "ERC20FlashMint: allowance does not allow refund"); - _approve(address(receiver), address(this), currentAllowance - amount - fee); + _spendAllowance(address(receiver), address(this), amount + fee); _burn(address(receiver), amount + fee); return true; } diff --git a/test/token/ERC20/extensions/ERC20FlashMint.test.js b/test/token/ERC20/extensions/ERC20FlashMint.test.js index 97af5bb80..0ecc056d6 100644 --- a/test/token/ERC20/extensions/ERC20FlashMint.test.js +++ b/test/token/ERC20/extensions/ERC20FlashMint.test.js @@ -67,7 +67,7 @@ contract('ERC20FlashMint', function (accounts) { const receiver = await ERC3156FlashBorrowerMock.new(true, false); await expectRevert( this.token.flashLoan(receiver.address, this.token.address, loanAmount, '0x'), - 'ERC20FlashMint: allowance does not allow refund', + 'ERC20: insufficient allowance', ); }); From 62eb4568be40bf7be3fc9cbb93902ecb60431a2f Mon Sep 17 00:00:00 2001 From: Amirhossein Banavi Date: Wed, 9 Mar 2022 00:48:56 +0330 Subject: [PATCH 06/81] Optimize ERC721 _isApprovedOrOwner function (#3248) --- contracts/token/ERC721/ERC721.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 5e61eaf65..1346260a9 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -232,7 +232,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); - return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); + return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** From 8b162e39b598924ef611dba90ff9d0aa0b676ecc Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 8 Mar 2022 22:28:20 +0100 Subject: [PATCH 07/81] Add a canceller role to the TimelockController (#3165) Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + contracts/governance/TimelockController.sol | 20 ++++++-- test/governance/TimelockController.test.js | 50 ++++++++++++++----- .../GovernorTimelockControl.test.js | 24 +++++++-- 4 files changed, 73 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e5a1912..69c036e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147)) * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. + * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) ### Breaking changes diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index c375f0744..ba3d54fe1 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -24,6 +24,7 @@ contract TimelockController is AccessControl { bytes32 public constant TIMELOCK_ADMIN_ROLE = keccak256("TIMELOCK_ADMIN_ROLE"); bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); + bytes32 public constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE"); uint256 internal constant _DONE_TIMESTAMP = uint256(1); mapping(bytes32 => uint256) private _timestamps; @@ -58,7 +59,16 @@ contract TimelockController is AccessControl { event MinDelayChange(uint256 oldDuration, uint256 newDuration); /** - * @dev Initializes the contract with a given `minDelay`. + * @dev Initializes the contract with a given `minDelay`, and a list of + * initial proposers and executors. The proposers receive both the + * proposer and the canceller role (for backward compatibility). The + * executors receive the executor role. + * + * NOTE: At construction, both the deployer and the timelock itself are + * administrators. This helps further configuration of the timelock by the + * deployer. After configuration is done, it is recommended that the + * deployer renounces its admin position and relies on timelocked + * operations to perform future maintenance. */ constructor( uint256 minDelay, @@ -68,14 +78,16 @@ contract TimelockController is AccessControl { _setRoleAdmin(TIMELOCK_ADMIN_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE); _setRoleAdmin(EXECUTOR_ROLE, TIMELOCK_ADMIN_ROLE); + _setRoleAdmin(CANCELLER_ROLE, TIMELOCK_ADMIN_ROLE); // deployer + self administration _setupRole(TIMELOCK_ADMIN_ROLE, _msgSender()); _setupRole(TIMELOCK_ADMIN_ROLE, address(this)); - // register proposers + // register proposers and cancellers for (uint256 i = 0; i < proposers.length; ++i) { _setupRole(PROPOSER_ROLE, proposers[i]); + _setupRole(CANCELLER_ROLE, proposers[i]); } // register executors @@ -243,9 +255,9 @@ contract TimelockController is AccessControl { * * Requirements: * - * - the caller must have the 'proposer' role. + * - the caller must have the 'canceller' role. */ - function cancel(bytes32 id) public virtual onlyRole(PROPOSER_ROLE) { + function cancel(bytes32 id) public virtual onlyRole(CANCELLER_ROLE) { require(isOperationPending(id), "TimelockController: operation cannot be cancelled"); delete _timestamps[id]; diff --git a/test/governance/TimelockController.test.js b/test/governance/TimelockController.test.js index f39b96348..84cec6c57 100644 --- a/test/governance/TimelockController.test.js +++ b/test/governance/TimelockController.test.js @@ -43,7 +43,12 @@ function genOperationBatch (targets, values, datas, predecessor, salt) { } contract('TimelockController', function (accounts) { - const [ admin, proposer, executor, other ] = accounts; + const [ admin, proposer, canceller, executor, other ] = accounts; + + const TIMELOCK_ADMIN_ROLE = web3.utils.soliditySha3('TIMELOCK_ADMIN_ROLE'); + const PROPOSER_ROLE = web3.utils.soliditySha3('PROPOSER_ROLE'); + const EXECUTOR_ROLE = web3.utils.soliditySha3('EXECUTOR_ROLE'); + const CANCELLER_ROLE = web3.utils.soliditySha3('CANCELLER_ROLE'); beforeEach(async function () { // Deploy new timelock @@ -53,9 +58,11 @@ contract('TimelockController', function (accounts) { [ executor ], { from: admin }, ); - this.TIMELOCK_ADMIN_ROLE = await this.timelock.TIMELOCK_ADMIN_ROLE(); - this.PROPOSER_ROLE = await this.timelock.PROPOSER_ROLE(); - this.EXECUTOR_ROLE = await this.timelock.EXECUTOR_ROLE(); + + expect(await this.timelock.hasRole(CANCELLER_ROLE, proposer)).to.be.equal(true); + await this.timelock.revokeRole(CANCELLER_ROLE, proposer, { from: admin }); + await this.timelock.grantRole(CANCELLER_ROLE, canceller, { from: admin }); + // Mocks this.callreceivermock = await CallReceiverMock.new({ from: admin }); this.implementation2 = await Implementation2.new({ from: admin }); @@ -63,6 +70,23 @@ contract('TimelockController', function (accounts) { it('initial state', async function () { expect(await this.timelock.getMinDelay()).to.be.bignumber.equal(MINDELAY); + + expect(await this.timelock.TIMELOCK_ADMIN_ROLE()).to.be.equal(TIMELOCK_ADMIN_ROLE); + expect(await this.timelock.PROPOSER_ROLE()).to.be.equal(PROPOSER_ROLE); + expect(await this.timelock.EXECUTOR_ROLE()).to.be.equal(EXECUTOR_ROLE); + expect(await this.timelock.CANCELLER_ROLE()).to.be.equal(CANCELLER_ROLE); + + expect(await Promise.all([ PROPOSER_ROLE, CANCELLER_ROLE, EXECUTOR_ROLE ].map(role => + this.timelock.hasRole(role, proposer), + ))).to.be.deep.equal([ true, false, false ]); + + expect(await Promise.all([ PROPOSER_ROLE, CANCELLER_ROLE, EXECUTOR_ROLE ].map(role => + this.timelock.hasRole(role, canceller), + ))).to.be.deep.equal([ false, true, false ]); + + expect(await Promise.all([ PROPOSER_ROLE, CANCELLER_ROLE, EXECUTOR_ROLE ].map(role => + this.timelock.hasRole(role, executor), + ))).to.be.deep.equal([ false, false, true ]); }); describe('methods', function () { @@ -175,7 +199,7 @@ contract('TimelockController', function (accounts) { MINDELAY, { from: other }, ), - `AccessControl: account ${other.toLowerCase()} is missing role ${this.PROPOSER_ROLE}`, + `AccessControl: account ${other.toLowerCase()} is missing role ${PROPOSER_ROLE}`, ); }); @@ -298,7 +322,7 @@ contract('TimelockController', function (accounts) { this.operation.salt, { from: other }, ), - `AccessControl: account ${other.toLowerCase()} is missing role ${this.EXECUTOR_ROLE}`, + `AccessControl: account ${other.toLowerCase()} is missing role ${EXECUTOR_ROLE}`, ); }); }); @@ -412,7 +436,7 @@ contract('TimelockController', function (accounts) { MINDELAY, { from: other }, ), - `AccessControl: account ${other.toLowerCase()} is missing role ${this.PROPOSER_ROLE}`, + `AccessControl: account ${other.toLowerCase()} is missing role ${PROPOSER_ROLE}`, ); }); @@ -537,7 +561,7 @@ contract('TimelockController', function (accounts) { this.operation.salt, { from: other }, ), - `AccessControl: account ${other.toLowerCase()} is missing role ${this.EXECUTOR_ROLE}`, + `AccessControl: account ${other.toLowerCase()} is missing role ${EXECUTOR_ROLE}`, ); }); @@ -651,22 +675,22 @@ contract('TimelockController', function (accounts) { )); }); - it('proposer can cancel', async function () { - const receipt = await this.timelock.cancel(this.operation.id, { from: proposer }); + it('canceller can cancel', async function () { + const receipt = await this.timelock.cancel(this.operation.id, { from: canceller }); expectEvent(receipt, 'Cancelled', { id: this.operation.id }); }); it('cannot cancel invalid operation', async function () { await expectRevert( - this.timelock.cancel(constants.ZERO_BYTES32, { from: proposer }), + this.timelock.cancel(constants.ZERO_BYTES32, { from: canceller }), 'TimelockController: operation cannot be cancelled', ); }); - it('prevent non-proposer from canceling', async function () { + it('prevent non-canceller from canceling', async function () { await expectRevert( this.timelock.cancel(this.operation.id, { from: other }), - `AccessControl: account ${other.toLowerCase()} is missing role ${this.PROPOSER_ROLE}`, + `AccessControl: account ${other.toLowerCase()} is missing role ${CANCELLER_ROLE}`, ); }); }); diff --git a/test/governance/extensions/GovernorTimelockControl.test.js b/test/governance/extensions/GovernorTimelockControl.test.js index ade1c545a..85dd0ea75 100644 --- a/test/governance/extensions/GovernorTimelockControl.test.js +++ b/test/governance/extensions/GovernorTimelockControl.test.js @@ -18,6 +18,11 @@ const CallReceiver = artifacts.require('CallReceiverMock'); contract('GovernorTimelockControl', function (accounts) { const [ admin, voter, other ] = accounts; + const TIMELOCK_ADMIN_ROLE = web3.utils.soliditySha3('TIMELOCK_ADMIN_ROLE'); + const PROPOSER_ROLE = web3.utils.soliditySha3('PROPOSER_ROLE'); + const EXECUTOR_ROLE = web3.utils.soliditySha3('EXECUTOR_ROLE'); + const CANCELLER_ROLE = web3.utils.soliditySha3('CANCELLER_ROLE'); + const name = 'OZ-Governor'; // const version = '1'; const tokenName = 'MockToken'; @@ -31,11 +36,20 @@ contract('GovernorTimelockControl', function (accounts) { this.timelock = await Timelock.new(3600, [], []); this.mock = await Governor.new(name, this.token.address, 4, 16, this.timelock.address, 0); this.receiver = await CallReceiver.new(); - // normal setup: governor and admin are proposers, everyone is executor, timelock is its own admin - await this.timelock.grantRole(await this.timelock.PROPOSER_ROLE(), this.mock.address); - await this.timelock.grantRole(await this.timelock.PROPOSER_ROLE(), admin); - await this.timelock.grantRole(await this.timelock.EXECUTOR_ROLE(), constants.ZERO_ADDRESS); - await this.timelock.revokeRole(await this.timelock.TIMELOCK_ADMIN_ROLE(), deployer); + + this.TIMELOCK_ADMIN_ROLE = await this.timelock.TIMELOCK_ADMIN_ROLE(); + this.PROPOSER_ROLE = await this.timelock.PROPOSER_ROLE(); + this.EXECUTOR_ROLE = await this.timelock.EXECUTOR_ROLE(); + this.CANCELLER_ROLE = await this.timelock.CANCELLER_ROLE(); + + // normal setup: governor is proposer, everyone is executor, timelock is its own admin + await this.timelock.grantRole(PROPOSER_ROLE, this.mock.address); + await this.timelock.grantRole(PROPOSER_ROLE, admin); + await this.timelock.grantRole(CANCELLER_ROLE, this.mock.address); + await this.timelock.grantRole(CANCELLER_ROLE, admin); + await this.timelock.grantRole(EXECUTOR_ROLE, constants.ZERO_ADDRESS); + await this.timelock.revokeRole(TIMELOCK_ADMIN_ROLE, deployer); + await this.token.mint(voter, tokenSupply); await this.token.delegate(voter, { from: voter }); }); From f2a311dc4a5757ee8064769a603a715b05d359b3 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 8 Mar 2022 22:39:53 +0100 Subject: [PATCH 08/81] Make Votes._getVotingUnits view (#3225) Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + contracts/governance/utils/Votes.sol | 2 +- contracts/mocks/VotesMock.sol | 2 +- contracts/token/ERC721/extensions/draft-ERC721Votes.sol | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69c036e41..38c8f164d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * `Governor`: Adds internal virtual `_getVotes` method that must be implemented; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing voting module extension, rename `getVotes` to `_getVotes` and add a `bytes memory` argument. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) * `Governor`: Adds `params` parameter to internal virtual `_countVote ` method; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing counting module extension, add a `bytes memory` argument to `_countVote`. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) * `Governor`: Does not emit `VoteCast` event when params data is non-empty; instead emits `VoteCastWithParams` event. To fix this on an integration that consumes the `VoteCast` event, also fetch/monitor `VoteCastWithParams` events. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) +* `Votes`: The internal virtual function `_getVotingUnits` was made `view` (which was accidentally missing). Any overrides should now be updated so they are `view` as well. ## 4.5.0 (2022-02-09) diff --git a/contracts/governance/utils/Votes.sol b/contracts/governance/utils/Votes.sol index cc5101b9f..202c3f2cf 100644 --- a/contracts/governance/utils/Votes.sol +++ b/contracts/governance/utils/Votes.sol @@ -207,5 +207,5 @@ abstract contract Votes is IVotes, Context, EIP712 { /** * @dev Must return the voting units held by an account. */ - function _getVotingUnits(address) internal virtual returns (uint256); + function _getVotingUnits(address) internal view virtual returns (uint256); } diff --git a/contracts/mocks/VotesMock.sol b/contracts/mocks/VotesMock.sol index db06ee9a5..b5e051340 100644 --- a/contracts/mocks/VotesMock.sol +++ b/contracts/mocks/VotesMock.sol @@ -18,7 +18,7 @@ contract VotesMock is Votes { return _delegate(account, newDelegation); } - function _getVotingUnits(address account) internal virtual override returns (uint256) { + function _getVotingUnits(address account) internal view virtual override returns (uint256) { return _balances[account]; } diff --git a/contracts/token/ERC721/extensions/draft-ERC721Votes.sol b/contracts/token/ERC721/extensions/draft-ERC721Votes.sol index 7d23c4921..4d9d0adba 100644 --- a/contracts/token/ERC721/extensions/draft-ERC721Votes.sol +++ b/contracts/token/ERC721/extensions/draft-ERC721Votes.sol @@ -34,7 +34,7 @@ abstract contract ERC721Votes is ERC721, Votes { /** * @dev Returns the balance of `account`. */ - function _getVotingUnits(address account) internal virtual override returns (uint256) { + function _getVotingUnits(address account) internal view virtual override returns (uint256) { return balanceOf(account); } } From c72281ea4506e92434ed9ac9c87a9cb13a55c6ce Mon Sep 17 00:00:00 2001 From: Vuong Tru <62639544+trubavuong@users.noreply.github.com> Date: Wed, 9 Mar 2022 15:32:46 +0700 Subject: [PATCH 09/81] docs(erc1155): correct ERC1155Holder.sol import (#3250) --- docs/modules/ROOT/pages/erc1155.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/erc1155.adoc b/docs/modules/ROOT/pages/erc1155.adoc index ee2e3d2e9..8271aaa0e 100644 --- a/docs/modules/ROOT/pages/erc1155.adoc +++ b/docs/modules/ROOT/pages/erc1155.adoc @@ -136,7 +136,7 @@ In order for our contract to receive ERC1155 tokens we can inherit from the conv // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import "@openzeppelin/contracts/token/ERC1155/ERC1155Holder.sol"; +import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; contract MyContract is ERC1155Holder { } From cc1c18098c0d6b52e751f96dd13b97306468f171 Mon Sep 17 00:00:00 2001 From: Pascal Marco Caversaccio Date: Wed, 9 Mar 2022 17:38:29 +0100 Subject: [PATCH 10/81] Replace immutable with constant for _PERMIT_TYPEHASH (#3196) * replace `immutable` with `constant` for _PERMIT_TYPEHASH This commit is related to the following issue discussion: https://github.com/OpenZeppelin/contracts-wizard/issues/89#issuecomment-1042391318 Since Solidity version `0.6.12` the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. Since the OpenZeppelin Wizard also uses `constant` for OpenZeppelin's AccessControl's roles declarations, it's good practice to make this consistent. * Update CHANGELOG * fix: ensure transpiler compatibility * fix: fixing var-name-mixedcase * prettier & lint check Signed-off-by: Pascal Marco Caversaccio Co-authored-by: Hadrien Croubois --- CHANGELOG.md | 1 + contracts/token/ERC20/extensions/draft-ERC20Permit.sol | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38c8f164d..a64abe503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) + * `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196)) ### Breaking changes diff --git a/contracts/token/ERC20/extensions/draft-ERC20Permit.sol b/contracts/token/ERC20/extensions/draft-ERC20Permit.sol index cf72fc086..55172f6e3 100644 --- a/contracts/token/ERC20/extensions/draft-ERC20Permit.sol +++ b/contracts/token/ERC20/extensions/draft-ERC20Permit.sol @@ -25,8 +25,16 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase - bytes32 private immutable _PERMIT_TYPEHASH = + bytes32 private constant _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); + /** + * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`. + * However, to ensure consistency with the upgradeable transpiler, we will continue + * to reserve a slot. + * @custom:oz-renamed-from _PERMIT_TYPEHASH + */ + // solhint-disable-next-line var-name-mixedcase + bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT; /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. From 8372b4f92351287f4090b853c4ed1b30300fef2e Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 10 Mar 2022 18:40:50 -0300 Subject: [PATCH 11/81] Update Hardhat to latest (#3260) --- package-lock.json | 1015 ++++++++++++++++++++++++++++++++++++++++----- package.json | 4 +- 2 files changed, 921 insertions(+), 98 deletions(-) diff --git a/package-lock.json b/package-lock.json index f7b1ecf88..caef323a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "openzeppelin-contracts-migrate-imports": "scripts/migrate-imports.js" }, "devDependencies": { - "@nomiclabs/hardhat-truffle5": "^2.0.0", + "@nomiclabs/hardhat-truffle5": "^2.0.5", "@nomiclabs/hardhat-web3": "^2.0.0", "@openzeppelin/docs-utils": "^0.1.0", "@openzeppelin/test-helpers": "^0.5.13", @@ -27,7 +27,7 @@ "ethereumjs-util": "^7.0.7", "ethereumjs-wallet": "^1.0.1", "graphlib": "^2.1.8", - "hardhat": "^2.0.6", + "hardhat": "^2.9.1", "hardhat-gas-reporter": "^1.0.4", "keccak256": "^1.0.2", "lodash.startcase": "^4.4.0", @@ -1208,9 +1208,9 @@ } }, "node_modules/@nomiclabs/hardhat-truffle5": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-truffle5/-/hardhat-truffle5-2.0.4.tgz", - "integrity": "sha512-8wATE06yUqh04WlvZeFDovBPZNcbxWdw8GPdhGgFKcTD5qy30DCYoUSLJKFtgbF9BPv2w6u8GSaZ/ViRnr4u5Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-truffle5/-/hardhat-truffle5-2.0.5.tgz", + "integrity": "sha512-taTWfieMP3Rvj+y90DgdNpviUJ4zxgjpW0V8D++uPkg5R7HXVWBTf43a1PYw+cBhcqN29P9gB1zSS1HC+uz1Mw==", "dev": true, "dependencies": { "@nomiclabs/truffle-contract": "^4.2.23", @@ -3920,6 +3920,12 @@ "@types/node": "*" } }, + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, "node_modules/abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -4024,6 +4030,28 @@ "node": ">= 6.0.0" } }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/aggregate-error/node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -8737,9 +8765,9 @@ } }, "node_modules/hardhat": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.8.4.tgz", - "integrity": "sha512-lEwvQSbhABpKgBTJnRgdZ6nZZRmgKUF2G8aGNaBVIQnJeRZjELnZHLIWXAF1HW0Q1NFCyo9trxOrOuzmiS+r/w==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.1.tgz", + "integrity": "sha512-q0AkYXV7R26RzyAkHGQRhhQjk508pseVvH3wSwZwwPUbvA+tjl0vMIrD4aFQDonRXkrnXX4+5KglozzjSd0//Q==", "dev": true, "dependencies": { "@ethereumjs/block": "^3.6.0", @@ -8750,11 +8778,12 @@ "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", "@sentry/node": "^5.18.1", - "@solidity-parser/parser": "^0.14.0", + "@solidity-parser/parser": "^0.14.1", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", "abort-controller": "^3.0.0", "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", "chalk": "^2.4.2", "chokidar": "^3.4.0", @@ -8769,14 +8798,13 @@ "fp-ts": "1.19.3", "fs-extra": "^7.0.1", "glob": "^7.1.3", - "https-proxy-agent": "^5.0.0", "immutable": "^4.0.0-rc.12", "io-ts": "1.10.4", "lodash": "^4.17.11", "merkle-patricia-tree": "^4.2.2", "mnemonist": "^0.38.0", - "mocha": "^7.2.0", - "node-fetch": "^2.6.0", + "mocha": "^9.2.0", + "p-map": "^4.0.0", "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", @@ -8787,6 +8815,7 @@ "stacktrace-parser": "^0.1.10", "true-case-path": "^2.2.1", "tsort": "0.0.1", + "undici": "^4.14.1", "uuid": "^8.3.2", "ws": "^7.4.6" }, @@ -8794,7 +8823,7 @@ "hardhat": "internal/cli/cli.js" }, "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + "node": "^12.0.0 || ^14.0.0 || ^16.0.0" } }, "node_modules/hardhat-gas-reporter": { @@ -8811,6 +8840,24 @@ "hardhat": "^2.0.2" } }, + "node_modules/hardhat/node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/hardhat/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/hardhat/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -8823,6 +8870,24 @@ "node": ">=4" } }, + "node_modules/hardhat/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/hardhat/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/hardhat/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -8858,6 +8923,33 @@ "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, + "node_modules/hardhat/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/hardhat/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "node_modules/hardhat/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -8879,6 +8971,15 @@ "node": ">=4" } }, + "node_modules/hardhat/node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, "node_modules/hardhat/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -8888,6 +8989,36 @@ "node": ">=4" } }, + "node_modules/hardhat/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/hardhat/node_modules/jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", @@ -8910,6 +9041,259 @@ "node": ">=4" } }, + "node_modules/hardhat/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/hardhat/node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/hardhat/node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/hardhat/node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/hardhat/node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat/node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat/node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/hardhat/node_modules/mocha": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz", + "integrity": "sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==", + "dev": true, + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.2.0", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/hardhat/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/hardhat/node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -9039,6 +9423,32 @@ "semver": "bin/semver" } }, + "node_modules/hardhat/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/hardhat/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -9051,6 +9461,48 @@ "node": ">=4" } }, + "node_modules/hardhat/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hardhat/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/hardhat/node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -10199,6 +10651,18 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-upper-case": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.1.2.tgz", @@ -12134,6 +12598,18 @@ "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=", "dev": true }, + "node_modules/nanoid": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", + "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -12308,26 +12784,6 @@ "semver": "bin/semver" } }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/node-gyp-build": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", @@ -12737,6 +13193,21 @@ "node": ">=8" } }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-timeout": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", @@ -14163,6 +14634,15 @@ "upper-case-first": "^1.1.2" } }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", @@ -16459,12 +16939,6 @@ "node": ">=6" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", - "dev": true - }, "node_modules/treeify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", @@ -16647,6 +17121,15 @@ "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==", "dev": true }, + "node_modules/undici": { + "version": "4.15.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-4.15.1.tgz", + "integrity": "sha512-h8LJybhMKD09IyQZoQadNtIR/GmugVhTOVREunJrpV6RStriKBFdSVoFzEzTihwXi/27DIBO+Z0OGF+Mzfi0lA==", + "dev": true, + "engines": { + "node": ">=12.18" + } + }, "node_modules/union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -17332,12 +17815,6 @@ "node": ">=8.0.0" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", - "dev": true - }, "node_modules/websocket": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", @@ -17393,16 +17870,6 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -17558,6 +18025,12 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "node_modules/workerpool": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "dev": true + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -18023,6 +18496,18 @@ "engines": { "node": ">=12" } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } }, "dependencies": { @@ -18834,9 +19319,9 @@ } }, "@nomiclabs/hardhat-truffle5": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-truffle5/-/hardhat-truffle5-2.0.4.tgz", - "integrity": "sha512-8wATE06yUqh04WlvZeFDovBPZNcbxWdw8GPdhGgFKcTD5qy30DCYoUSLJKFtgbF9BPv2w6u8GSaZ/ViRnr4u5Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-truffle5/-/hardhat-truffle5-2.0.5.tgz", + "integrity": "sha512-taTWfieMP3Rvj+y90DgdNpviUJ4zxgjpW0V8D++uPkg5R7HXVWBTf43a1PYw+cBhcqN29P9gB1zSS1HC+uz1Mw==", "dev": true, "requires": { "@nomiclabs/truffle-contract": "^4.2.23", @@ -21157,6 +21642,12 @@ "@types/node": "*" } }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -21235,6 +21726,24 @@ "debug": "4" } }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "dependencies": { + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + } + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -25096,9 +25605,9 @@ } }, "hardhat": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.8.4.tgz", - "integrity": "sha512-lEwvQSbhABpKgBTJnRgdZ6nZZRmgKUF2G8aGNaBVIQnJeRZjELnZHLIWXAF1HW0Q1NFCyo9trxOrOuzmiS+r/w==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.1.tgz", + "integrity": "sha512-q0AkYXV7R26RzyAkHGQRhhQjk508pseVvH3wSwZwwPUbvA+tjl0vMIrD4aFQDonRXkrnXX4+5KglozzjSd0//Q==", "dev": true, "requires": { "@ethereumjs/block": "^3.6.0", @@ -25109,11 +25618,12 @@ "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", "@sentry/node": "^5.18.1", - "@solidity-parser/parser": "^0.14.0", + "@solidity-parser/parser": "^0.14.1", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", "abort-controller": "^3.0.0", "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", "chalk": "^2.4.2", "chokidar": "^3.4.0", @@ -25128,14 +25638,13 @@ "fp-ts": "1.19.3", "fs-extra": "^7.0.1", "glob": "^7.1.3", - "https-proxy-agent": "^5.0.0", "immutable": "^4.0.0-rc.12", "io-ts": "1.10.4", "lodash": "^4.17.11", "merkle-patricia-tree": "^4.2.2", "mnemonist": "^0.38.0", - "mocha": "^7.2.0", - "node-fetch": "^2.6.0", + "mocha": "^9.2.0", + "p-map": "^4.0.0", "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", @@ -25146,10 +25655,23 @@ "stacktrace-parser": "^0.1.10", "true-case-path": "^2.2.1", "tsort": "0.0.1", + "undici": "^4.14.1", "uuid": "^8.3.2", "ws": "^7.4.6" }, "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -25159,6 +25681,18 @@ "color-convert": "^1.9.0" } }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -25191,6 +25725,24 @@ "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -25206,12 +25758,39 @@ "locate-path": "^2.0.0" } }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, "jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", @@ -25231,6 +25810,180 @@ "path-exists": "^3.0.0" } }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mocha": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz", + "integrity": "sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.2.0", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -25329,6 +26082,26 @@ } } }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -25337,6 +26110,39 @@ "requires": { "has-flag": "^3.0.0" } + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + } } } }, @@ -26198,6 +27004,12 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, "is-upper-case": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.1.2.tgz", @@ -27803,6 +28615,12 @@ "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=", "dev": true }, + "nanoid": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", + "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "dev": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -27954,15 +28772,6 @@ } } }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dev": true, - "requires": { - "whatwg-url": "^5.0.0" - } - }, "node-gyp-build": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", @@ -28269,6 +29078,15 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-timeout": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", @@ -29379,6 +30197,15 @@ "upper-case-first": "^1.1.2" } }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, "serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", @@ -31242,12 +32069,6 @@ } } }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", - "dev": true - }, "treeify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", @@ -31399,6 +32220,12 @@ "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==", "dev": true }, + "undici": { + "version": "4.15.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-4.15.1.tgz", + "integrity": "sha512-h8LJybhMKD09IyQZoQadNtIR/GmugVhTOVREunJrpV6RStriKBFdSVoFzEzTihwXi/27DIBO+Z0OGF+Mzfi0lA==", + "dev": true + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -31976,12 +32803,6 @@ "utf8": "3.0.0" } }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", - "dev": true - }, "websocket": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", @@ -32030,16 +32851,6 @@ "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", "dev": true }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dev": true, - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -32158,6 +32969,12 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "workerpool": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "dev": true + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -32533,6 +33350,12 @@ } } } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } } } diff --git a/package.json b/package.json index 13df7274d..2d9d0d515 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "homepage": "https://openzeppelin.com/contracts/", "devDependencies": { - "@nomiclabs/hardhat-truffle5": "^2.0.0", + "@nomiclabs/hardhat-truffle5": "^2.0.5", "@nomiclabs/hardhat-web3": "^2.0.0", "@openzeppelin/docs-utils": "^0.1.0", "@openzeppelin/test-helpers": "^0.5.13", @@ -66,7 +66,7 @@ "ethereumjs-util": "^7.0.7", "ethereumjs-wallet": "^1.0.1", "graphlib": "^2.1.8", - "hardhat": "^2.0.6", + "hardhat": "^2.9.1", "hardhat-gas-reporter": "^1.0.4", "keccak256": "^1.0.2", "lodash.startcase": "^4.4.0", From 6a5bbfc4cbd0208fd350ca69152c0b8d0a989e55 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Fri, 11 Mar 2022 09:30:30 +0100 Subject: [PATCH 12/81] Refactor governor testing (#3194) * starting a governor test refactor * improve governor tests * refactor compatibility tests using the governor helper * improve governor helper * improve governor helper * refactor governor tests * refactor testing * fix testing (still TODO) * fix tests * fix tests * fix spelling * use different instances of GovernorHelper * add vote with params support * coverage * simplify ERC165 helper * remove unused proposal argument * refactor setProposal * lint * refactor setProposal return values * add a data default value * improve proposal reconstruction and storage in helper * proposal object refactoring * lint Co-authored-by: Francisco Giordano --- test/governance/Governor.test.js | 1314 ++++++----------- test/governance/GovernorWorkflow.behavior.js | 186 --- .../GovernorCompatibilityBravo.test.js | 553 +++---- .../extensions/GovernorComp.test.js | 99 +- .../extensions/GovernorERC721.test.js | 162 +- .../GovernorPreventLateQuorum.test.js | 298 ++-- .../GovernorTimelockCompound.test.js | 692 ++++----- .../GovernorTimelockControl.test.js | 696 ++++----- .../GovernorWeightQuorumFraction.test.js | 150 +- .../extensions/GovernorWithParams.test.js | 288 ++-- test/helpers/governance.js | 211 +++ .../SupportsInterface.behavior.js | 37 +- 12 files changed, 1870 insertions(+), 2816 deletions(-) delete mode 100644 test/governance/GovernorWorkflow.behavior.js create mode 100644 test/helpers/governance.js diff --git a/test/governance/Governor.test.js b/test/governance/Governor.test.js index 7156abeab..8ef3b3b7a 100644 --- a/test/governance/Governor.test.js +++ b/test/governance/Governor.test.js @@ -1,13 +1,11 @@ -const { BN, constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers'); +const { BN, expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); +const { expect } = require('chai'); const ethSigUtil = require('eth-sig-util'); const Wallet = require('ethereumjs-wallet').default; +const { fromRpcSig } = require('ethereumjs-util'); const Enums = require('../helpers/enums'); const { EIP712Domain } = require('../helpers/eip712'); -const { fromRpcSig } = require('ethereumjs-util'); - -const { - runGovernorWorkflow, -} = require('./GovernorWorkflow.behavior'); +const { GovernorHelper } = require('../helpers/governance'); const { shouldSupportInterfaces, @@ -19,23 +17,40 @@ const CallReceiver = artifacts.require('CallReceiverMock'); contract('Governor', function (accounts) { const [ owner, proposer, voter1, voter2, voter3, voter4 ] = accounts; + const empty = web3.utils.toChecksumAddress(web3.utils.randomHex(20)); const name = 'OZ-Governor'; const version = '1'; const tokenName = 'MockToken'; const tokenSymbol = 'MTKN'; const tokenSupply = web3.utils.toWei('100'); + const votingDelay = new BN(4); + const votingPeriod = new BN(16); + const value = web3.utils.toWei('1'); beforeEach(async function () { - this.owner = owner; + this.chainId = await web3.eth.getChainId(); this.token = await Token.new(tokenName, tokenSymbol); - this.mock = await Governor.new(name, this.token.address, 4, 16, 10); + this.mock = await Governor.new(name, this.token.address, votingDelay, votingPeriod, 10); this.receiver = await CallReceiver.new(); + + this.helper = new GovernorHelper(this.mock); + + await web3.eth.sendTransaction({ from: owner, to: this.mock.address, value }); + await this.token.mint(owner, tokenSupply); - await this.token.delegate(voter1, { from: voter1 }); - await this.token.delegate(voter2, { from: voter2 }); - await this.token.delegate(voter3, { from: voter3 }); - await this.token.delegate(voter4, { from: voter4 }); + await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, value: web3.utils.toWei('2') }, { from: owner }); + + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + data: this.receiver.contract.methods.mockFunction().encodeABI(), + value, + }, + ], ''); }); shouldSupportInterfaces([ @@ -47,901 +62,516 @@ contract('Governor', function (accounts) { it('deployment check', async function () { expect(await this.mock.name()).to.be.equal(name); expect(await this.mock.token()).to.be.equal(this.token.address); - expect(await this.mock.votingDelay()).to.be.bignumber.equal('4'); - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16'); + expect(await this.mock.votingDelay()).to.be.bignumber.equal(votingDelay); + expect(await this.mock.votingPeriod()).to.be.bignumber.equal(votingPeriod); expect(await this.mock.quorum(0)).to.be.bignumber.equal('0'); expect(await this.mock.COUNTING_MODE()).to.be.equal('support=bravo&quorum=for,abstain'); }); - describe('scenario', function () { - describe('nominal', function () { - beforeEach(async function () { - this.value = web3.utils.toWei('1'); + it('nominal workflow', async function () { + // Before + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(false); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(value); + expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal('0'); - await web3.eth.sendTransaction({ from: owner, to: this.mock.address, value: this.value }); - expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(this.value); - expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal('0'); + // Run proposal + const txPropose = await this.helper.propose({ from: proposer }); - this.settings = { - proposal: [ - [ this.receiver.address ], - [ this.value ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - proposer, - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('1'), support: Enums.VoteType.For, reason: 'This is nice' }, - { voter: voter2, weight: web3.utils.toWei('7'), support: Enums.VoteType.For }, - { voter: voter3, weight: web3.utils.toWei('5'), support: Enums.VoteType.Against }, - { voter: voter4, weight: web3.utils.toWei('2'), support: Enums.VoteType.Abstain }, - ], - }; - this.votingDelay = await this.mock.votingDelay(); - this.votingPeriod = await this.mock.votingPeriod(); + expectEvent( + txPropose, + 'ProposalCreated', + { + proposalId: this.proposal.id, + proposer, + targets: this.proposal.targets, + // values: this.proposal.values, + signatures: this.proposal.signatures, + calldatas: this.proposal.data, + startBlock: new BN(txPropose.receipt.blockNumber).add(votingDelay), + endBlock: new BN(txPropose.receipt.blockNumber).add(votingDelay).add(votingPeriod), + description: this.proposal.description, + }, + ); + + await this.helper.waitForSnapshot(); + + expectEvent( + await this.helper.vote({ support: Enums.VoteType.For, reason: 'This is nice' }, { from: voter1 }), + 'VoteCast', + { + voter: voter1, + support: Enums.VoteType.For, + reason: 'This is nice', + weight: web3.utils.toWei('10'), + }, + ); + + expectEvent( + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }), + 'VoteCast', + { + voter: voter2, + support: Enums.VoteType.For, + weight: web3.utils.toWei('7'), + }, + ); + + expectEvent( + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter3 }), + 'VoteCast', + { + voter: voter3, + support: Enums.VoteType.Against, + weight: web3.utils.toWei('5'), + }, + ); + + expectEvent( + await this.helper.vote({ support: Enums.VoteType.Abstain }, { from: voter4 }), + 'VoteCast', + { + voter: voter4, + support: Enums.VoteType.Abstain, + weight: web3.utils.toWei('2'), + }, + ); + + await this.helper.waitForDeadline(); + + const txExecute = await this.helper.execute(); + + expectEvent( + txExecute, + 'ProposalExecuted', + { proposalId: this.proposal.id }, + ); + + await expectEvent.inTransaction( + txExecute.tx, + this.receiver, + 'MockFunctionCalled', + ); + + // After + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(true); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal('0'); + expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal(value); + }); + + it('vote with signature', async function () { + const voterBySig = Wallet.generate(); + const voterBySigAddress = web3.utils.toChecksumAddress(voterBySig.getAddressString()); + + const signature = async (message) => { + return fromRpcSig(ethSigUtil.signTypedMessage( + voterBySig.getPrivateKey(), + { + data: { + types: { + EIP712Domain, + Ballot: [ + { name: 'proposalId', type: 'uint256' }, + { name: 'support', type: 'uint8' }, + ], + }, + domain: { name, version, chainId: this.chainId, verifyingContract: this.mock.address }, + primaryType: 'Ballot', + message, + }, + }, + )); + }; + + await this.token.delegate(voterBySigAddress, { from: voter1 }); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + expectEvent( + await this.helper.vote({ support: Enums.VoteType.For, signature }), + 'VoteCast', + { voter: voterBySigAddress, support: Enums.VoteType.For }, + ); + await this.helper.waitForDeadline(); + await this.helper.execute(); + + // After + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voterBySigAddress)).to.be.equal(true); + }); + + it('send ethers', async function () { + this.proposal = this.helper.setProposal([ + { + target: empty, + value, + }, + ], ''); + + // Before + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(value); + expect(await web3.eth.getBalance(empty)).to.be.bignumber.equal('0'); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.execute(); + + // After + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal('0'); + expect(await web3.eth.getBalance(empty)).to.be.bignumber.equal(value); + }); + + describe('should revert', function () { + describe('on propose', function () { + it('if proposal already exists', async function () { + await this.helper.propose(); + await expectRevert(this.helper.propose(), 'Governor: proposal already exists'); + }); + }); + + describe('on vote', function () { + it('if proposal does not exist', async function () { + await expectRevert( + this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }), + 'Governor: unknown proposal id', + ); }); - afterEach(async function () { - expect(await this.mock.hasVoted(this.id, owner)).to.be.equal(false); - expect(await this.mock.hasVoted(this.id, voter1)).to.be.equal(true); - expect(await this.mock.hasVoted(this.id, voter2)).to.be.equal(true); + it('if voting has not started', async function () { + await this.helper.propose(); + await expectRevert( + this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }), + 'Governor: vote not currently active', + ); + }); - await this.mock.proposalVotes(this.id).then(result => { - for (const [key, value] of Object.entries(Enums.VoteType)) { - expect(result[`${key.toLowerCase()}Votes`]).to.be.bignumber.equal( - Object.values(this.settings.voters).filter(({ support }) => support === value).reduce( - (acc, { weight }) => acc.add(new BN(weight)), - new BN('0'), - ), - ); - } - }); + it('if support value is invalid', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await expectRevert( + this.helper.vote({ support: new BN('255') }), + 'GovernorVotingSimple: invalid value for enum VoteType', + ); + }); - expectEvent( - this.receipts.propose, - 'ProposalCreated', + it('if vote was already casted', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await expectRevert( + this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }), + 'GovernorVotingSimple: vote already cast', + ); + }); + + it('if voting is over', async function () { + await this.helper.propose(); + await this.helper.waitForDeadline(); + await expectRevert( + this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }), + 'Governor: vote not currently active', + ); + }); + }); + + describe('on execute', function () { + it('if proposal does not exist', async function () { + await expectRevert(this.helper.execute(), 'Governor: unknown proposal id'); + }); + + it('if quorum is not reached', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter3 }); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + + it('if score not reached', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter1 }); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + + it('if voting is not over', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + + it('if receiver revert without reason', async function () { + this.proposal = this.helper.setProposal([ { - proposalId: this.id, - proposer, - targets: this.settings.proposal[0], - // values: this.settings.proposal[1].map(value => new BN(value)), - signatures: this.settings.proposal[2].map(() => ''), - calldatas: this.settings.proposal[2], - startBlock: new BN(this.receipts.propose.blockNumber).add(this.votingDelay), - endBlock: new BN(this.receipts.propose.blockNumber).add(this.votingDelay).add(this.votingPeriod), - description: this.settings.proposal[3], + target: this.receiver.address, + data: this.receiver.contract.methods.mockFunctionRevertsNoReason().encodeABI(), }, - ); + ], ''); - this.receipts.castVote.filter(Boolean).forEach(vote => { - const { voter } = vote.logs.find(Boolean).args; - expectEvent( - vote, - 'VoteCast', - this.settings.voters.find(({ address }) => address === voter), - ); - }); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); - - expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal('0'); - expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal(this.value); + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await expectRevert(this.helper.execute(), 'Governor: call reverted without message'); }); - runGovernorWorkflow(); - }); - describe('vote with signature', function () { - beforeEach(async function () { - const chainId = await web3.eth.getChainId(); - // generate voter by signature wallet - const voterBySig = Wallet.generate(); - this.voter = web3.utils.toChecksumAddress(voterBySig.getAddressString()); - // use delegateBySig to enable vote delegation for this wallet - const { v, r, s } = fromRpcSig(ethSigUtil.signTypedMessage( - voterBySig.getPrivateKey(), + it('if receiver revert with reason', async function () { + this.proposal = this.helper.setProposal([ { - data: { - types: { - EIP712Domain, - Delegation: [ - { name: 'delegatee', type: 'address' }, - { name: 'nonce', type: 'uint256' }, - { name: 'expiry', type: 'uint256' }, - ], - }, - domain: { name: tokenName, version: '1', chainId, verifyingContract: this.token.address }, - primaryType: 'Delegation', - message: { delegatee: this.voter, nonce: 0, expiry: constants.MAX_UINT256 }, - }, + target: this.receiver.address, + data: this.receiver.contract.methods.mockFunctionRevertsReason().encodeABI(), }, - )); - await this.token.delegateBySig(this.voter, 0, constants.MAX_UINT256, v, r, s); - // prepare signature for vote by signature - const signature = async (message) => { - return fromRpcSig(ethSigUtil.signTypedMessage( - voterBySig.getPrivateKey(), - { - data: { - types: { - EIP712Domain, - Ballot: [ - { name: 'proposalId', type: 'uint256' }, - { name: 'support', type: 'uint8' }, - ], - }, - domain: { name, version, chainId, verifyingContract: this.mock.address }, - primaryType: 'Ballot', - message, - }, - }, - )); - }; + ], ''); - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: this.voter, signature, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - }; + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await expectRevert(this.helper.execute(), 'CallReceiverMock: reverting'); }); - afterEach(async function () { - expect(await this.mock.hasVoted(this.id, owner)).to.be.equal(false); - expect(await this.mock.hasVoted(this.id, voter1)).to.be.equal(false); - expect(await this.mock.hasVoted(this.id, voter2)).to.be.equal(false); - expect(await this.mock.hasVoted(this.id, this.voter)).to.be.equal(true); - await this.mock.proposalVotes(this.id).then(result => { - for (const [key, value] of Object.entries(Enums.VoteType)) { - expect(result[`${key.toLowerCase()}Votes`]).to.be.bignumber.equal( - Object.values(this.settings.voters).filter(({ support }) => support === value).reduce( - (acc, { weight }) => acc.add(new BN(weight)), - new BN('0'), - ), - ); - } - }); - - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); + it('if proposal was already executed', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.execute(); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); }); - runGovernorWorkflow(); - }); - - describe('send ethers', function () { - beforeEach(async function () { - this.receiver = { address: web3.utils.toChecksumAddress(web3.utils.randomHex(20)) }; - this.value = web3.utils.toWei('1'); - - await web3.eth.sendTransaction({ from: owner, to: this.mock.address, value: this.value }); - expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(this.value); - expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal('0'); - - this.settings = { - proposal: [ - [ this.receiver.address ], - [ this.value ], - [ '0x' ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('5'), support: Enums.VoteType.For }, - { voter: voter2, weight: web3.utils.toWei('5'), support: Enums.VoteType.Abstain }, - ], - }; - }); - afterEach(async function () { - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal('0'); - expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal(this.value); - }); - runGovernorWorkflow(); - }); - - describe('receiver revert without reason', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ 0 ], - [ this.receiver.contract.methods.mockFunctionRevertsNoReason().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - steps: { - execute: { error: 'Governor: call reverted without message' }, - }, - }; - }); - runGovernorWorkflow(); - }); - - describe('receiver revert with reason', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ 0 ], - [ this.receiver.contract.methods.mockFunctionRevertsReason().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - steps: { - execute: { error: 'CallReceiverMock: reverting' }, - }, - }; - }); - runGovernorWorkflow(); - }); - - describe('missing proposal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { - voter: voter1, - weight: web3.utils.toWei('5'), - support: Enums.VoteType.For, - error: 'Governor: unknown proposal id', - }, - { - voter: voter2, - weight: web3.utils.toWei('5'), - support: Enums.VoteType.Abstain, - error: 'Governor: unknown proposal id', - }, - ], - steps: { - propose: { enable: false }, - wait: { enable: false }, - execute: { error: 'Governor: unknown proposal id' }, - }, - }; - }); - runGovernorWorkflow(); - }); - - describe('duplicate pending proposal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - steps: { - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - await expectRevert(this.mock.propose(...this.settings.proposal), 'Governor: proposal already exists'); - }); - runGovernorWorkflow(); - }); - - describe('duplicate executed proposal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('5'), support: Enums.VoteType.For }, - { voter: voter2, weight: web3.utils.toWei('5'), support: Enums.VoteType.Abstain }, - ], - }; - }); - afterEach(async function () { - await expectRevert(this.mock.propose(...this.settings.proposal), 'Governor: proposal already exists'); - }); - runGovernorWorkflow(); - }); - - describe('Invalid vote type', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { - voter: voter1, - weight: web3.utils.toWei('10'), - support: new BN('255'), - error: 'GovernorVotingSimple: invalid value for enum VoteType', - }, - ], - steps: { - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); - runGovernorWorkflow(); - }); - - describe('double cast', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { - voter: voter1, - weight: web3.utils.toWei('5'), - support: Enums.VoteType.For, - }, - { - voter: voter1, - weight: web3.utils.toWei('5'), - support: Enums.VoteType.For, - error: 'GovernorVotingSimple: vote already cast', - }, - ], - }; - }); - runGovernorWorkflow(); - }); - - describe('quorum not reached', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('5'), support: Enums.VoteType.For }, - { voter: voter2, weight: web3.utils.toWei('4'), support: Enums.VoteType.Abstain }, - { voter: voter3, weight: web3.utils.toWei('10'), support: Enums.VoteType.Against }, - ], - steps: { - execute: { error: 'Governor: proposal not successful' }, - }, - }; - }); - runGovernorWorkflow(); - }); - - describe('score not reached', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.Against }, - ], - steps: { - execute: { error: 'Governor: proposal not successful' }, - }, - }; - }); - runGovernorWorkflow(); - }); - - describe('vote not over', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - steps: { - wait: { enable: false }, - execute: { error: 'Governor: proposal not successful' }, - }, - }; - }); - runGovernorWorkflow(); }); }); describe('state', function () { - describe('Unset', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - steps: { - propose: { enable: false }, - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - await expectRevert(this.mock.state(this.id), 'Governor: unknown proposal id'); - }); - runGovernorWorkflow(); + it('Unset', async function () { + await expectRevert(this.mock.state(this.proposal.id), 'Governor: unknown proposal id'); }); - describe('Pending & Active', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - steps: { - propose: { noadvance: true }, - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Pending); - - await time.advanceBlockTo(this.snapshot); - - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Pending); - - await time.advanceBlock(); - - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Active); - }); - runGovernorWorkflow(); + it('Pending & Active', async function () { + await this.helper.propose(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Pending); + await this.helper.waitForSnapshot(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Pending); + await this.helper.waitForSnapshot(+1); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Active); }); - describe('Defeated', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - steps: { - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Defeated); - }); - runGovernorWorkflow(); + it('Defeated', async function () { + await this.helper.propose(); + await this.helper.waitForDeadline(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Active); + await this.helper.waitForDeadline(+1); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Defeated); }); - describe('Succeeded', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - steps: { - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Succeeded); - }); - runGovernorWorkflow(); + it('Succeeded', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Active); + await this.helper.waitForDeadline(+1); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Succeeded); }); - describe('Executed', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Executed); - }); - runGovernorWorkflow(); + it('Executed', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.execute(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Executed); }); }); - describe('Cancel', function () { - describe('Before proposal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - steps: { - propose: { enable: false }, - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - await expectRevert( - this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: unknown proposal id', - ); - }); - runGovernorWorkflow(); + describe('cancel', function () { + it('before proposal', async function () { + await expectRevert(this.helper.cancel(), 'Governor: unknown proposal id'); }); - describe('After proposal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - steps: { - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - await this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); + it('after proposal', async function () { + await this.helper.propose(); - await expectRevert( - this.mock.castVote(this.id, new BN('100'), { from: voter1 }), - 'Governor: vote not currently active', - ); - }); - runGovernorWorkflow(); - }); + await this.helper.cancel(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); - describe('After vote', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - steps: { - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - await this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); - - await expectRevert( - this.mock.execute(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - }); - runGovernorWorkflow(); - }); - - describe('After deadline', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - steps: { - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - await this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); - - await expectRevert( - this.mock.execute(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - }); - runGovernorWorkflow(); - }); - - describe('After execution', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - }; - }); - afterEach(async function () { - await expectRevert( - this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not active', - ); - }); - runGovernorWorkflow(); - }); - }); - - describe('Proposal length', function () { - it('empty', async function () { + await this.helper.waitForSnapshot(); await expectRevert( - this.mock.propose( - [], - [], - [], - '', - ), - 'Governor: empty proposal', + this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }), + 'Governor: vote not currently active', ); }); + it('after vote', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + + await this.helper.cancel(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); + + await this.helper.waitForDeadline(); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + + it('after deadline', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + + await this.helper.cancel(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); + + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + + it('after execution', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.execute(); + + await expectRevert(this.helper.cancel(), 'Governor: proposal not active'); + }); + }); + + describe('proposal length', function () { + it('empty', async function () { + this.helper.setProposal([ ], ''); + await expectRevert(this.helper.propose(), 'Governor: empty proposal'); + }); + it('missmatch #1', async function () { - await expectRevert( - this.mock.propose( - [ ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ), - 'Governor: invalid proposal length', - ); + this.helper.setProposal({ + targets: [ ], + values: [ web3.utils.toWei('0') ], + data: [ this.receiver.contract.methods.mockFunction().encodeABI() ], + }, ''); + await expectRevert(this.helper.propose(), 'Governor: invalid proposal length'); }); it('missmatch #2', async function () { - await expectRevert( - this.mock.propose( - [ this.receiver.address ], - [ ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ), - 'Governor: invalid proposal length', - ); + this.helper.setProposal({ + targets: [ this.receiver.address ], + values: [ ], + data: [ this.receiver.contract.methods.mockFunction().encodeABI() ], + }, ''); + await expectRevert(this.helper.propose(), 'Governor: invalid proposal length'); }); it('missmatch #3', async function () { - await expectRevert( - this.mock.propose( - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ ], - '', - ), - 'Governor: invalid proposal length', - ); + this.helper.setProposal({ + targets: [ this.receiver.address ], + values: [ web3.utils.toWei('0') ], + data: [ ], + }, ''); + await expectRevert(this.helper.propose(), 'Governor: invalid proposal length'); }); }); - describe('Settings update', function () { - describe('setVotingDelay', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.setVotingDelay('0').encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - }; - }); - afterEach(async function () { - expect(await this.mock.votingDelay()).to.be.bignumber.equal('0'); - - expectEvent( - this.receipts.execute, - 'VotingDelaySet', - { oldVotingDelay: '4', newVotingDelay: '0' }, - ); - }); - runGovernorWorkflow(); + describe('onlyGovernance updates', function () { + it('setVotingDelay is protected', async function () { + await expectRevert(this.mock.setVotingDelay('0'), 'Governor: onlyGovernance'); }); - describe('setVotingPeriod', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.setVotingPeriod('32').encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - }; - }); - afterEach(async function () { - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('32'); - - expectEvent( - this.receipts.execute, - 'VotingPeriodSet', - { oldVotingPeriod: '16', newVotingPeriod: '32' }, - ); - }); - runGovernorWorkflow(); + it('setVotingPeriod is protected', async function () { + await expectRevert(this.mock.setVotingPeriod('32'), 'Governor: onlyGovernance'); }); - describe('setVotingPeriod to 0', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.setVotingPeriod('0').encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - steps: { - execute: { error: 'GovernorSettings: voting period too low' }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16'); - }); - runGovernorWorkflow(); + it('setProposalThreshold is protected', async function () { + await expectRevert(this.mock.setProposalThreshold('1000000000000000000'), 'Governor: onlyGovernance'); }); - describe('setProposalThreshold', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.setProposalThreshold('1000000000000000000').encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - ], - }; - }); - afterEach(async function () { - expect(await this.mock.proposalThreshold()).to.be.bignumber.equal('1000000000000000000'); + it('can setVotingDelay through governance', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.setVotingDelay('0').encodeABI(), + }, + ], ''); - expectEvent( - this.receipts.execute, - 'ProposalThresholdSet', - { oldProposalThreshold: '0', newProposalThreshold: '1000000000000000000' }, - ); - }); - runGovernorWorkflow(); + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + + expectEvent( + await this.helper.execute(), + 'VotingDelaySet', + { oldVotingDelay: '4', newVotingDelay: '0' }, + ); + + expect(await this.mock.votingDelay()).to.be.bignumber.equal('0'); }); - describe('update protected', function () { - it('setVotingDelay', async function () { - await expectRevert(this.mock.setVotingDelay('0'), 'Governor: onlyGovernance'); - }); + it('can setVotingPeriod through governance', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.setVotingPeriod('32').encodeABI(), + }, + ], ''); - it('setVotingPeriod', async function () { - await expectRevert(this.mock.setVotingPeriod('32'), 'Governor: onlyGovernance'); - }); + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); - it('setProposalThreshold', async function () { - await expectRevert(this.mock.setProposalThreshold('1000000000000000000'), 'Governor: onlyGovernance'); - }); + expectEvent( + await this.helper.execute(), + 'VotingPeriodSet', + { oldVotingPeriod: '16', newVotingPeriod: '32' }, + ); + + expect(await this.mock.votingPeriod()).to.be.bignumber.equal('32'); + }); + + it('cannot setVotingPeriod to 0 through governance', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.setVotingPeriod('0').encodeABI(), + }, + ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + + await expectRevert(this.helper.execute(), 'GovernorSettings: voting period too low'); + }); + + it('can setProposalThreshold to 0 through governance', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.setProposalThreshold('1000000000000000000').encodeABI(), + }, + ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + + expectEvent( + await this.helper.execute(), + 'ProposalThresholdSet', + { oldProposalThreshold: '0', newProposalThreshold: '1000000000000000000' }, + ); + + expect(await this.mock.proposalThreshold()).to.be.bignumber.equal('1000000000000000000'); }); }); }); diff --git a/test/governance/GovernorWorkflow.behavior.js b/test/governance/GovernorWorkflow.behavior.js deleted file mode 100644 index 8cfa9dcaf..000000000 --- a/test/governance/GovernorWorkflow.behavior.js +++ /dev/null @@ -1,186 +0,0 @@ -const { expectRevert, time } = require('@openzeppelin/test-helpers'); - -async function getReceiptOrRevert (promise, error = undefined) { - if (error) { - await expectRevert(promise, error); - return undefined; - } else { - const { receipt } = await promise; - return receipt; - } -} - -function tryGet (obj, path = '') { - try { - return path.split('.').reduce((o, k) => o[k], obj); - } catch (_) { - return undefined; - } -} - -function zip (...args) { - return Array(Math.max(...args.map(array => array.length))) - .fill() - .map((_, i) => args.map(array => array[i])); -} - -function concatHex (...args) { - return web3.utils.bytesToHex([].concat(...args.map(h => web3.utils.hexToBytes(h || '0x')))); -} - -function runGovernorWorkflow () { - beforeEach(async function () { - this.receipts = {}; - - // distinguish depending on the proposal length - // - length 4: propose(address[], uint256[], bytes[], string) → GovernorCore - // - length 5: propose(address[], uint256[], string[], bytes[], string) → GovernorCompatibilityBravo - this.useCompatibilityInterface = this.settings.proposal.length === 5; - - // compute description hash - this.descriptionHash = web3.utils.keccak256(this.settings.proposal.slice(-1).find(Boolean)); - - // condensed proposal, used for queue and execute operation - this.settings.shortProposal = [ - // targets - this.settings.proposal[0], - // values - this.settings.proposal[1], - // calldata (prefix selector if necessary) - this.useCompatibilityInterface - ? zip( - this.settings.proposal[2].map(selector => selector && web3.eth.abi.encodeFunctionSignature(selector)), - this.settings.proposal[3], - ).map(hexs => concatHex(...hexs)) - : this.settings.proposal[2], - // descriptionHash - this.descriptionHash, - ]; - - // proposal id - this.id = await this.mock.hashProposal(...this.settings.shortProposal); - }); - - it('run', async function () { - // transfer tokens - if (tryGet(this.settings, 'voters')) { - for (const voter of this.settings.voters) { - if (voter.weight) { - await this.token.transfer(voter.voter, voter.weight, { from: this.settings.tokenHolder }); - } else if (voter.nfts) { - for (const nft of voter.nfts) { - await this.token.transferFrom(this.settings.tokenHolder, voter.voter, nft, - { from: this.settings.tokenHolder }); - } - } - } - } - - // propose - if (this.mock.propose && tryGet(this.settings, 'steps.propose.enable') !== false) { - this.receipts.propose = await getReceiptOrRevert( - this.mock.methods[ - this.useCompatibilityInterface - ? 'propose(address[],uint256[],string[],bytes[],string)' - : 'propose(address[],uint256[],bytes[],string)' - ]( - ...this.settings.proposal, - { from: this.settings.proposer }, - ), - tryGet(this.settings, 'steps.propose.error'), - ); - - if (tryGet(this.settings, 'steps.propose.error') === undefined) { - this.deadline = await this.mock.proposalDeadline(this.id); - this.snapshot = await this.mock.proposalSnapshot(this.id); - } - - if (tryGet(this.settings, 'steps.propose.delay')) { - await time.increase(tryGet(this.settings, 'steps.propose.delay')); - } - - if ( - tryGet(this.settings, 'steps.propose.error') === undefined && - tryGet(this.settings, 'steps.propose.noadvance') !== true - ) { - await time.advanceBlockTo(this.snapshot.addn(1)); - } - } - - // vote - if (tryGet(this.settings, 'voters')) { - this.receipts.castVote = []; - for (const voter of this.settings.voters.filter(({ support }) => !!support)) { - if (!voter.signature) { - this.receipts.castVote.push( - await getReceiptOrRevert( - voter.reason - ? this.mock.castVoteWithReason(this.id, voter.support, voter.reason, { from: voter.voter }) - : this.mock.castVote(this.id, voter.support, { from: voter.voter }), - voter.error, - ), - ); - } else { - const { v, r, s } = await voter.signature({ proposalId: this.id, support: voter.support }); - this.receipts.castVote.push( - await getReceiptOrRevert( - this.mock.castVoteBySig(this.id, voter.support, v, r, s), - voter.error, - ), - ); - } - if (tryGet(voter, 'delay')) { - await time.increase(tryGet(voter, 'delay')); - } - } - } - - // fast forward - if (tryGet(this.settings, 'steps.wait.enable') !== false) { - await time.advanceBlockTo(this.deadline.addn(1)); - } - - // queue - if (this.mock.queue && tryGet(this.settings, 'steps.queue.enable') !== false) { - this.receipts.queue = await getReceiptOrRevert( - this.useCompatibilityInterface - ? this.mock.methods['queue(uint256)']( - this.id, - { from: this.settings.queuer }, - ) - : this.mock.methods['queue(address[],uint256[],bytes[],bytes32)']( - ...this.settings.shortProposal, - { from: this.settings.queuer }, - ), - tryGet(this.settings, 'steps.queue.error'), - ); - this.eta = await this.mock.proposalEta(this.id); - if (tryGet(this.settings, 'steps.queue.delay')) { - await time.increase(tryGet(this.settings, 'steps.queue.delay')); - } - } - - // execute - if (this.mock.execute && tryGet(this.settings, 'steps.execute.enable') !== false) { - this.receipts.execute = await getReceiptOrRevert( - this.useCompatibilityInterface - ? this.mock.methods['execute(uint256)']( - this.id, - { from: this.settings.executer }, - ) - : this.mock.methods['execute(address[],uint256[],bytes[],bytes32)']( - ...this.settings.shortProposal, - { from: this.settings.executer }, - ), - tryGet(this.settings, 'steps.execute.error'), - ); - if (tryGet(this.settings, 'steps.execute.delay')) { - await time.increase(tryGet(this.settings, 'steps.execute.delay')); - } - } - }); -} - -module.exports = { - runGovernorWorkflow, -}; diff --git a/test/governance/compatibility/GovernorCompatibilityBravo.test.js b/test/governance/compatibility/GovernorCompatibilityBravo.test.js index e877a5528..7ab8ed328 100644 --- a/test/governance/compatibility/GovernorCompatibilityBravo.test.js +++ b/test/governance/compatibility/GovernorCompatibilityBravo.test.js @@ -1,10 +1,8 @@ const { BN, expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); -const Enums = require('../../helpers/enums'); +const { expect } = require('chai'); const RLP = require('rlp'); - -const { - runGovernorWorkflow, -} = require('../GovernorWorkflow.behavior'); +const Enums = require('../../helpers/enums'); +const { GovernorHelper } = require('../../helpers/governance'); const Token = artifacts.require('ERC20VotesCompMock'); const Timelock = artifacts.require('CompTimelock'); @@ -23,7 +21,10 @@ contract('GovernorCompatibilityBravo', function (accounts) { const tokenName = 'MockToken'; const tokenSymbol = 'MTKN'; const tokenSupply = web3.utils.toWei('100'); + const votingDelay = new BN(4); + const votingPeriod = new BN(16); const proposalThreshold = web3.utils.toWei('10'); + const value = web3.utils.toWei('1'); beforeEach(async function () { const [ deployer ] = await web3.eth.getAccounts(); @@ -35,392 +36,220 @@ contract('GovernorCompatibilityBravo', function (accounts) { const predictGovernor = makeContractAddress(deployer, nonce + 1); this.timelock = await Timelock.new(predictGovernor, 2 * 86400); - this.mock = await Governor.new(name, this.token.address, 4, 16, proposalThreshold, this.timelock.address); + this.mock = await Governor.new( + name, + this.token.address, + votingDelay, + votingPeriod, + proposalThreshold, + this.timelock.address, + ); this.receiver = await CallReceiver.new(); - await this.token.mint(owner, tokenSupply); - await this.token.delegate(voter1, { from: voter1 }); - await this.token.delegate(voter2, { from: voter2 }); - await this.token.delegate(voter3, { from: voter3 }); - await this.token.delegate(voter4, { from: voter4 }); - await this.token.transfer(proposer, proposalThreshold, { from: owner }); - await this.token.delegate(proposer, { from: proposer }); + this.helper = new GovernorHelper(this.mock); + + await web3.eth.sendTransaction({ from: owner, to: this.timelock.address, value }); + + await this.token.mint(owner, tokenSupply); + await this.helper.delegate({ token: this.token, to: proposer, value: proposalThreshold }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, value: web3.utils.toWei('2') }, { from: owner }); + + // default proposal + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + value, + signature: 'mockFunction()', + }, + ], ''); }); it('deployment check', async function () { expect(await this.mock.name()).to.be.equal(name); expect(await this.mock.token()).to.be.equal(this.token.address); - expect(await this.mock.votingDelay()).to.be.bignumber.equal('4'); - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16'); + expect(await this.mock.votingDelay()).to.be.bignumber.equal(votingDelay); + expect(await this.mock.votingPeriod()).to.be.bignumber.equal(votingPeriod); expect(await this.mock.quorum(0)).to.be.bignumber.equal('0'); expect(await this.mock.quorumVotes()).to.be.bignumber.equal('0'); expect(await this.mock.COUNTING_MODE()).to.be.equal('support=bravo&quorum=bravo'); }); - describe('nominal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], // targets - [ web3.utils.toWei('0') ], // values - [ this.receiver.contract.methods.mockFunction().encodeABI() ], // calldatas - '', // description - ], + it('nominal workflow', async function () { + // Before + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(false); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal('0'); + expect(await web3.eth.getBalance(this.timelock.address)).to.be.bignumber.equal(value); + expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal('0'); + + // Run proposal + const txPropose = await this.helper.propose({ from: proposer }); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For, reason: 'This is nice' }, { from: voter1 }); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }); + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter3 }); + await this.helper.vote({ support: Enums.VoteType.Abstain }, { from: voter4 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); + + // After + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(true); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal('0'); + expect(await web3.eth.getBalance(this.timelock.address)).to.be.bignumber.equal('0'); + expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal(value); + + const proposal = await this.mock.proposals(this.proposal.id); + expect(proposal.id).to.be.bignumber.equal(this.proposal.id); + expect(proposal.proposer).to.be.equal(proposer); + expect(proposal.eta).to.be.bignumber.equal(await this.mock.proposalEta(this.proposal.id)); + expect(proposal.startBlock).to.be.bignumber.equal(await this.mock.proposalSnapshot(this.proposal.id)); + expect(proposal.endBlock).to.be.bignumber.equal(await this.mock.proposalDeadline(this.proposal.id)); + expect(proposal.canceled).to.be.equal(false); + expect(proposal.executed).to.be.equal(true); + + const action = await this.mock.getActions(this.proposal.id); + expect(action.targets).to.be.deep.equal(this.proposal.targets); + // expect(action.values).to.be.deep.equal(this.proposal.values); + expect(action.signatures).to.be.deep.equal(this.proposal.signatures); + expect(action.calldatas).to.be.deep.equal(this.proposal.data); + + const voteReceipt1 = await this.mock.getReceipt(this.proposal.id, voter1); + expect(voteReceipt1.hasVoted).to.be.equal(true); + expect(voteReceipt1.support).to.be.bignumber.equal(Enums.VoteType.For); + expect(voteReceipt1.votes).to.be.bignumber.equal(web3.utils.toWei('10')); + + const voteReceipt2 = await this.mock.getReceipt(this.proposal.id, voter2); + expect(voteReceipt2.hasVoted).to.be.equal(true); + expect(voteReceipt2.support).to.be.bignumber.equal(Enums.VoteType.For); + expect(voteReceipt2.votes).to.be.bignumber.equal(web3.utils.toWei('7')); + + const voteReceipt3 = await this.mock.getReceipt(this.proposal.id, voter3); + expect(voteReceipt3.hasVoted).to.be.equal(true); + expect(voteReceipt3.support).to.be.bignumber.equal(Enums.VoteType.Against); + expect(voteReceipt3.votes).to.be.bignumber.equal(web3.utils.toWei('5')); + + const voteReceipt4 = await this.mock.getReceipt(this.proposal.id, voter4); + expect(voteReceipt4.hasVoted).to.be.equal(true); + expect(voteReceipt4.support).to.be.bignumber.equal(Enums.VoteType.Abstain); + expect(voteReceipt4.votes).to.be.bignumber.equal(web3.utils.toWei('2')); + + expectEvent( + txPropose, + 'ProposalCreated', + { + proposalId: this.proposal.id, proposer, - tokenHolder: owner, - voters: [ - { - voter: voter1, - weight: web3.utils.toWei('1'), - support: Enums.VoteType.Abstain, - }, - { - voter: voter2, - weight: web3.utils.toWei('10'), - support: Enums.VoteType.For, - }, - { - voter: voter3, - weight: web3.utils.toWei('5'), - support: Enums.VoteType.Against, - }, - { - voter: voter4, - support: '100', - error: 'GovernorCompatibilityBravo: invalid vote type', - }, - { - voter: voter1, - support: Enums.VoteType.For, - error: 'GovernorCompatibilityBravo: vote already cast', - skip: true, - }, - ], - steps: { - queue: { delay: 7 * 86400 }, - }, - }; - this.votingDelay = await this.mock.votingDelay(); - this.votingPeriod = await this.mock.votingPeriod(); - this.receipts = {}; - }); - afterEach(async function () { - const proposal = await this.mock.proposals(this.id); - expect(proposal.id).to.be.bignumber.equal(this.id); - expect(proposal.proposer).to.be.equal(proposer); - expect(proposal.eta).to.be.bignumber.equal(this.eta); - expect(proposal.startBlock).to.be.bignumber.equal(this.snapshot); - expect(proposal.endBlock).to.be.bignumber.equal(this.deadline); - expect(proposal.canceled).to.be.equal(false); - expect(proposal.executed).to.be.equal(true); + targets: this.proposal.targets, + // values: this.proposal.values, + signatures: this.proposal.signatures.map(() => ''), // this event doesn't contain the proposal detail + calldatas: this.proposal.fulldata, + startBlock: new BN(txPropose.receipt.blockNumber).add(votingDelay), + endBlock: new BN(txPropose.receipt.blockNumber).add(votingDelay).add(votingPeriod), + description: this.proposal.description, + }, + ); + expectEvent( + txExecute, + 'ProposalExecuted', + { proposalId: this.proposal.id }, + ); + await expectEvent.inTransaction( + txExecute.tx, + this.receiver, + 'MockFunctionCalled', + ); + }); - for (const [key, value] of Object.entries(Enums.VoteType)) { - expect(proposal[`${key.toLowerCase()}Votes`]).to.be.bignumber.equal( - Object.values(this.settings.voters).filter(({ support }) => support === value).reduce( - (acc, { weight }) => acc.add(new BN(weight)), - new BN('0'), - ), - ); - } + it('with function selector and arguments', async function () { + const target = this.receiver.address; + this.helper.setProposal([ + { target, data: this.receiver.contract.methods.mockFunction().encodeABI() }, + { target, data: this.receiver.contract.methods.mockFunctionWithArgs(17, 42).encodeABI() }, + { target, signature: 'mockFunctionNonPayable()' }, + { + target, + signature: 'mockFunctionWithArgs(uint256,uint256)', + data: web3.eth.abi.encodeParameters(['uint256', 'uint256'], [18, 43]), + }, + ], ''); - const action = await this.mock.getActions(this.id); - expect(action.targets).to.be.deep.equal(this.settings.proposal[0]); - // expect(action.values).to.be.deep.equal(this.settings.proposal[1]); - expect(action.signatures).to.be.deep.equal(Array(this.settings.proposal[2].length).fill('')); - expect(action.calldatas).to.be.deep.equal(this.settings.proposal[2]); + await this.helper.propose({ from: proposer }); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For, reason: 'This is nice' }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); - for (const voter of this.settings.voters.filter(({ skip }) => !skip)) { - expect(await this.mock.hasVoted(this.id, voter.voter)).to.be.equal(voter.error === undefined); + await expectEvent.inTransaction( + txExecute.tx, + this.receiver, + 'MockFunctionCalled', + ); + await expectEvent.inTransaction( + txExecute.tx, + this.receiver, + 'MockFunctionCalled', + ); + await expectEvent.inTransaction( + txExecute.tx, + this.receiver, + 'MockFunctionCalledWithArgs', + { a: '17', b: '42' }, + ); + await expectEvent.inTransaction( + txExecute.tx, + this.receiver, + 'MockFunctionCalledWithArgs', + { a: '18', b: '43' }, + ); + }); - const receipt = await this.mock.getReceipt(this.id, voter.voter); - expect(receipt.hasVoted).to.be.equal(voter.error === undefined); - expect(receipt.support).to.be.bignumber.equal(voter.error === undefined ? voter.support : '0'); - expect(receipt.votes).to.be.bignumber.equal(voter.error === undefined ? voter.weight : '0'); - } - - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { - proposalId: this.id, - proposer, - targets: this.settings.proposal[0], - // values: this.settings.proposal[1].map(value => new BN(value)), - signatures: this.settings.proposal[2].map(() => ''), - calldatas: this.settings.proposal[2], - startBlock: new BN(this.receipts.propose.blockNumber).add(this.votingDelay), - endBlock: new BN(this.receipts.propose.blockNumber).add(this.votingDelay).add(this.votingPeriod), - description: this.settings.proposal[3], - }, - ); - - this.receipts.castVote.filter(Boolean).forEach(vote => { - const { voter } = vote.logs.find(Boolean).args; - expectEvent( - vote, - 'VoteCast', - this.settings.voters.find(({ address }) => address === voter), + describe('should revert', function () { + describe('on propose', function () { + it('if proposal doesnt meet proposalThreshold', async function () { + await expectRevert( + this.helper.propose({ from: other }), + 'GovernorCompatibilityBravo: proposer votes below proposal threshold', ); }); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); }); - runGovernorWorkflow(); - }); - describe('with function selector and arguments', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - Array(4).fill(this.receiver.address), - Array(4).fill(web3.utils.toWei('0')), - [ - '', - '', - 'mockFunctionNonPayable()', - 'mockFunctionWithArgs(uint256,uint256)', - ], - [ - this.receiver.contract.methods.mockFunction().encodeABI(), - this.receiver.contract.methods.mockFunctionWithArgs(17, 42).encodeABI(), - '0x', - web3.eth.abi.encodeParameters(['uint256', 'uint256'], [18, 43]), - ], - '', // description - ], - proposer, - tokenHolder: owner, - voters: [ - { - voter: voter1, - weight: web3.utils.toWei('10'), - support: Enums.VoteType.For, - }, - ], - steps: { - queue: { delay: 7 * 86400 }, - }, - }; + describe('on vote', function () { + it('if vote type is invalide', async function () { + await this.helper.propose({ from: proposer }); + await this.helper.waitForSnapshot(); + await expectRevert( + this.helper.vote({ support: 5 }, { from: voter1 }), + 'GovernorCompatibilityBravo: invalid vote type', + ); + }); }); - runGovernorWorkflow(); - afterEach(async function () { - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalledWithArgs', - { a: '17', b: '42' }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalledWithArgs', - { a: '18', b: '43' }, - ); - }); - }); - - describe('proposalThreshold not reached', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], // targets - [ web3.utils.toWei('0') ], // values - [ this.receiver.contract.methods.mockFunction().encodeABI() ], // calldatas - '', // description - ], - proposer: other, - steps: { - propose: { error: 'GovernorCompatibilityBravo: proposer votes below proposal threshold' }, - wait: { enable: false }, - queue: { enable: false }, - execute: { enable: false }, - }, - }; - }); - runGovernorWorkflow(); }); describe('cancel', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], // targets - [ web3.utils.toWei('0') ], // values - [ this.receiver.contract.methods.mockFunction().encodeABI() ], // calldatas - '', // description - ], - proposer, - tokenHolder: owner, - steps: { - wait: { enable: false }, - queue: { enable: false }, - execute: { enable: false }, - }, - }; + it('proposer can cancel', async function () { + await this.helper.propose({ from: proposer }); + await this.helper.cancel({ from: proposer }); }); - describe('by proposer', function () { - afterEach(async function () { - await this.mock.cancel(this.id, { from: proposer }); - }); - runGovernorWorkflow(); + it('anyone can cancel if proposer drop below threshold', async function () { + await this.helper.propose({ from: proposer }); + await this.token.transfer(voter1, web3.utils.toWei('1'), { from: proposer }); + await this.helper.cancel(); }); - describe('if proposer below threshold', function () { - afterEach(async function () { - await this.token.transfer(voter1, web3.utils.toWei('1'), { from: proposer }); - await this.mock.cancel(this.id); - }); - runGovernorWorkflow(); + it('cannot cancel is proposer is still above threshold', async function () { + await this.helper.propose({ from: proposer }); + await expectRevert(this.helper.cancel(), 'GovernorBravo: proposer above threshold'); }); - - describe('not if proposer above threshold', function () { - afterEach(async function () { - await expectRevert( - this.mock.cancel(this.id), - 'GovernorBravo: proposer above threshold', - ); - }); - runGovernorWorkflow(); - }); - }); - - describe('with compatibility interface', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], // targets - [ web3.utils.toWei('0') ], // values - [ 'mockFunction()' ], // signatures - [ '0x' ], // calldatas - '', // description - ], - proposer, - tokenHolder: owner, - voters: [ - { - voter: voter1, - weight: web3.utils.toWei('1'), - support: Enums.VoteType.Abstain, - }, - { - voter: voter2, - weight: web3.utils.toWei('10'), - support: Enums.VoteType.For, - }, - { - voter: voter3, - weight: web3.utils.toWei('5'), - support: Enums.VoteType.Against, - }, - { - voter: voter4, - support: '100', - error: 'GovernorCompatibilityBravo: invalid vote type', - }, - { - voter: voter1, - support: Enums.VoteType.For, - error: 'GovernorCompatibilityBravo: vote already cast', - skip: true, - }, - ], - steps: { - queue: { delay: 7 * 86400 }, - }, - }; - this.votingDelay = await this.mock.votingDelay(); - this.votingPeriod = await this.mock.votingPeriod(); - this.receipts = {}; - }); - - afterEach(async function () { - const proposal = await this.mock.proposals(this.id); - expect(proposal.id).to.be.bignumber.equal(this.id); - expect(proposal.proposer).to.be.equal(proposer); - expect(proposal.eta).to.be.bignumber.equal(this.eta); - expect(proposal.startBlock).to.be.bignumber.equal(this.snapshot); - expect(proposal.endBlock).to.be.bignumber.equal(this.deadline); - expect(proposal.canceled).to.be.equal(false); - expect(proposal.executed).to.be.equal(true); - - for (const [key, value] of Object.entries(Enums.VoteType)) { - expect(proposal[`${key.toLowerCase()}Votes`]).to.be.bignumber.equal( - Object.values(this.settings.voters).filter(({ support }) => support === value).reduce( - (acc, { weight }) => acc.add(new BN(weight)), - new BN('0'), - ), - ); - } - - const action = await this.mock.getActions(this.id); - expect(action.targets).to.be.deep.equal(this.settings.proposal[0]); - // expect(action.values).to.be.deep.equal(this.settings.proposal[1]); - expect(action.signatures).to.be.deep.equal(this.settings.proposal[2]); - expect(action.calldatas).to.be.deep.equal(this.settings.proposal[3]); - - for (const voter of this.settings.voters.filter(({ skip }) => !skip)) { - expect(await this.mock.hasVoted(this.id, voter.voter)).to.be.equal(voter.error === undefined); - - const receipt = await this.mock.getReceipt(this.id, voter.voter); - expect(receipt.hasVoted).to.be.equal(voter.error === undefined); - expect(receipt.support).to.be.bignumber.equal(voter.error === undefined ? voter.support : '0'); - expect(receipt.votes).to.be.bignumber.equal(voter.error === undefined ? voter.weight : '0'); - } - - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { - proposalId: this.id, - proposer, - targets: this.settings.proposal[0], - // values: this.settings.proposal[1].map(value => new BN(value)), - signatures: this.settings.proposal[2].map(_ => ''), - calldatas: this.settings.shortProposal[2], - startBlock: new BN(this.receipts.propose.blockNumber).add(this.votingDelay), - endBlock: new BN(this.receipts.propose.blockNumber).add(this.votingDelay).add(this.votingPeriod), - description: this.settings.proposal[4], - }, - ); - - this.receipts.castVote.filter(Boolean).forEach(vote => { - const { voter } = vote.logs.find(Boolean).args; - expectEvent( - vote, - 'VoteCast', - this.settings.voters.find(({ address }) => address === voter), - ); - }); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); - }); - runGovernorWorkflow(); }); }); diff --git a/test/governance/extensions/GovernorComp.test.js b/test/governance/extensions/GovernorComp.test.js index 78cf1e931..06d2d6251 100644 --- a/test/governance/extensions/GovernorComp.test.js +++ b/test/governance/extensions/GovernorComp.test.js @@ -1,9 +1,7 @@ -const { BN, expectEvent } = require('@openzeppelin/test-helpers'); +const { BN } = require('@openzeppelin/test-helpers'); +const { expect } = require('chai'); const Enums = require('../../helpers/enums'); - -const { - runGovernorWorkflow, -} = require('./../GovernorWorkflow.behavior'); +const { GovernorHelper } = require('../../helpers/governance'); const Token = artifacts.require('ERC20VotesCompMock'); const Governor = artifacts.require('GovernorCompMock'); @@ -17,71 +15,64 @@ contract('GovernorComp', function (accounts) { const tokenName = 'MockToken'; const tokenSymbol = 'MTKN'; const tokenSupply = web3.utils.toWei('100'); + const votingDelay = new BN(4); + const votingPeriod = new BN(16); + const value = web3.utils.toWei('1'); beforeEach(async function () { this.owner = owner; this.token = await Token.new(tokenName, tokenSymbol); this.mock = await Governor.new(name, this.token.address); this.receiver = await CallReceiver.new(); + + this.helper = new GovernorHelper(this.mock); + + await web3.eth.sendTransaction({ from: owner, to: this.mock.address, value }); + await this.token.mint(owner, tokenSupply); - await this.token.delegate(voter1, { from: voter1 }); - await this.token.delegate(voter2, { from: voter2 }); - await this.token.delegate(voter3, { from: voter3 }); - await this.token.delegate(voter4, { from: voter4 }); + await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, value: web3.utils.toWei('2') }, { from: owner }); + + // default proposal + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + value, + data: this.receiver.contract.methods.mockFunction().encodeABI(), + }, + ], ''); }); it('deployment check', async function () { expect(await this.mock.name()).to.be.equal(name); expect(await this.mock.token()).to.be.equal(this.token.address); - expect(await this.mock.votingDelay()).to.be.bignumber.equal('4'); - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16'); + expect(await this.mock.votingDelay()).to.be.bignumber.equal(votingDelay); + expect(await this.mock.votingPeriod()).to.be.bignumber.equal(votingPeriod); expect(await this.mock.quorum(0)).to.be.bignumber.equal('0'); }); - describe('voting with comp token', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('1'), support: Enums.VoteType.For }, - { voter: voter2, weight: web3.utils.toWei('10'), support: Enums.VoteType.For }, - { voter: voter3, weight: web3.utils.toWei('5'), support: Enums.VoteType.Against }, - { voter: voter4, weight: web3.utils.toWei('2'), support: Enums.VoteType.Abstain }, - ], - }; - }); - afterEach(async function () { - expect(await this.mock.hasVoted(this.id, owner)).to.be.equal(false); - expect(await this.mock.hasVoted(this.id, voter1)).to.be.equal(true); - expect(await this.mock.hasVoted(this.id, voter2)).to.be.equal(true); - expect(await this.mock.hasVoted(this.id, voter3)).to.be.equal(true); - expect(await this.mock.hasVoted(this.id, voter4)).to.be.equal(true); + it('voting with comp token', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }); + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter3 }); + await this.helper.vote({ support: Enums.VoteType.Abstain }, { from: voter4 }); + await this.helper.waitForDeadline(); + await this.helper.execute(); - this.receipts.castVote.filter(Boolean).forEach(vote => { - const { voter } = vote.logs.find(Boolean).args; - expectEvent( - vote, - 'VoteCast', - this.settings.voters.find(({ address }) => address === voter), - ); - }); - await this.mock.proposalVotes(this.id).then(result => { - for (const [key, value] of Object.entries(Enums.VoteType)) { - expect(result[`${key.toLowerCase()}Votes`]).to.be.bignumber.equal( - Object.values(this.settings.voters).filter(({ support }) => support === value).reduce( - (acc, { weight }) => acc.add(new BN(weight)), - new BN('0'), - ), - ); - } - }); + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter3)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter4)).to.be.equal(true); + + await this.mock.proposalVotes(this.proposal.id).then(results => { + expect(results.forVotes).to.be.bignumber.equal(web3.utils.toWei('17')); + expect(results.againstVotes).to.be.bignumber.equal(web3.utils.toWei('5')); + expect(results.abstainVotes).to.be.bignumber.equal(web3.utils.toWei('2')); }); - runGovernorWorkflow(); }); }); diff --git a/test/governance/extensions/GovernorERC721.test.js b/test/governance/extensions/GovernorERC721.test.js index 3f89c02b4..086fca4c8 100644 --- a/test/governance/extensions/GovernorERC721.test.js +++ b/test/governance/extensions/GovernorERC721.test.js @@ -1,10 +1,7 @@ -const { expectEvent } = require('@openzeppelin/test-helpers'); -const { BN } = require('bn.js'); +const { BN, expectEvent } = require('@openzeppelin/test-helpers'); +const { expect } = require('chai'); const Enums = require('../../helpers/enums'); - -const { - runGovernorWorkflow, -} = require('./../GovernorWorkflow.behavior'); +const { GovernorHelper } = require('../../helpers/governance'); const Token = artifacts.require('ERC721VotesMock'); const Governor = artifacts.require('GovernorVoteMocks'); @@ -14,105 +11,94 @@ contract('GovernorERC721Mock', function (accounts) { const [ owner, voter1, voter2, voter3, voter4 ] = accounts; const name = 'OZ-Governor'; + // const version = '1'; const tokenName = 'MockNFToken'; const tokenSymbol = 'MTKN'; - const NFT0 = web3.utils.toWei('100'); - const NFT1 = web3.utils.toWei('10'); - const NFT2 = web3.utils.toWei('20'); - const NFT3 = web3.utils.toWei('30'); - const NFT4 = web3.utils.toWei('40'); - - // Must be the same as in contract - const ProposalState = { - Pending: new BN('0'), - Active: new BN('1'), - Canceled: new BN('2'), - Defeated: new BN('3'), - Succeeded: new BN('4'), - Queued: new BN('5'), - Expired: new BN('6'), - Executed: new BN('7'), - }; + const NFT0 = new BN(0); + const NFT1 = new BN(1); + const NFT2 = new BN(2); + const NFT3 = new BN(3); + const NFT4 = new BN(4); + const votingDelay = new BN(4); + const votingPeriod = new BN(16); + const value = web3.utils.toWei('1'); beforeEach(async function () { this.owner = owner; this.token = await Token.new(tokenName, tokenSymbol); this.mock = await Governor.new(name, this.token.address); this.receiver = await CallReceiver.new(); - await this.token.mint(owner, NFT0); - await this.token.mint(owner, NFT1); - await this.token.mint(owner, NFT2); - await this.token.mint(owner, NFT3); - await this.token.mint(owner, NFT4); - await this.token.delegate(voter1, { from: voter1 }); - await this.token.delegate(voter2, { from: voter2 }); - await this.token.delegate(voter3, { from: voter3 }); - await this.token.delegate(voter4, { from: voter4 }); + this.helper = new GovernorHelper(this.mock); + + await web3.eth.sendTransaction({ from: owner, to: this.mock.address, value }); + + await Promise.all([ NFT0, NFT1, NFT2, NFT3, NFT4 ].map(tokenId => this.token.mint(owner, tokenId))); + await this.helper.delegate({ token: this.token, to: voter1, tokenId: NFT0 }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, tokenId: NFT1 }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, tokenId: NFT2 }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, tokenId: NFT3 }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, tokenId: NFT4 }, { from: owner }); + + // default proposal + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + value, + data: this.receiver.contract.methods.mockFunction().encodeABI(), + }, + ], ''); }); it('deployment check', async function () { expect(await this.mock.name()).to.be.equal(name); expect(await this.mock.token()).to.be.equal(this.token.address); - expect(await this.mock.votingDelay()).to.be.bignumber.equal('4'); - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16'); + expect(await this.mock.votingDelay()).to.be.bignumber.equal(votingDelay); + expect(await this.mock.votingPeriod()).to.be.bignumber.equal(votingPeriod); expect(await this.mock.quorum(0)).to.be.bignumber.equal('0'); }); - describe('voting with ERC721 token', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, nfts: [NFT0], support: Enums.VoteType.For }, - { voter: voter2, nfts: [NFT1, NFT2], support: Enums.VoteType.For }, - { voter: voter3, nfts: [NFT3], support: Enums.VoteType.Against }, - { voter: voter4, nfts: [NFT4], support: Enums.VoteType.Abstain }, - ], - }; + it('voting with ERC721 token', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + + expectEvent( + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }), + 'VoteCast', + { voter: voter1, support: Enums.VoteType.For, weight: '1' }, + ); + + expectEvent( + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }), + 'VoteCast', + { voter: voter2, support: Enums.VoteType.For, weight: '2' }, + ); + + expectEvent( + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter3 }), + 'VoteCast', + { voter: voter3, support: Enums.VoteType.Against, weight: '1' }, + ); + + expectEvent( + await this.helper.vote({ support: Enums.VoteType.Abstain }, { from: voter4 }), + 'VoteCast', + { voter: voter4, support: Enums.VoteType.Abstain, weight: '1' }, + ); + + await this.helper.waitForDeadline(); + await this.helper.execute(); + + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter3)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter4)).to.be.equal(true); + + await this.mock.proposalVotes(this.proposal.id).then(results => { + expect(results.forVotes).to.be.bignumber.equal('3'); + expect(results.againstVotes).to.be.bignumber.equal('1'); + expect(results.abstainVotes).to.be.bignumber.equal('1'); }); - - afterEach(async function () { - expect(await this.mock.hasVoted(this.id, owner)).to.be.equal(false); - - for (const vote of this.receipts.castVote.filter(Boolean)) { - const { voter } = vote.logs.find(Boolean).args; - - expect(await this.mock.hasVoted(this.id, voter)).to.be.equal(true); - - expectEvent( - vote, - 'VoteCast', - this.settings.voters.find(({ address }) => address === voter), - ); - - if (voter === voter2) { - expect(await this.token.getVotes(voter, vote.blockNumber)).to.be.bignumber.equal('2'); - } else { - expect(await this.token.getVotes(voter, vote.blockNumber)).to.be.bignumber.equal('1'); - } - } - - await this.mock.proposalVotes(this.id).then(result => { - for (const [key, value] of Object.entries(Enums.VoteType)) { - expect(result[`${key.toLowerCase()}Votes`]).to.be.bignumber.equal( - Object.values(this.settings.voters).filter(({ support }) => support === value).reduce( - (acc, { nfts }) => acc.add(new BN(nfts.length)), - new BN('0'), - ), - ); - } - }); - - expect(await this.mock.state(this.id)).to.be.bignumber.equal(ProposalState.Executed); - }); - - runGovernorWorkflow(); }); }); diff --git a/test/governance/extensions/GovernorPreventLateQuorum.test.js b/test/governance/extensions/GovernorPreventLateQuorum.test.js index e4ae5c17c..6a5d644e7 100644 --- a/test/governance/extensions/GovernorPreventLateQuorum.test.js +++ b/test/governance/extensions/GovernorPreventLateQuorum.test.js @@ -1,9 +1,7 @@ -const { BN, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers'); +const { BN, expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); +const { expect } = require('chai'); const Enums = require('../../helpers/enums'); - -const { - runGovernorWorkflow, -} = require('../GovernorWorkflow.behavior'); +const { GovernorHelper } = require('../../helpers/governance'); const Token = artifacts.require('ERC20VotesCompMock'); const Governor = artifacts.require('GovernorPreventLateQuorumMock'); @@ -21,6 +19,7 @@ contract('GovernorPreventLateQuorum', function (accounts) { const votingPeriod = new BN(16); const lateQuorumVoteExtension = new BN(8); const quorum = web3.utils.toWei('1'); + const value = web3.utils.toWei('1'); beforeEach(async function () { this.owner = owner; @@ -34,11 +33,25 @@ contract('GovernorPreventLateQuorum', function (accounts) { lateQuorumVoteExtension, ); this.receiver = await CallReceiver.new(); + + this.helper = new GovernorHelper(this.mock); + + await web3.eth.sendTransaction({ from: owner, to: this.mock.address, value }); + await this.token.mint(owner, tokenSupply); - await this.token.delegate(voter1, { from: voter1 }); - await this.token.delegate(voter2, { from: voter2 }); - await this.token.delegate(voter3, { from: voter3 }); - await this.token.delegate(voter4, { from: voter4 }); + await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, value: web3.utils.toWei('2') }, { from: owner }); + + // default proposal + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + value, + data: this.receiver.contract.methods.mockFunction().encodeABI(), + }, + ], ''); }); it('deployment check', async function () { @@ -50,198 +63,115 @@ contract('GovernorPreventLateQuorum', function (accounts) { expect(await this.mock.lateQuorumVoteExtension()).to.be.bignumber.equal(lateQuorumVoteExtension); }); - describe('nominal is unaffected', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ 0 ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], + it('nominal workflow unaffected', async function () { + const txPropose = await this.helper.propose({ from: proposer }); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }); + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter3 }); + await this.helper.vote({ support: Enums.VoteType.Abstain }, { from: voter4 }); + await this.helper.waitForDeadline(); + await this.helper.execute(); + + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter3)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter4)).to.be.equal(true); + + await this.mock.proposalVotes(this.proposal.id).then(results => { + expect(results.forVotes).to.be.bignumber.equal(web3.utils.toWei('17')); + expect(results.againstVotes).to.be.bignumber.equal(web3.utils.toWei('5')); + expect(results.abstainVotes).to.be.bignumber.equal(web3.utils.toWei('2')); + }); + + const startBlock = new BN(txPropose.receipt.blockNumber).add(votingDelay); + const endBlock = new BN(txPropose.receipt.blockNumber).add(votingDelay).add(votingPeriod); + expect(await this.mock.proposalSnapshot(this.proposal.id)).to.be.bignumber.equal(startBlock); + expect(await this.mock.proposalDeadline(this.proposal.id)).to.be.bignumber.equal(endBlock); + + expectEvent( + txPropose, + 'ProposalCreated', + { + proposalId: this.proposal.id, proposer, - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('1'), support: Enums.VoteType.For, reason: 'This is nice' }, - { voter: voter2, weight: web3.utils.toWei('7'), support: Enums.VoteType.For }, - { voter: voter3, weight: web3.utils.toWei('5'), support: Enums.VoteType.Against }, - { voter: voter4, weight: web3.utils.toWei('2'), support: Enums.VoteType.Abstain }, - ], - }; - }); - - afterEach(async function () { - expect(await this.mock.hasVoted(this.id, owner)).to.be.equal(false); - expect(await this.mock.hasVoted(this.id, voter1)).to.be.equal(true); - expect(await this.mock.hasVoted(this.id, voter2)).to.be.equal(true); - - await this.mock.proposalVotes(this.id).then(result => { - for (const [key, value] of Object.entries(Enums.VoteType)) { - expect(result[`${key.toLowerCase()}Votes`]).to.be.bignumber.equal( - Object.values(this.settings.voters).filter(({ support }) => support === value).reduce( - (acc, { weight }) => acc.add(new BN(weight)), - new BN('0'), - ), - ); - } - }); - - const startBlock = new BN(this.receipts.propose.blockNumber).add(votingDelay); - const endBlock = new BN(this.receipts.propose.blockNumber).add(votingDelay).add(votingPeriod); - expect(await this.mock.proposalSnapshot(this.id)).to.be.bignumber.equal(startBlock); - expect(await this.mock.proposalDeadline(this.id)).to.be.bignumber.equal(endBlock); - - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { - proposalId: this.id, - proposer, - targets: this.settings.proposal[0], - // values: this.settings.proposal[1].map(value => new BN(value)), - signatures: this.settings.proposal[2].map(() => ''), - calldatas: this.settings.proposal[2], - startBlock, - endBlock, - description: this.settings.proposal[3], - }, - ); - - this.receipts.castVote.filter(Boolean).forEach(vote => { - const { voter } = vote.logs.find(Boolean).args; - expectEvent( - vote, - 'VoteCast', - this.settings.voters.find(({ address }) => address === voter), - ); - expectEvent.notEmitted( - vote, - 'ProposalExtended', - ); - }); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); - }); - runGovernorWorkflow(); + targets: this.proposal.targets, + // values: this.proposal.values.map(value => new BN(value)), + signatures: this.proposal.signatures, + calldatas: this.proposal.data, + startBlock, + endBlock, + description: this.proposal.description, + }, + ); }); - describe('Delay is extended to prevent last minute take-over', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ 0 ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - proposer, - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('0.2'), support: Enums.VoteType.Against }, - { voter: voter2, weight: web3.utils.toWei('1.0') }, // do not actually vote, only getting tokens - { voter: voter3, weight: web3.utils.toWei('0.9') }, // do not actually vote, only getting tokens - ], - steps: { - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); + it('Delay is extended to prevent last minute take-over', async function () { + const txPropose = await this.helper.propose({ from: proposer }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Active); + // compute original schedule + const startBlock = new BN(txPropose.receipt.blockNumber).add(votingDelay); + const endBlock = new BN(txPropose.receipt.blockNumber).add(votingDelay).add(votingPeriod); + expect(await this.mock.proposalSnapshot(this.proposal.id)).to.be.bignumber.equal(startBlock); + expect(await this.mock.proposalDeadline(this.proposal.id)).to.be.bignumber.equal(endBlock); - const startBlock = new BN(this.receipts.propose.blockNumber).add(votingDelay); - const endBlock = new BN(this.receipts.propose.blockNumber).add(votingDelay).add(votingPeriod); - expect(await this.mock.proposalSnapshot(this.id)).to.be.bignumber.equal(startBlock); - expect(await this.mock.proposalDeadline(this.id)).to.be.bignumber.equal(endBlock); + // wait for the last minute to vote + await this.helper.waitForDeadline(-1); + const txVote = await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }); - // wait until the vote is almost over - await time.advanceBlockTo(endBlock.subn(1)); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Active); + // cannot execute yet + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Active); - // try to overtake the vote at the last minute - const tx = await this.mock.castVote(this.id, Enums.VoteType.For, { from: voter2 }); + // compute new extended schedule + const extendedDeadline = new BN(txVote.receipt.blockNumber).add(lateQuorumVoteExtension); + expect(await this.mock.proposalSnapshot(this.proposal.id)).to.be.bignumber.equal(startBlock); + expect(await this.mock.proposalDeadline(this.proposal.id)).to.be.bignumber.equal(extendedDeadline); - // vote duration is extended - const extendedBlock = new BN(tx.receipt.blockNumber).add(lateQuorumVoteExtension); - expect(await this.mock.proposalDeadline(this.id)).to.be.bignumber.equal(extendedBlock); + // still possible to vote + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter1 }); - expectEvent( - tx, - 'ProposalExtended', - { proposalId: this.id, extendedDeadline: extendedBlock }, - ); + await this.helper.waitForDeadline(); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Active); + await this.helper.waitForDeadline(+1); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Defeated); - // vote is still active after expected end - await time.advanceBlockTo(endBlock.addn(1)); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Active); - - // Still possible to vote - await this.mock.castVote(this.id, Enums.VoteType.Against, { from: voter3 }); - - // proposal fails - await time.advanceBlockTo(extendedBlock.addn(1)); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Defeated); - }); - runGovernorWorkflow(); + // check extension event + expectEvent( + txVote, + 'ProposalExtended', + { proposalId: this.proposal.id, extendedDeadline }, + ); }); - describe('setLateQuorumVoteExtension', function () { - beforeEach(async function () { - this.newVoteExtension = new BN(0); // disable voting delay extension - }); - - it('protected', async function () { + describe('onlyGovernance updates', function () { + it('setLateQuorumVoteExtension is protected', async function () { await expectRevert( - this.mock.setLateQuorumVoteExtension(this.newVoteExtension), + this.mock.setLateQuorumVoteExtension(0), 'Governor: onlyGovernance', ); }); - describe('using workflow', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.setLateQuorumVoteExtension(this.newVoteExtension).encodeABI() ], - '', - ], - proposer, - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('1.0'), support: Enums.VoteType.For }, - ], - }; - }); - afterEach(async function () { - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.execute, - 'LateQuorumVoteExtensionSet', - { oldVoteExtension: lateQuorumVoteExtension, newVoteExtension: this.newVoteExtension }, - ); - expect(await this.mock.lateQuorumVoteExtension()).to.be.bignumber.equal(this.newVoteExtension); - }); - runGovernorWorkflow(); + it('can setLateQuorumVoteExtension through governance', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.setLateQuorumVoteExtension('0').encodeABI(), + }, + ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + + expectEvent( + await this.helper.execute(), + 'LateQuorumVoteExtensionSet', + { oldVoteExtension: lateQuorumVoteExtension, newVoteExtension: '0' }, + ); + + expect(await this.mock.lateQuorumVoteExtension()).to.be.bignumber.equal('0'); }); }); }); diff --git a/test/governance/extensions/GovernorTimelockCompound.test.js b/test/governance/extensions/GovernorTimelockCompound.test.js index e623c4571..a31df68a2 100644 --- a/test/governance/extensions/GovernorTimelockCompound.test.js +++ b/test/governance/extensions/GovernorTimelockCompound.test.js @@ -1,11 +1,8 @@ -const { constants, expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); +const { BN, constants, expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); const { expect } = require('chai'); -const Enums = require('../../helpers/enums'); const RLP = require('rlp'); - -const { - runGovernorWorkflow, -} = require('../GovernorWorkflow.behavior'); +const Enums = require('../../helpers/enums'); +const { GovernorHelper } = require('../../helpers/governance'); const { shouldSupportInterfaces, @@ -21,13 +18,16 @@ function makeContractAddress (creator, nonce) { } contract('GovernorTimelockCompound', function (accounts) { - const [ admin, voter, other ] = accounts; + const [ owner, voter1, voter2, voter3, voter4, other ] = accounts; const name = 'OZ-Governor'; // const version = '1'; const tokenName = 'MockToken'; const tokenSymbol = 'MTKN'; const tokenSupply = web3.utils.toWei('100'); + const votingDelay = new BN(4); + const votingPeriod = new BN(16); + const value = web3.utils.toWei('1'); beforeEach(async function () { const [ deployer ] = await web3.eth.getAccounts(); @@ -39,10 +39,34 @@ contract('GovernorTimelockCompound', function (accounts) { const predictGovernor = makeContractAddress(deployer, nonce + 1); this.timelock = await Timelock.new(predictGovernor, 2 * 86400); - this.mock = await Governor.new(name, this.token.address, 4, 16, this.timelock.address, 0); + this.mock = await Governor.new( + name, + this.token.address, + votingDelay, + votingPeriod, + this.timelock.address, + 0, + ); this.receiver = await CallReceiver.new(); - await this.token.mint(voter, tokenSupply); - await this.token.delegate(voter, { from: voter }); + + this.helper = new GovernorHelper(this.mock); + + await web3.eth.sendTransaction({ from: owner, to: this.timelock.address, value }); + + await this.token.mint(owner, tokenSupply); + await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, value: web3.utils.toWei('2') }, { from: owner }); + + // default proposal + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + value, + data: this.receiver.contract.methods.mockFunction().encodeABI(), + }, + ], ''); }); shouldSupportInterfaces([ @@ -53,436 +77,292 @@ contract('GovernorTimelockCompound', function (accounts) { ]); it('doesn\'t accept ether transfers', async function () { - await expectRevert.unspecified(web3.eth.sendTransaction({ from: voter, to: this.mock.address, value: 1 })); + await expectRevert.unspecified(web3.eth.sendTransaction({ from: owner, to: this.mock.address, value: 1 })); }); it('post deployment check', async function () { expect(await this.mock.name()).to.be.equal(name); expect(await this.mock.token()).to.be.equal(this.token.address); - expect(await this.mock.votingDelay()).to.be.bignumber.equal('4'); - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16'); + expect(await this.mock.votingDelay()).to.be.bignumber.equal(votingDelay); + expect(await this.mock.votingPeriod()).to.be.bignumber.equal(votingPeriod); expect(await this.mock.quorum(0)).to.be.bignumber.equal('0'); expect(await this.mock.timelock()).to.be.equal(this.timelock.address); expect(await this.timelock.admin()).to.be.equal(this.mock.address); }); - describe('nominal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 7 * 86400 }, - }, - }; - }); - afterEach(async function () { - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.queue, - 'ProposalQueued', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.queue.transactionHash, - this.timelock, - 'QueueTransaction', - { eta: this.eta }, - ); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.timelock, - 'ExecuteTransaction', - { eta: this.eta }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); - }); - runGovernorWorkflow(); + it('nominal', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }); + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter3 }); + await this.helper.vote({ support: Enums.VoteType.Abstain }, { from: voter4 }); + await this.helper.waitForDeadline(); + const txQueue = await this.helper.queue(); + const eta = await this.mock.proposalEta(this.proposal.id); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); + + expectEvent(txQueue, 'ProposalQueued', { proposalId: this.proposal.id }); + await expectEvent.inTransaction(txQueue.tx, this.timelock, 'QueueTransaction', { eta }); + + expectEvent(txExecute, 'ProposalExecuted', { proposalId: this.proposal.id }); + await expectEvent.inTransaction(txExecute.tx, this.timelock, 'ExecuteTransaction', { eta }); + await expectEvent.inTransaction(txExecute.tx, this.receiver, 'MockFunctionCalled'); }); - describe('not queued', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { enable: false }, - execute: { error: 'GovernorTimelockCompound: proposal not yet queued' }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Succeeded); - }); - runGovernorWorkflow(); - }); + describe('should revert', function () { + describe('on queue', function () { + it('if already queued', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await expectRevert(this.helper.queue(), 'Governor: proposal not successful'); + }); - describe('to early', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - execute: { error: 'Timelock::executeTransaction: Transaction hasn\'t surpassed time lock' }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Queued); - }); - runGovernorWorkflow(); - }); - - describe('to late', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 30 * 86400 }, - execute: { error: 'Governor: proposal not successful' }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Expired); - }); - runGovernorWorkflow(); - }); - - describe('deplicated underlying call', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - Array(2).fill(this.token.address), - Array(2).fill(web3.utils.toWei('0')), - Array(2).fill(this.token.contract.methods.approve(this.receiver.address, constants.MAX_UINT256).encodeABI()), - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { - error: 'GovernorTimelockCompound: identical proposal action already queued', - }, - execute: { - error: 'GovernorTimelockCompound: proposal not yet queued', - }, - }, - }; - }); - runGovernorWorkflow(); - }); - - describe('re-queue / re-execute', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 7 * 86400 }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Executed); - - await expectRevert( - this.mock.queue(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - await expectRevert( - this.mock.execute(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - }); - runGovernorWorkflow(); - }); - - describe('cancel before queue prevents scheduling', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { enable: false }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Succeeded); - - expectEvent( - await this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'ProposalCanceled', - { proposalId: this.id }, - ); - - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); - - await expectRevert( - this.mock.queue(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - }); - runGovernorWorkflow(); - }); - - describe('cancel after queue prevents executing', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 7 * 86400 }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Queued); - - const receipt = await this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash); - expectEvent( - receipt, - 'ProposalCanceled', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - receipt.receipt.transactionHash, - this.timelock, - 'CancelTransaction', - ); - - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); - - await expectRevert( - this.mock.execute(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - }); - runGovernorWorkflow(); - }); - - describe('relay', function () { - beforeEach(async function () { - await this.token.mint(this.mock.address, 1); - this.call = [ - this.token.address, - 0, - this.token.contract.methods.transfer(other, 1).encodeABI(), - ]; - }); - - it('protected', async function () { - await expectRevert( - this.mock.relay(...this.call), - 'Governor: onlyGovernance', - ); - }); - - describe('using workflow', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ - this.mock.address, - ], - [ - web3.utils.toWei('0'), - ], - [ - this.mock.contract.methods.relay(...this.call).encodeABI(), - ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 7 * 86400 }, - }, + it('if proposal contains duplicate calls', async function () { + const action = { + target: this.token.address, + data: this.token.contract.methods.approve(this.receiver.address, constants.MAX_UINT256).encodeABI(), }; + this.helper.setProposal([ action, action ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await expectRevert( + this.helper.queue(), + 'GovernorTimelockCompound: identical proposal action already queued', + ); + await expectRevert( + this.helper.execute(), + 'GovernorTimelockCompound: proposal not yet queued', + ); + }); + }); + + describe('on execute', function () { + it('if not queued', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(+1); + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Succeeded); + + await expectRevert( + this.helper.execute(), + 'GovernorTimelockCompound: proposal not yet queued', + ); + }); + + it('if too early', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Queued); + + await expectRevert( + this.helper.execute(), + 'Timelock::executeTransaction: Transaction hasn\'t surpassed time lock', + ); + }); + + it('if too late', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(+30 * 86400); + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Expired); + + await expectRevert( + this.helper.execute(), + 'Governor: proposal not successful', + ); + }); + + it('if already executed', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + await this.helper.execute(); + await expectRevert( + this.helper.execute(), + 'Governor: proposal not successful', + ); + }); + }); + }); + + describe('cancel', function () { + it('cancel before queue prevents scheduling', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + + expectEvent( + await this.helper.cancel(), + 'ProposalCanceled', + { proposalId: this.proposal.id }, + ); + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); + await expectRevert(this.helper.queue(), 'Governor: proposal not successful'); + }); + + it('cancel after queue prevents executing', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + + expectEvent( + await this.helper.cancel(), + 'ProposalCanceled', + { proposalId: this.proposal.id }, + ); + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + }); + + describe('onlyGovernance', function () { + describe('relay', function () { + beforeEach(async function () { + await this.token.mint(this.mock.address, 1); + }); + + it('is protected', async function () { + await expectRevert( + this.mock.relay( + this.token.address, + 0, + this.token.contract.methods.transfer(other, 1).encodeABI(), + ), + 'Governor: onlyGovernance', + ); + }); + + it('can be executed through governance', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.relay( + this.token.address, + 0, + this.token.contract.methods.transfer(other, 1).encodeABI(), + ).encodeABI(), + }, + ], ''); expect(await this.token.balanceOf(this.mock.address), 1); expect(await this.token.balanceOf(other), 0); - }); - afterEach(async function () { + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); + expect(await this.token.balanceOf(this.mock.address), 0); expect(await this.token.balanceOf(other), 1); + + expectEvent.inTransaction( + txExecute.tx, + this.token, + 'Transfer', + { from: this.mock.address, to: other, value: '1' }, + ); }); - runGovernorWorkflow(); - }); - }); - - describe('updateTimelock', function () { - beforeEach(async function () { - this.newTimelock = await Timelock.new(this.mock.address, 7 * 86400); }); - it('protected', async function () { - await expectRevert( - this.mock.updateTimelock(this.newTimelock.address), - 'Governor: onlyGovernance', - ); - }); - - describe('using workflow', function () { + describe('updateTimelock', function () { beforeEach(async function () { - this.settings = { - proposal: [ - [ - this.timelock.address, - this.mock.address, - ], - [ - web3.utils.toWei('0'), - web3.utils.toWei('0'), - ], - [ - this.timelock.contract.methods.setPendingAdmin(admin).encodeABI(), - this.mock.contract.methods.updateTimelock(this.newTimelock.address).encodeABI(), - ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 7 * 86400 }, - }, - }; + this.newTimelock = await Timelock.new(this.mock.address, 7 * 86400); }); - afterEach(async function () { - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { proposalId: this.id }, + + it('is protected', async function () { + await expectRevert( + this.mock.updateTimelock(this.newTimelock.address), + 'Governor: onlyGovernance', ); + }); + + it('can be executed through governance to', async function () { + this.helper.setProposal([ + { + target: this.timelock.address, + data: this.timelock.contract.methods.setPendingAdmin(owner).encodeABI(), + }, + { + target: this.mock.address, + data: this.mock.contract.methods.updateTimelock(this.newTimelock.address).encodeABI(), + }, + ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); + expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.execute, + txExecute, 'TimelockChange', { oldTimelock: this.timelock.address, newTimelock: this.newTimelock.address }, ); + expect(await this.mock.timelock()).to.be.bignumber.equal(this.newTimelock.address); }); - runGovernorWorkflow(); - }); - }); - - describe('transfer timelock to new governor', function () { - beforeEach(async function () { - this.newGovernor = await Governor.new(name, this.token.address, 8, 32, this.timelock.address, 0); }); - describe('using workflow', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.timelock.address ], - [ web3.utils.toWei('0') ], - [ this.timelock.contract.methods.setPendingAdmin(this.newGovernor.address).encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 7 * 86400 }, - }, - }; - }); - afterEach(async function () { - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.timelock, - 'NewPendingAdmin', - { newPendingAdmin: this.newGovernor.address }, - ); - await this.newGovernor.__acceptAdmin(); - expect(await this.timelock.admin()).to.be.bignumber.equal(this.newGovernor.address); - }); - runGovernorWorkflow(); + it('can transfer timelock to new governor', async function () { + const newGovernor = await Governor.new(name, this.token.address, 8, 32, this.timelock.address, 0); + + this.helper.setProposal([ + { + target: this.timelock.address, + data: this.timelock.contract.methods.setPendingAdmin(newGovernor.address).encodeABI(), + }, + ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); + + await expectEvent.inTransaction( + txExecute.tx, + this.timelock, + 'NewPendingAdmin', + { newPendingAdmin: newGovernor.address }, + ); + + await newGovernor.__acceptAdmin(); + expect(await this.timelock.admin()).to.be.bignumber.equal(newGovernor.address); }); }); }); diff --git a/test/governance/extensions/GovernorTimelockControl.test.js b/test/governance/extensions/GovernorTimelockControl.test.js index 85dd0ea75..45e26c935 100644 --- a/test/governance/extensions/GovernorTimelockControl.test.js +++ b/test/governance/extensions/GovernorTimelockControl.test.js @@ -1,10 +1,7 @@ -const { constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers'); +const { BN, constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers'); const { expect } = require('chai'); const Enums = require('../../helpers/enums'); - -const { - runGovernorWorkflow, -} = require('../GovernorWorkflow.behavior'); +const { GovernorHelper } = require('../../helpers/governance'); const { shouldSupportInterfaces, @@ -16,7 +13,7 @@ const Governor = artifacts.require('GovernorTimelockControlMock'); const CallReceiver = artifacts.require('CallReceiverMock'); contract('GovernorTimelockControl', function (accounts) { - const [ admin, voter, other ] = accounts; + const [ owner, voter1, voter2, voter3, voter4, other ] = accounts; const TIMELOCK_ADMIN_ROLE = web3.utils.soliditySha3('TIMELOCK_ADMIN_ROLE'); const PROPOSER_ROLE = web3.utils.soliditySha3('PROPOSER_ROLE'); @@ -28,30 +25,61 @@ contract('GovernorTimelockControl', function (accounts) { const tokenName = 'MockToken'; const tokenSymbol = 'MTKN'; const tokenSupply = web3.utils.toWei('100'); + const votingDelay = new BN(4); + const votingPeriod = new BN(16); + const value = web3.utils.toWei('1'); beforeEach(async function () { const [ deployer ] = await web3.eth.getAccounts(); this.token = await Token.new(tokenName, tokenSymbol); this.timelock = await Timelock.new(3600, [], []); - this.mock = await Governor.new(name, this.token.address, 4, 16, this.timelock.address, 0); + this.mock = await Governor.new( + name, + this.token.address, + votingDelay, + votingPeriod, + this.timelock.address, + 0, + ); this.receiver = await CallReceiver.new(); + this.helper = new GovernorHelper(this.mock); + this.TIMELOCK_ADMIN_ROLE = await this.timelock.TIMELOCK_ADMIN_ROLE(); this.PROPOSER_ROLE = await this.timelock.PROPOSER_ROLE(); this.EXECUTOR_ROLE = await this.timelock.EXECUTOR_ROLE(); this.CANCELLER_ROLE = await this.timelock.CANCELLER_ROLE(); + await web3.eth.sendTransaction({ from: owner, to: this.timelock.address, value }); + // normal setup: governor is proposer, everyone is executor, timelock is its own admin await this.timelock.grantRole(PROPOSER_ROLE, this.mock.address); - await this.timelock.grantRole(PROPOSER_ROLE, admin); + await this.timelock.grantRole(PROPOSER_ROLE, owner); await this.timelock.grantRole(CANCELLER_ROLE, this.mock.address); - await this.timelock.grantRole(CANCELLER_ROLE, admin); + await this.timelock.grantRole(CANCELLER_ROLE, owner); await this.timelock.grantRole(EXECUTOR_ROLE, constants.ZERO_ADDRESS); await this.timelock.revokeRole(TIMELOCK_ADMIN_ROLE, deployer); - await this.token.mint(voter, tokenSupply); - await this.token.delegate(voter, { from: voter }); + await this.token.mint(owner, tokenSupply); + await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, value: web3.utils.toWei('2') }, { from: owner }); + + // default proposal + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + value, + data: this.receiver.contract.methods.mockFunction().encodeABI(), + }, + ], ''); + this.proposal.timelockid = await this.timelock.hashOperationBatch( + ...this.proposal.shortProposal.slice(0, 3), + '0x0', + this.proposal.shortProposal[3], + ); }); shouldSupportInterfaces([ @@ -62,473 +90,293 @@ contract('GovernorTimelockControl', function (accounts) { ]); it('doesn\'t accept ether transfers', async function () { - await expectRevert.unspecified(web3.eth.sendTransaction({ from: voter, to: this.mock.address, value: 1 })); + await expectRevert.unspecified(web3.eth.sendTransaction({ from: owner, to: this.mock.address, value: 1 })); }); it('post deployment check', async function () { expect(await this.mock.name()).to.be.equal(name); expect(await this.mock.token()).to.be.equal(this.token.address); - expect(await this.mock.votingDelay()).to.be.bignumber.equal('4'); - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16'); + expect(await this.mock.votingDelay()).to.be.bignumber.equal(votingDelay); + expect(await this.mock.votingPeriod()).to.be.bignumber.equal(votingPeriod); expect(await this.mock.quorum(0)).to.be.bignumber.equal('0'); expect(await this.mock.timelock()).to.be.equal(this.timelock.address); }); - describe('nominal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 3600 }, - }, - }; + it('nominal', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }); + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter3 }); + await this.helper.vote({ support: Enums.VoteType.Abstain }, { from: voter4 }); + await this.helper.waitForDeadline(); + const txQueue = await this.helper.queue(); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); + + expectEvent(txQueue, 'ProposalQueued', { proposalId: this.proposal.id }); + await expectEvent.inTransaction(txQueue.tx, this.timelock, 'CallScheduled', { id: this.proposal.timelockid }); + + expectEvent(txExecute, 'ProposalExecuted', { proposalId: this.proposal.id }); + await expectEvent.inTransaction(txExecute.tx, this.timelock, 'CallExecuted', { id: this.proposal.timelockid }); + await expectEvent.inTransaction(txExecute.tx, this.receiver, 'MockFunctionCalled'); + }); + + describe('should revert', function () { + describe('on queue', function () { + it('if already queued', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await expectRevert(this.helper.queue(), 'Governor: proposal not successful'); + }); }); - afterEach(async function () { - const timelockid = await this.timelock.hashOperationBatch( - ...this.settings.proposal.slice(0, 3), - '0x0', - this.descriptionHash, - ); + + describe('on execute', function () { + it('if not queued', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(+1); + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Succeeded); + + await expectRevert(this.helper.execute(), 'TimelockController: operation is not ready'); + }); + + it('if too early', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Queued); + + await expectRevert(this.helper.execute(), 'TimelockController: operation is not ready'); + }); + + it('if already executed', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + await this.helper.execute(); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + + it('if already executed by another proposer', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + + await this.timelock.executeBatch( + ...this.proposal.shortProposal.slice(0, 3), + '0x0', + this.proposal.shortProposal[3], + ); + + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + }); + }); + + describe('cancel', function () { + it('cancel before queue prevents scheduling', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); expectEvent( - this.receipts.propose, - 'ProposalCreated', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.queue, - 'ProposalQueued', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.queue.transactionHash, - this.timelock, - 'CallScheduled', - { id: timelockid }, - ); - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.timelock, - 'CallExecuted', - { id: timelockid }, - ); - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.receiver, - 'MockFunctionCalled', - ); - }); - runGovernorWorkflow(); - }); - - describe('executed by other proposer', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 3600 }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - await this.timelock.executeBatch( - ...this.settings.proposal.slice(0, 3), - '0x0', - this.descriptionHash, - ); - - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Executed); - - await expectRevert( - this.mock.execute(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - }); - runGovernorWorkflow(); - }); - - describe('not queued', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { enable: false }, - execute: { error: 'TimelockController: operation is not ready' }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Succeeded); - }); - runGovernorWorkflow(); - }); - - describe('to early', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - execute: { error: 'TimelockController: operation is not ready' }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Queued); - }); - runGovernorWorkflow(); - }); - - describe('re-queue / re-execute', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 3600 }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Executed); - - await expectRevert( - this.mock.queue(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - await expectRevert( - this.mock.execute(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); - }); - runGovernorWorkflow(); - }); - - describe('cancel before queue prevents scheduling', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { enable: false }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Succeeded); - - expectEvent( - await this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash), + await this.helper.cancel(), 'ProposalCanceled', - { proposalId: this.id }, + { proposalId: this.proposal.id }, ); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); - - await expectRevert( - this.mock.queue(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); + await expectRevert(this.helper.queue(), 'Governor: proposal not successful'); }); - runGovernorWorkflow(); - }); - describe('cancel after queue prevents execution', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 3600 }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - const timelockid = await this.timelock.hashOperationBatch( - ...this.settings.proposal.slice(0, 3), - '0x0', - this.descriptionHash, - ); + it('cancel after queue prevents executing', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Queued); - - const receipt = await this.mock.cancel(...this.settings.proposal.slice(0, -1), this.descriptionHash); expectEvent( - receipt, + await this.helper.cancel(), 'ProposalCanceled', - { proposalId: this.id }, + { proposalId: this.proposal.id }, ); - await expectEvent.inTransaction( - receipt.receipt.transactionHash, - this.timelock, + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + + it('cancel on timelock is reflected on governor', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Queued); + + expectEvent( + await this.timelock.cancel(this.proposal.timelockid, { from: owner }), 'Cancelled', - { id: timelockid }, + { id: this.proposal.timelockid }, ); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); - - await expectRevert( - this.mock.execute(...this.settings.proposal.slice(0, -1), this.descriptionHash), - 'Governor: proposal not successful', - ); + expect(await this.mock.state(this.proposal.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); }); - runGovernorWorkflow(); }); - describe('relay', function () { - beforeEach(async function () { - await this.token.mint(this.mock.address, 1); - this.call = [ - this.token.address, - 0, - this.token.contract.methods.transfer(other, 1).encodeABI(), - ]; - }); - - it('protected', async function () { - await expectRevert( - this.mock.relay(...this.call), - 'Governor: onlyGovernance', - ); - }); - - it('protected against other proposers', async function () { - await this.timelock.schedule( - this.mock.address, - web3.utils.toWei('0'), - this.mock.contract.methods.relay(...this.call).encodeABI(), - constants.ZERO_BYTES32, - constants.ZERO_BYTES32, - 3600, - { from: admin }, - ); - - await time.increase(3600); - - await expectRevert( - this.timelock.execute( - this.mock.address, - web3.utils.toWei('0'), - this.mock.contract.methods.relay(...this.call).encodeABI(), - constants.ZERO_BYTES32, - constants.ZERO_BYTES32, - { from: admin }, - ), - 'TimelockController: underlying transaction reverted', - ); - }); - - describe('using workflow', function () { + describe('onlyGovernance', function () { + describe('relay', function () { beforeEach(async function () { - this.settings = { - proposal: [ - [ - this.mock.address, - ], - [ - web3.utils.toWei('0'), - ], - [ - this.mock.contract.methods.relay(...this.call).encodeABI(), - ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 7 * 86400 }, + await this.token.mint(this.mock.address, 1); + }); + + it('is protected', async function () { + await expectRevert( + this.mock.relay( + this.token.address, + 0, + this.token.contract.methods.transfer(other, 1).encodeABI(), + ), + 'Governor: onlyGovernance', + ); + }); + + it('can be executed through governance', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.relay( + this.token.address, + 0, + this.token.contract.methods.transfer(other, 1).encodeABI(), + ).encodeABI(), }, - }; + ], ''); expect(await this.token.balanceOf(this.mock.address), 1); expect(await this.token.balanceOf(other), 0); - }); - afterEach(async function () { + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); + expect(await this.token.balanceOf(this.mock.address), 0); expect(await this.token.balanceOf(other), 1); + + expectEvent.inTransaction( + txExecute.tx, + this.token, + 'Transfer', + { from: this.mock.address, to: other, value: '1' }, + ); }); - runGovernorWorkflow(); - }); - }); - describe('cancel on timelock is forwarded in state', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 3600 }, - execute: { enable: false }, - }, - }; - }); - afterEach(async function () { - const timelockid = await this.timelock.hashOperationBatch( - ...this.settings.proposal.slice(0, 3), - '0x0', - this.descriptionHash, - ); + it('protected against other proposers', async function () { + await this.timelock.schedule( + this.mock.address, + web3.utils.toWei('0'), + this.mock.contract.methods.relay(constants.ZERO_ADDRESS, 0, '0x').encodeABI(), + constants.ZERO_BYTES32, + constants.ZERO_BYTES32, + 3600, + { from: owner }, + ); - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Queued); + await time.increase(3600); - const receipt = await this.timelock.cancel(timelockid, { from: admin }); - expectEvent( - receipt, - 'Cancelled', - { id: timelockid }, - ); - - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Canceled); - }); - runGovernorWorkflow(); - }); - - describe('updateTimelock', function () { - beforeEach(async function () { - this.newTimelock = await Timelock.new(3600, [], []); + await expectRevert( + this.timelock.execute( + this.mock.address, + web3.utils.toWei('0'), + this.mock.contract.methods.relay(constants.ZERO_ADDRESS, 0, '0x').encodeABI(), + constants.ZERO_BYTES32, + constants.ZERO_BYTES32, + { from: owner }, + ), + 'TimelockController: underlying transaction reverted', + ); + }); }); - it('protected', async function () { - await expectRevert( - this.mock.updateTimelock(this.newTimelock.address), - 'Governor: onlyGovernance', - ); - }); - - describe('using workflow', function () { + describe('updateTimelock', function () { beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.updateTimelock(this.newTimelock.address).encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 3600 }, - }, - }; + this.newTimelock = await Timelock.new(3600, [], []); }); - afterEach(async function () { - expectEvent( - this.receipts.propose, - 'ProposalCreated', - { proposalId: this.id }, + + it('is protected', async function () { + await expectRevert( + this.mock.updateTimelock(this.newTimelock.address), + 'Governor: onlyGovernance', ); + }); + + it('can be executed through governance to', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.updateTimelock(this.newTimelock.address).encodeABI(), + }, + ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + const txExecute = await this.helper.execute(); + expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - expectEvent( - this.receipts.execute, + txExecute, 'TimelockChange', { oldTimelock: this.timelock.address, newTimelock: this.newTimelock.address }, ); + expect(await this.mock.timelock()).to.be.bignumber.equal(this.newTimelock.address); }); - runGovernorWorkflow(); }); }); - describe('clear queue of pending governor calls', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.nonGovernanceFunction().encodeABI() ], - '', - ], - voters: [ - { voter: voter, support: Enums.VoteType.For }, - ], - steps: { - queue: { delay: 3600 }, - }, - }; - }); + it('clear queue of pending governor calls', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.nonGovernanceFunction().encodeABI(), + }, + ], ''); - afterEach(async function () { - expectEvent( - this.receipts.execute, - 'ProposalExecuted', - { proposalId: this.id }, - ); - }); + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.queue(); + await this.helper.waitForEta(); + await this.helper.execute(); - runGovernorWorkflow(); + // This path clears _governanceCall as part of the afterExecute call, + // but we have not way to check that the cleanup actually happened other + // then coverage reports. }); }); diff --git a/test/governance/extensions/GovernorWeightQuorumFraction.test.js b/test/governance/extensions/GovernorWeightQuorumFraction.test.js index 4d3f90dad..ea2b55e8d 100644 --- a/test/governance/extensions/GovernorWeightQuorumFraction.test.js +++ b/test/governance/extensions/GovernorWeightQuorumFraction.test.js @@ -1,9 +1,7 @@ -const { BN, expectEvent, time } = require('@openzeppelin/test-helpers'); +const { BN, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers'); +const { expect } = require('chai'); const Enums = require('../../helpers/enums'); - -const { - runGovernorWorkflow, -} = require('./../GovernorWorkflow.behavior'); +const { GovernorHelper } = require('../../helpers/governance'); const Token = artifacts.require('ERC20VotesMock'); const Governor = artifacts.require('GovernorMock'); @@ -19,24 +17,41 @@ contract('GovernorVotesQuorumFraction', function (accounts) { const tokenSupply = new BN(web3.utils.toWei('100')); const ratio = new BN(8); // percents const newRatio = new BN(6); // percents + const votingDelay = new BN(4); + const votingPeriod = new BN(16); + const value = web3.utils.toWei('1'); beforeEach(async function () { this.owner = owner; this.token = await Token.new(tokenName, tokenSymbol); - this.mock = await Governor.new(name, this.token.address, 4, 16, ratio); + this.mock = await Governor.new(name, this.token.address, votingDelay, votingPeriod, ratio); this.receiver = await CallReceiver.new(); + + this.helper = new GovernorHelper(this.mock); + + await web3.eth.sendTransaction({ from: owner, to: this.mock.address, value }); + await this.token.mint(owner, tokenSupply); - await this.token.delegate(voter1, { from: voter1 }); - await this.token.delegate(voter2, { from: voter2 }); - await this.token.delegate(voter3, { from: voter3 }); - await this.token.delegate(voter4, { from: voter4 }); + await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, value: web3.utils.toWei('2') }, { from: owner }); + + // default proposal + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + value, + data: this.receiver.contract.methods.mockFunction().encodeABI(), + }, + ], ''); }); it('deployment check', async function () { expect(await this.mock.name()).to.be.equal(name); expect(await this.mock.token()).to.be.equal(this.token.address); - expect(await this.mock.votingDelay()).to.be.bignumber.equal('4'); - expect(await this.mock.votingPeriod()).to.be.bignumber.equal('16'); + expect(await this.mock.votingDelay()).to.be.bignumber.equal(votingDelay); + expect(await this.mock.votingPeriod()).to.be.bignumber.equal(votingPeriod); expect(await this.mock.quorum(0)).to.be.bignumber.equal('0'); expect(await this.mock.quorumNumerator()).to.be.bignumber.equal(ratio); expect(await this.mock.quorumDenominator()).to.be.bignumber.equal('100'); @@ -44,51 +59,47 @@ contract('GovernorVotesQuorumFraction', function (accounts) { .to.be.bignumber.equal(tokenSupply.mul(ratio).divn(100)); }); - describe('quroum not reached', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.receiver.address ], - [ web3.utils.toWei('0') ], - [ this.receiver.contract.methods.mockFunction().encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('1'), support: Enums.VoteType.For }, - ], - steps: { - execute: { error: 'Governor: proposal not successful' }, - }, - }; - }); - runGovernorWorkflow(); + it('quroum reached', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + await this.helper.execute(); }); - describe('update quorum ratio through proposal', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.updateQuorumNumerator(newRatio).encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: tokenSupply, support: Enums.VoteType.For }, - ], - }; + it('quroum not reached', async function () { + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }); + await this.helper.waitForDeadline(); + await expectRevert(this.helper.execute(), 'Governor: proposal not successful'); + }); + + describe('onlyGovernance updates', function () { + it('updateQuorumNumerator is protected', async function () { + await expectRevert( + this.mock.updateQuorumNumerator(newRatio), + 'Governor: onlyGovernance', + ); }); - afterEach(async function () { - await expectEvent.inTransaction( - this.receipts.execute.transactionHash, - this.mock, - 'QuorumNumeratorUpdated', + + it('can updateQuorumNumerator through governance', async function () { + this.helper.setProposal([ { - oldQuorumNumerator: ratio, - newQuorumNumerator: newRatio, + target: this.mock.address, + data: this.mock.contract.methods.updateQuorumNumerator(newRatio).encodeABI(), }, + ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + + expectEvent( + await this.helper.execute(), + 'QuorumNumeratorUpdated', + { oldQuorumNumerator: ratio, newQuorumNumerator: newRatio }, ); expect(await this.mock.quorumNumerator()).to.be.bignumber.equal(newRatio); @@ -96,27 +107,24 @@ contract('GovernorVotesQuorumFraction', function (accounts) { expect(await time.latestBlock().then(blockNumber => this.mock.quorum(blockNumber.subn(1)))) .to.be.bignumber.equal(tokenSupply.mul(newRatio).divn(100)); }); - runGovernorWorkflow(); - }); - describe('update quorum over the maximum', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [ this.mock.address ], - [ web3.utils.toWei('0') ], - [ this.mock.contract.methods.updateQuorumNumerator(new BN(101)).encodeABI() ], - '', - ], - tokenHolder: owner, - voters: [ - { voter: voter1, weight: tokenSupply, support: Enums.VoteType.For }, - ], - steps: { - execute: { error: 'GovernorVotesQuorumFraction: quorumNumerator over quorumDenominator' }, + it('cannot updateQuorumNumerator over the maximum', async function () { + this.helper.setProposal([ + { + target: this.mock.address, + data: this.mock.contract.methods.updateQuorumNumerator('101').encodeABI(), }, - }; + ], ''); + + await this.helper.propose(); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter1 }); + await this.helper.waitForDeadline(); + + await expectRevert( + this.helper.execute(), + 'GovernorVotesQuorumFraction: quorumNumerator over quorumDenominator', + ); }); - runGovernorWorkflow(); }); }); diff --git a/test/governance/extensions/GovernorWithParams.test.js b/test/governance/extensions/GovernorWithParams.test.js index 5b4ac8901..875b7053a 100644 --- a/test/governance/extensions/GovernorWithParams.test.js +++ b/test/governance/extensions/GovernorWithParams.test.js @@ -1,20 +1,28 @@ -const { BN, constants, expectEvent } = require('@openzeppelin/test-helpers'); -const { web3 } = require('@openzeppelin/test-helpers/src/setup'); -const Enums = require('../../helpers/enums'); +const { BN, expectEvent } = require('@openzeppelin/test-helpers'); +const { expect } = require('chai'); const ethSigUtil = require('eth-sig-util'); const Wallet = require('ethereumjs-wallet').default; -const { EIP712Domain } = require('../../helpers/eip712'); const { fromRpcSig } = require('ethereumjs-util'); - -const { runGovernorWorkflow } = require('../GovernorWorkflow.behavior'); -const { expect } = require('chai'); +const Enums = require('../../helpers/enums'); +const { EIP712Domain } = require('../../helpers/eip712'); +const { GovernorHelper } = require('../../helpers/governance'); const Token = artifacts.require('ERC20VotesCompMock'); const Governor = artifacts.require('GovernorWithParamsMock'); const CallReceiver = artifacts.require('CallReceiverMock'); +const rawParams = { + uintParam: new BN('42'), + strParam: 'These are my params', +}; + +const encodedParams = web3.eth.abi.encodeParameters( + [ 'uint256', 'string' ], + Object.values(rawParams), +); + contract('GovernorWithParams', function (accounts) { - const [owner, proposer, voter1, voter2, voter3, voter4] = accounts; + const [ owner, proposer, voter1, voter2, voter3, voter4 ] = accounts; const name = 'OZ-Governor'; const version = '1'; @@ -23,17 +31,32 @@ contract('GovernorWithParams', function (accounts) { const tokenSupply = web3.utils.toWei('100'); const votingDelay = new BN(4); const votingPeriod = new BN(16); + const value = web3.utils.toWei('1'); beforeEach(async function () { - this.owner = owner; + this.chainId = await web3.eth.getChainId(); this.token = await Token.new(tokenName, tokenSymbol); this.mock = await Governor.new(name, this.token.address); this.receiver = await CallReceiver.new(); + + this.helper = new GovernorHelper(this.mock); + + await web3.eth.sendTransaction({ from: owner, to: this.mock.address, value }); + await this.token.mint(owner, tokenSupply); - await this.token.delegate(voter1, { from: voter1 }); - await this.token.delegate(voter2, { from: voter2 }); - await this.token.delegate(voter3, { from: voter3 }); - await this.token.delegate(voter4, { from: voter4 }); + await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter2, value: web3.utils.toWei('7') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter3, value: web3.utils.toWei('5') }, { from: owner }); + await this.helper.delegate({ token: this.token, to: voter4, value: web3.utils.toWei('2') }, { from: owner }); + + // default proposal + this.proposal = this.helper.setProposal([ + { + target: this.receiver.address, + value, + data: this.receiver.contract.methods.mockFunction().encodeABI(), + }, + ], ''); }); it('deployment check', async function () { @@ -43,172 +66,57 @@ contract('GovernorWithParams', function (accounts) { expect(await this.mock.votingPeriod()).to.be.bignumber.equal(votingPeriod); }); - describe('nominal is unaffected', function () { - beforeEach(async function () { - this.settings = { - proposal: [ - [this.receiver.address], - [0], - [this.receiver.contract.methods.mockFunction().encodeABI()], - '', - ], - proposer, - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('1'), support: Enums.VoteType.For, reason: 'This is nice' }, - { voter: voter2, weight: web3.utils.toWei('7'), support: Enums.VoteType.For }, - { voter: voter3, weight: web3.utils.toWei('5'), support: Enums.VoteType.Against }, - { voter: voter4, weight: web3.utils.toWei('2'), support: Enums.VoteType.Abstain }, - ], - }; - }); + it('nominal is unaffected', async function () { + await this.helper.propose({ from: proposer }); + await this.helper.waitForSnapshot(); + await this.helper.vote({ support: Enums.VoteType.For, reason: 'This is nice' }, { from: voter1 }); + await this.helper.vote({ support: Enums.VoteType.For }, { from: voter2 }); + await this.helper.vote({ support: Enums.VoteType.Against }, { from: voter3 }); + await this.helper.vote({ support: Enums.VoteType.Abstain }, { from: voter4 }); + await this.helper.waitForDeadline(); + await this.helper.execute(); - afterEach(async function () { - expect(await this.mock.hasVoted(this.id, owner)).to.be.equal(false); - expect(await this.mock.hasVoted(this.id, voter1)).to.be.equal(true); - expect(await this.mock.hasVoted(this.id, voter2)).to.be.equal(true); - - await this.mock.proposalVotes(this.id).then((result) => { - for (const [key, value] of Object.entries(Enums.VoteType)) { - expect(result[`${key.toLowerCase()}Votes`]).to.be.bignumber.equal( - Object.values(this.settings.voters) - .filter(({ support }) => support === value) - .reduce((acc, { weight }) => acc.add(new BN(weight)), new BN('0')), - ); - } - }); - - const startBlock = new BN(this.receipts.propose.blockNumber).add(votingDelay); - const endBlock = new BN(this.receipts.propose.blockNumber).add(votingDelay).add(votingPeriod); - expect(await this.mock.proposalSnapshot(this.id)).to.be.bignumber.equal(startBlock); - expect(await this.mock.proposalDeadline(this.id)).to.be.bignumber.equal(endBlock); - - expectEvent(this.receipts.propose, 'ProposalCreated', { - proposalId: this.id, - proposer, - targets: this.settings.proposal[0], - // values: this.settings.proposal[1].map(value => new BN(value)), - signatures: this.settings.proposal[2].map(() => ''), - calldatas: this.settings.proposal[2], - startBlock, - endBlock, - description: this.settings.proposal[3], - }); - - this.receipts.castVote.filter(Boolean).forEach((vote) => { - const { voter } = vote.logs.filter(({ event }) => event === 'VoteCast').find(Boolean).args; - expectEvent( - vote, - 'VoteCast', - this.settings.voters.find(({ address }) => address === voter), - ); - }); - expectEvent(this.receipts.execute, 'ProposalExecuted', { proposalId: this.id }); - await expectEvent.inTransaction(this.receipts.execute.transactionHash, this.receiver, 'MockFunctionCalled'); - }); - runGovernorWorkflow(); + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(true); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(true); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal('0'); + expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal(value); }); - describe('Voting with params is properly supported', function () { - const voter2Weight = web3.utils.toWei('1.0'); - beforeEach(async function () { - this.settings = { - proposal: [ - [this.receiver.address], - [0], - [this.receiver.contract.methods.mockFunction().encodeABI()], - '', - ], - proposer, - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('0.2'), support: Enums.VoteType.Against }, - { voter: voter2, weight: voter2Weight }, // do not actually vote, only getting tokenss - ], - steps: { - wait: { enable: false }, - execute: { enable: false }, - }, - }; + it('Voting with params is properly supported', async function () { + await this.helper.propose({ from: proposer }); + await this.helper.waitForSnapshot(); + + const weight = new BN(web3.utils.toWei('7')).sub(rawParams.uintParam); + + const tx = await this.helper.vote({ + support: Enums.VoteType.For, + reason: 'no particular reason', + params: encodedParams, + }, { from: voter2 }); + + expectEvent(tx, 'CountParams', { ...rawParams }); + expectEvent(tx, 'VoteCastWithParams', { + voter: voter2, + proposalId: this.proposal.id, + support: Enums.VoteType.For, + weight, + reason: 'no particular reason', + params: encodedParams, }); - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Active); - - const uintParam = new BN(1); - const strParam = 'These are my params'; - const reducedWeight = new BN(voter2Weight).sub(uintParam); - const params = web3.eth.abi.encodeParameters(['uint256', 'string'], [uintParam, strParam]); - const tx = await this.mock.castVoteWithReasonAndParams(this.id, Enums.VoteType.For, '', params, { from: voter2 }); - - expectEvent(tx, 'CountParams', { uintParam, strParam }); - expectEvent(tx, 'VoteCastWithParams', { voter: voter2, weight: reducedWeight, params }); - const votes = await this.mock.proposalVotes(this.id); - expect(votes.forVotes).to.be.bignumber.equal(reducedWeight); - }); - runGovernorWorkflow(); + const votes = await this.mock.proposalVotes(this.proposal.id); + expect(votes.forVotes).to.be.bignumber.equal(weight); }); - describe('Voting with params by signature is properly supported', function () { - const voterBySig = Wallet.generate(); // generate voter by signature wallet - const sigVoterWeight = web3.utils.toWei('1.0'); + it('Voting with params by signature is properly supported', async function () { + const voterBySig = Wallet.generate(); + const voterBySigAddress = web3.utils.toChecksumAddress(voterBySig.getAddressString()); - beforeEach(async function () { - this.chainId = await web3.eth.getChainId(); - this.voter = web3.utils.toChecksumAddress(voterBySig.getAddressString()); - - // use delegateBySig to enable vote delegation sig voting wallet - const { v, r, s } = fromRpcSig( - ethSigUtil.signTypedMessage(voterBySig.getPrivateKey(), { - data: { - types: { - EIP712Domain, - Delegation: [ - { name: 'delegatee', type: 'address' }, - { name: 'nonce', type: 'uint256' }, - { name: 'expiry', type: 'uint256' }, - ], - }, - domain: { name: tokenName, version: '1', chainId: this.chainId, verifyingContract: this.token.address }, - primaryType: 'Delegation', - message: { delegatee: this.voter, nonce: 0, expiry: constants.MAX_UINT256 }, - }, - }), - ); - await this.token.delegateBySig(this.voter, 0, constants.MAX_UINT256, v, r, s); - - this.settings = { - proposal: [ - [this.receiver.address], - [0], - [this.receiver.contract.methods.mockFunction().encodeABI()], - '', - ], - proposer, - tokenHolder: owner, - voters: [ - { voter: voter1, weight: web3.utils.toWei('0.2'), support: Enums.VoteType.Against }, - { voter: this.voter, weight: sigVoterWeight }, // do not actually vote, only getting tokens - ], - steps: { - wait: { enable: false }, - execute: { enable: false }, - }, - }; - }); - - afterEach(async function () { - expect(await this.mock.state(this.id)).to.be.bignumber.equal(Enums.ProposalState.Active); - - const reason = 'This is my reason'; - const uintParam = new BN(1); - const strParam = 'These are my params'; - const reducedWeight = new BN(sigVoterWeight).sub(uintParam); - const params = web3.eth.abi.encodeParameters(['uint256', 'string'], [uintParam, strParam]); - - // prepare signature for vote by signature - const { v, r, s } = fromRpcSig( - ethSigUtil.signTypedMessage(voterBySig.getPrivateKey(), { + const signature = async (message) => { + return fromRpcSig(ethSigUtil.signTypedMessage( + voterBySig.getPrivateKey(), + { data: { types: { EIP712Domain, @@ -221,18 +129,38 @@ contract('GovernorWithParams', function (accounts) { }, domain: { name, version, chainId: this.chainId, verifyingContract: this.mock.address }, primaryType: 'ExtendedBallot', - message: { proposalId: this.id, support: Enums.VoteType.For, reason, params }, + message, }, - }), - ); + }, + )); + }; - const tx = await this.mock.castVoteWithReasonAndParamsBySig(this.id, Enums.VoteType.For, reason, params, v, r, s); + await this.token.delegate(voterBySigAddress, { from: voter2 }); - expectEvent(tx, 'CountParams', { uintParam, strParam }); - expectEvent(tx, 'VoteCastWithParams', { voter: this.voter, weight: reducedWeight, params }); - const votes = await this.mock.proposalVotes(this.id); - expect(votes.forVotes).to.be.bignumber.equal(reducedWeight); + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + + const weight = new BN(web3.utils.toWei('7')).sub(rawParams.uintParam); + + const tx = await this.helper.vote({ + support: Enums.VoteType.For, + reason: 'no particular reason', + params: encodedParams, + signature, }); - runGovernorWorkflow(); + + expectEvent(tx, 'CountParams', { ...rawParams }); + expectEvent(tx, 'VoteCastWithParams', { + voter: voterBySigAddress, + proposalId: this.proposal.id, + support: Enums.VoteType.For, + weight, + reason: 'no particular reason', + params: encodedParams, + }); + + const votes = await this.mock.proposalVotes(this.proposal.id); + expect(votes.forVotes).to.be.bignumber.equal(weight); }); }); diff --git a/test/helpers/governance.js b/test/helpers/governance.js new file mode 100644 index 000000000..accbf79ac --- /dev/null +++ b/test/helpers/governance.js @@ -0,0 +1,211 @@ +const { time } = require('@openzeppelin/test-helpers'); + +function zip (...args) { + return Array(Math.max(...args.map(array => array.length))) + .fill() + .map((_, i) => args.map(array => array[i])); +} + +function concatHex (...args) { + return web3.utils.bytesToHex([].concat(...args.map(h => web3.utils.hexToBytes(h || '0x')))); +} + +function concatOpts (args, opts = null) { + return opts ? args.concat(opts) : args; +} + +class GovernorHelper { + constructor (governor) { + this.governor = governor; + } + + delegate (delegation = {}, opts = null) { + return Promise.all([ + delegation.token.delegate(delegation.to, { from: delegation.to }), + delegation.value && + delegation.token.transfer(...concatOpts([ delegation.to, delegation.value ]), opts), + delegation.tokenId && + delegation.token.ownerOf(delegation.tokenId).then(owner => + delegation.token.transferFrom(...concatOpts([ owner, delegation.to, delegation.tokenId ], opts)), + ), + ]); + } + + propose (opts = null) { + const proposal = this.currentProposal; + + return this.governor.methods[ + proposal.useCompatibilityInterface + ? 'propose(address[],uint256[],string[],bytes[],string)' + : 'propose(address[],uint256[],bytes[],string)' + ](...concatOpts(proposal.fullProposal, opts)); + } + + queue (opts = null) { + const proposal = this.currentProposal; + + return proposal.useCompatibilityInterface + ? this.governor.methods['queue(uint256)'](...concatOpts( + [ proposal.id ], + opts, + )) + : this.governor.methods['queue(address[],uint256[],bytes[],bytes32)'](...concatOpts( + proposal.shortProposal, + opts, + )); + } + + execute (opts = null) { + const proposal = this.currentProposal; + + return proposal.useCompatibilityInterface + ? this.governor.methods['execute(uint256)'](...concatOpts( + [ proposal.id ], + opts, + )) + : this.governor.methods['execute(address[],uint256[],bytes[],bytes32)'](...concatOpts( + proposal.shortProposal, + opts, + )); + } + + cancel (opts = null) { + const proposal = this.currentProposal; + + return proposal.useCompatibilityInterface + ? this.governor.methods['cancel(uint256)'](...concatOpts( + [ proposal.id ], + opts, + )) + : this.governor.methods['cancel(address[],uint256[],bytes[],bytes32)'](...concatOpts( + proposal.shortProposal, + opts, + )); + } + + vote (vote = {}, opts = null) { + const proposal = this.currentProposal; + + return vote.signature + // if signature, and either params or reason → + ? vote.params || vote.reason + ? vote.signature({ + proposalId: proposal.id, + support: vote.support, + reason: vote.reason || '', + params: vote.params || '', + }).then(({ v, r, s }) => this.governor.castVoteWithReasonAndParamsBySig(...concatOpts( + [ proposal.id, vote.support, vote.reason || '', vote.params || '', v, r, s ], + opts, + ))) + : vote.signature({ + proposalId: proposal.id, + support: vote.support, + }).then(({ v, r, s }) => this.governor.castVoteBySig(...concatOpts( + [ proposal.id, vote.support, v, r, s ], + opts, + ))) + : vote.params + // otherwize if params + ? this.governor.castVoteWithReasonAndParams(...concatOpts( + [ proposal.id, vote.support, vote.reason || '', vote.params ], + opts, + )) + : vote.reason + // otherwize if reason + ? this.governor.castVoteWithReason(...concatOpts( + [ proposal.id, vote.support, vote.reason ], + opts, + )) + : this.governor.castVote(...concatOpts( + [ proposal.id, vote.support ], + opts, + )); + } + + waitForSnapshot (offset = 0) { + const proposal = this.currentProposal; + return this.governor.proposalSnapshot(proposal.id) + .then(blockNumber => time.advanceBlockTo(blockNumber.addn(offset))); + } + + waitForDeadline (offset = 0) { + const proposal = this.currentProposal; + return this.governor.proposalDeadline(proposal.id) + .then(blockNumber => time.advanceBlockTo(blockNumber.addn(offset))); + } + + waitForEta (offset = 0) { + const proposal = this.currentProposal; + return this.governor.proposalEta(proposal.id) + .then(timestamp => time.increaseTo(timestamp.addn(offset))); + } + + /** + * Specify a proposal either as + * 1) an array of objects [{ target, value, data, signature? }] + * 2) an object of arrays { targets: [], values: [], data: [], signatures?: [] } + */ + setProposal (actions, description) { + let targets, values, signatures, data, useCompatibilityInterface; + + if (Array.isArray(actions)) { + useCompatibilityInterface = actions.some(a => 'signature' in a); + targets = actions.map(a => a.target); + values = actions.map(a => a.value || '0'); + signatures = actions.map(a => a.signature || ''); + data = actions.map(a => a.data || '0x'); + } else { + useCompatibilityInterface = Array.isArray(actions.signatures); + ({ targets, values, signatures = [], data } = actions); + } + + const fulldata = zip(signatures.map(s => s && web3.eth.abi.encodeFunctionSignature(s)), data) + .map(hexs => concatHex(...hexs)); + + const descriptionHash = web3.utils.keccak256(description); + + // condensed version for queing end executing + const shortProposal = [ + targets, + values, + fulldata, + descriptionHash, + ]; + + // full version for proposing + const fullProposal = [ + targets, + values, + ...(useCompatibilityInterface ? [ signatures ] : []), + data, + description, + ]; + + // proposal id + const id = web3.utils.toBN(web3.utils.keccak256(web3.eth.abi.encodeParameters( + [ 'address[]', 'uint256[]', 'bytes[]', 'bytes32' ], + shortProposal, + ))); + + this.currentProposal = { + id, + targets, + values, + signatures, + data, + fulldata, + description, + descriptionHash, + shortProposal, + fullProposal, + useCompatibilityInterface, + }; + + return this.currentProposal; + } +} + +module.exports = { + GovernorHelper, +}; diff --git a/test/utils/introspection/SupportsInterface.behavior.js b/test/utils/introspection/SupportsInterface.behavior.js index a0aa3d7e5..78e327248 100644 --- a/test/utils/introspection/SupportsInterface.behavior.js +++ b/test/utils/introspection/SupportsInterface.behavior.js @@ -112,34 +112,33 @@ for (const k of Object.getOwnPropertyNames(INTERFACES)) { } function shouldSupportInterfaces (interfaces = []) { - describe('Contract interface', function () { + describe('ERC165', function () { beforeEach(function () { this.contractUnderTest = this.mock || this.token || this.holder || this.accessControl; }); - for (const k of interfaces) { - const interfaceId = INTERFACE_IDS[k]; - describe(k, function () { - describe('ERC165\'s supportsInterface(bytes4)', function () { - it('uses less than 30k gas', async function () { - expect(await this.contractUnderTest.supportsInterface.estimateGas(interfaceId)).to.be.lte(30000); - }); + it('supportsInterface uses less than 30k gas', async function () { + for (const k of interfaces) { + const interfaceId = INTERFACE_IDS[k]; + expect(await this.contractUnderTest.supportsInterface.estimateGas(interfaceId)).to.be.lte(30000); + } + }); - it('claims support', async function () { - expect(await this.contractUnderTest.supportsInterface(interfaceId)).to.equal(true); - }); - }); + it('all interfaces are reported as supported', async function () { + for (const k of interfaces) { + const interfaceId = INTERFACE_IDS[k]; + expect(await this.contractUnderTest.supportsInterface(interfaceId)).to.equal(true); + } + }); + it('all interface functions are in ABI', async function () { + for (const k of interfaces) { for (const fnName of INTERFACES[k]) { const fnSig = FN_SIGNATURES[fnName]; - describe(fnName, function () { - it('has to be implemented', function () { - expect(this.contractUnderTest.abi.filter(fn => fn.signature === fnSig).length).to.equal(1); - }); - }); + expect(this.contractUnderTest.abi.filter(fn => fn.signature === fnSig).length).to.equal(1); } - }); - } + } + }); }); } From 52eeebecda140ebaf4ec8752ed119d8288287fac Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 14 Mar 2022 12:54:08 +0100 Subject: [PATCH 13/81] spelling fix --- contracts/proxy/README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/proxy/README.adoc b/contracts/proxy/README.adoc index 9f37b267f..3112c6950 100644 --- a/contracts/proxy/README.adoc +++ b/contracts/proxy/README.adoc @@ -23,7 +23,7 @@ CAUTION: Using upgradeable proxies correctly and securely is a difficult task th A different family of proxies are beacon proxies. This pattern, popularized by Dharma, allows multiple proxies to be upgraded to a different implementation in a single transaction. -- {BeaconProxy}: A proxy that retreives its implementation from a beacon contract. +- {BeaconProxy}: A proxy that retrieves its implementation from a beacon contract. - {UpgradeableBeacon}: A beacon contract with a built in admin that can upgrade the {BeaconProxy} pointing to it. In this pattern, the proxy contract doesn't hold the implementation address in storage like an ERC1967 proxy, instead the address is stored in a separate beacon contract. The `upgrade` operations that are sent to the beacon instead of to the proxy contract, and all proxies that follow that beacon are automatically upgraded. From 98716177aef0eab8a77a999c2c9c4d1dc0728411 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 22 Mar 2022 09:55:49 +0100 Subject: [PATCH 14/81] Inherit ERC20Wrapper decimals from the underlying (#3259) --- contracts/mocks/ERC20DecimalsMock.sol | 8 ++++++++ .../token/ERC20/extensions/ERC20Wrapper.sol | 11 +++++++++++ .../token/ERC20/extensions/ERC20Wrapper.test.js | 17 +++++++++++++---- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/contracts/mocks/ERC20DecimalsMock.sol b/contracts/mocks/ERC20DecimalsMock.sol index 924c3af31..1374cbc52 100644 --- a/contracts/mocks/ERC20DecimalsMock.sol +++ b/contracts/mocks/ERC20DecimalsMock.sol @@ -18,4 +18,12 @@ contract ERC20DecimalsMock is ERC20 { function decimals() public view virtual override returns (uint8) { return _decimals; } + + function mint(address account, uint256 amount) public { + _mint(account, amount); + } + + function burn(address account, uint256 amount) public { + _burn(account, amount); + } } diff --git a/contracts/token/ERC20/extensions/ERC20Wrapper.sol b/contracts/token/ERC20/extensions/ERC20Wrapper.sol index 32a3b830a..c6dd0184a 100644 --- a/contracts/token/ERC20/extensions/ERC20Wrapper.sol +++ b/contracts/token/ERC20/extensions/ERC20Wrapper.sol @@ -22,6 +22,17 @@ abstract contract ERC20Wrapper is ERC20 { underlying = underlyingToken; } + /** + * @dev See {ERC20-decimals}. + */ + function decimals() public view virtual override returns (uint8) { + try IERC20Metadata(address(underlying)).decimals() returns (uint8 value) { + return value; + } catch { + return super.decimals(); + } + } + /** * @dev Allow a user to deposit underlying tokens and mint the corresponding number of wrapped tokens. */ diff --git a/test/token/ERC20/extensions/ERC20Wrapper.test.js b/test/token/ERC20/extensions/ERC20Wrapper.test.js index ec074e1b8..ceb813e08 100644 --- a/test/token/ERC20/extensions/ERC20Wrapper.test.js +++ b/test/token/ERC20/extensions/ERC20Wrapper.test.js @@ -4,7 +4,8 @@ const { ZERO_ADDRESS, MAX_UINT256 } = constants; const { shouldBehaveLikeERC20 } = require('../ERC20.behavior'); -const ERC20Mock = artifacts.require('ERC20Mock'); +const NotAnERC20 = artifacts.require('CallReceiverMock'); +const ERC20Mock = artifacts.require('ERC20DecimalsMock'); const ERC20WrapperMock = artifacts.require('ERC20WrapperMock'); contract('ERC20', function (accounts) { @@ -16,8 +17,10 @@ contract('ERC20', function (accounts) { const initialSupply = new BN(100); beforeEach(async function () { - this.underlying = await ERC20Mock.new(name, symbol, initialHolder, initialSupply); + this.underlying = await ERC20Mock.new(name, symbol, 9); this.token = await ERC20WrapperMock.new(this.underlying.address, `Wrapped ${name}`, `W${symbol}`); + + await this.underlying.mint(initialHolder, initialSupply); }); afterEach(async function () { @@ -32,8 +35,14 @@ contract('ERC20', function (accounts) { expect(await this.token.symbol()).to.equal(`W${symbol}`); }); - it('has 18 decimals', async function () { - expect(await this.token.decimals()).to.be.bignumber.equal('18'); + it('has the same decimals as the underlying token', async function () { + expect(await this.token.decimals()).to.be.bignumber.equal('9'); + }); + + it('decimals default back to 18 if token has no metadata', async function () { + const noDecimals = await NotAnERC20.new(); + const otherToken = await ERC20WrapperMock.new(noDecimals.address, `Wrapped ${name}`, `W${symbol}`); + expect(await otherToken.decimals()).to.be.bignumber.equal('18'); }); it('has underlying', async function () { From c028c56965c5e92349a9d48addce90b2ba085833 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 22 Mar 2022 16:11:20 +0100 Subject: [PATCH 15/81] Add changelog entry for #3259 (#3281) * improve wrapper decimal support * Update test/token/ERC20/extensions/ERC20Wrapper.test.js Co-authored-by: Francisco Giordano * add changelog entry Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a64abe503..2c5d150f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) * `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196)) + * `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259)) ### Breaking changes From b13bdb02492cca68091d56c31072b60f10e6142e Mon Sep 17 00:00:00 2001 From: Wias Liaw Date: Tue, 22 Mar 2022 23:36:29 +0800 Subject: [PATCH 16/81] Add bytes32 to bytes32 enumerable map (#3192) * feat(enumerablemap): add bytes32 to bytes32 map * chore(changelog): edit CHANGELOG * feat(enumerable map): edit struct visibility --- CHANGELOG.md | 1 + contracts/mocks/EnumerableMapMock.sol | 46 +++++ contracts/utils/structs/EnumerableMap.sol | 81 ++++---- test/utils/structs/EnumerableMap.behavior.js | 181 ++++++++++++++++++ test/utils/structs/EnumerableMap.test.js | 58 ++++++ .../EnumerableMap/AddressToUintMap.test.js | 157 --------------- .../EnumerableMap/UintToAddressMap.test.js | 157 --------------- test/utils/structs/EnumerableMap/helpers.js | 31 --- 8 files changed, 334 insertions(+), 378 deletions(-) create mode 100644 test/utils/structs/EnumerableMap.behavior.js create mode 100644 test/utils/structs/EnumerableMap.test.js delete mode 100644 test/utils/structs/EnumerableMap/AddressToUintMap.test.js delete mode 100644 test/utils/structs/EnumerableMap/UintToAddressMap.test.js delete mode 100644 test/utils/structs/EnumerableMap/helpers.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c5d150f6..3144e2063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * `AccessControl`: add a virtual `_checkRole(bytes32)` function that can be overridden to alter the `onlyRole` modifier behavior. ([#3137](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3137)) * `EnumerableMap`: add new `AddressToUintMap` map type. ([#3150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3150)) + * `EnumerableMap`: add new `Bytes32ToBytes32Map` map type. ([#3192](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3192)) * `ERC1155`: Add a `_afterTokenTransfer` hook for improved extensibility. ([#3166](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3166)) * `DoubleEndedQueue`: a new data structure that supports efficient push and pop to both front and back, useful for FIFO and LIFO queues. ([#3153](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3153)) * `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147)) diff --git a/contracts/mocks/EnumerableMapMock.sol b/contracts/mocks/EnumerableMapMock.sol index 21c1fe362..7cecd0d60 100644 --- a/contracts/mocks/EnumerableMapMock.sol +++ b/contracts/mocks/EnumerableMapMock.sol @@ -84,4 +84,50 @@ contract AddressToUintMapMock { function get(address key) public view returns (uint256) { return _map.get(key); } + + function getWithMessage(address key, string calldata errorMessage) public view returns (uint256) { + return _map.get(key, errorMessage); + } +} + +contract Bytes32ToBytes32MapMock { + using EnumerableMap for EnumerableMap.Bytes32ToBytes32Map; + + event OperationResult(bool result); + + EnumerableMap.Bytes32ToBytes32Map private _map; + + function contains(bytes32 key) public view returns (bool) { + return _map.contains(key); + } + + function set(bytes32 key, bytes32 value) public { + bool result = _map.set(key, value); + emit OperationResult(result); + } + + function remove(bytes32 key) public { + bool result = _map.remove(key); + emit OperationResult(result); + } + + function length() public view returns (uint256) { + return _map.length(); + } + + function at(uint256 index) public view returns (bytes32 key, bytes32 value) { + return _map.at(index); + } + + function tryGet(bytes32 key) public view returns (bool, bytes32) { + return _map.tryGet(key); + } + + function get(bytes32 key) public view returns (bytes32) { + return _map.get(key); + } + + function getWithMessage(bytes32 key, string calldata errorMessage) public view returns (bytes32) { + return _map.get(key, errorMessage); + } } diff --git a/contracts/utils/structs/EnumerableMap.sol b/contracts/utils/structs/EnumerableMap.sol index 1c3f4357e..8717c6978 100644 --- a/contracts/utils/structs/EnumerableMap.sol +++ b/contracts/utils/structs/EnumerableMap.sol @@ -30,6 +30,7 @@ import "./EnumerableSet.sol"; * * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0 + * - `bytes32 -> bytes32` (`Bytes32ToBytes32`) since v4.6.0 */ library EnumerableMap { using EnumerableSet for EnumerableSet.Bytes32Set; @@ -43,7 +44,7 @@ library EnumerableMap { // This means that we can only create new EnumerableMaps for types that fit // in bytes32. - struct Map { + struct Bytes32ToBytes32Map { // Storage of keys EnumerableSet.Bytes32Set _keys; mapping(bytes32 => bytes32) _values; @@ -56,11 +57,11 @@ library EnumerableMap { * Returns true if the key was added to the map, that is if it was not * already present. */ - function _set( - Map storage map, + function set( + Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value - ) private returns (bool) { + ) internal returns (bool) { map._values[key] = value; return map._keys.add(key); } @@ -70,7 +71,7 @@ library EnumerableMap { * * Returns true if the key was removed from the map, that is if it was present. */ - function _remove(Map storage map, bytes32 key) private returns (bool) { + function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) { delete map._values[key]; return map._keys.remove(key); } @@ -78,14 +79,14 @@ library EnumerableMap { /** * @dev Returns true if the key is in the map. O(1). */ - function _contains(Map storage map, bytes32 key) private view returns (bool) { + function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) { return map._keys.contains(key); } /** * @dev Returns the number of key-value pairs in the map. O(1). */ - function _length(Map storage map) private view returns (uint256) { + function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) { return map._keys.length(); } @@ -99,7 +100,7 @@ library EnumerableMap { * * - `index` must be strictly less than {length}. */ - function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) { + function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) { bytes32 key = map._keys.at(index); return (key, map._values[key]); } @@ -108,10 +109,10 @@ library EnumerableMap { * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. */ - function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) { + function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) { bytes32 value = map._values[key]; if (value == bytes32(0)) { - return (_contains(map, key), bytes32(0)); + return (contains(map, key), bytes32(0)); } else { return (true, value); } @@ -124,9 +125,9 @@ library EnumerableMap { * * - `key` must be in the map. */ - function _get(Map storage map, bytes32 key) private view returns (bytes32) { + function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) { bytes32 value = map._values[key]; - require(value != 0 || _contains(map, key), "EnumerableMap: nonexistent key"); + require(value != 0 || contains(map, key), "EnumerableMap: nonexistent key"); return value; } @@ -136,20 +137,20 @@ library EnumerableMap { * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {_tryGet}. */ - function _get( - Map storage map, + function get( + Bytes32ToBytes32Map storage map, bytes32 key, string memory errorMessage - ) private view returns (bytes32) { + ) internal view returns (bytes32) { bytes32 value = map._values[key]; - require(value != 0 || _contains(map, key), errorMessage); + require(value != 0 || contains(map, key), errorMessage); return value; } // UintToAddressMap struct UintToAddressMap { - Map _inner; + Bytes32ToBytes32Map _inner; } /** @@ -164,7 +165,7 @@ library EnumerableMap { uint256 key, address value ) internal returns (bool) { - return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value)))); + return set(map._inner, bytes32(key), bytes32(uint256(uint160(value)))); } /** @@ -173,21 +174,21 @@ library EnumerableMap { * Returns true if the key was removed from the map, that is if it was present. */ function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) { - return _remove(map._inner, bytes32(key)); + return remove(map._inner, bytes32(key)); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) { - return _contains(map._inner, bytes32(key)); + return contains(map._inner, bytes32(key)); } /** * @dev Returns the number of elements in the map. O(1). */ function length(UintToAddressMap storage map) internal view returns (uint256) { - return _length(map._inner); + return length(map._inner); } /** @@ -200,7 +201,7 @@ library EnumerableMap { * - `index` must be strictly less than {length}. */ function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) { - (bytes32 key, bytes32 value) = _at(map._inner, index); + (bytes32 key, bytes32 value) = at(map._inner, index); return (uint256(key), address(uint160(uint256(value)))); } @@ -211,7 +212,7 @@ library EnumerableMap { * _Available since v3.4._ */ function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) { - (bool success, bytes32 value) = _tryGet(map._inner, bytes32(key)); + (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); return (success, address(uint160(uint256(value)))); } @@ -223,7 +224,7 @@ library EnumerableMap { * - `key` must be in the map. */ function get(UintToAddressMap storage map, uint256 key) internal view returns (address) { - return address(uint160(uint256(_get(map._inner, bytes32(key))))); + return address(uint160(uint256(get(map._inner, bytes32(key))))); } /** @@ -237,13 +238,13 @@ library EnumerableMap { uint256 key, string memory errorMessage ) internal view returns (address) { - return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage)))); + return address(uint160(uint256(get(map._inner, bytes32(key), errorMessage)))); } // AddressToUintMap struct AddressToUintMap { - Map _inner; + Bytes32ToBytes32Map _inner; } /** @@ -258,7 +259,7 @@ library EnumerableMap { address key, uint256 value ) internal returns (bool) { - return _set(map._inner, bytes32(uint256(uint160(key))), bytes32(value)); + return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value)); } /** @@ -267,21 +268,21 @@ library EnumerableMap { * Returns true if the key was removed from the map, that is if it was present. */ function remove(AddressToUintMap storage map, address key) internal returns (bool) { - return _remove(map._inner, bytes32(uint256(uint160(key)))); + return remove(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns true if the key is in the map. O(1). */ function contains(AddressToUintMap storage map, address key) internal view returns (bool) { - return _contains(map._inner, bytes32(uint256(uint160(key)))); + return contains(map._inner, bytes32(uint256(uint160(key)))); } /** * @dev Returns the number of elements in the map. O(1). */ function length(AddressToUintMap storage map) internal view returns (uint256) { - return _length(map._inner); + return length(map._inner); } /** @@ -294,7 +295,7 @@ library EnumerableMap { * - `index` must be strictly less than {length}. */ function at(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) { - (bytes32 key, bytes32 value) = _at(map._inner, index); + (bytes32 key, bytes32 value) = at(map._inner, index); return (address(uint160(uint256(key))), uint256(value)); } @@ -305,7 +306,7 @@ library EnumerableMap { * _Available since v3.4._ */ function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) { - (bool success, bytes32 value) = _tryGet(map._inner, bytes32(uint256(uint160(key)))); + (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key)))); return (success, uint256(value)); } @@ -317,6 +318,20 @@ library EnumerableMap { * - `key` must be in the map. */ function get(AddressToUintMap storage map, address key) internal view returns (uint256) { - return uint256(_get(map._inner, bytes32(uint256(uint160(key))))); + return uint256(get(map._inner, bytes32(uint256(uint160(key))))); + } + + /** + * @dev Same as {get}, with a custom error message when `key` is not in the map. + * + * CAUTION: This function is deprecated because it requires allocating memory for the error + * message unnecessarily. For custom revert reasons use {tryGet}. + */ + function get( + AddressToUintMap storage map, + address key, + string memory errorMessage + ) internal view returns (uint256) { + return uint256(get(map._inner, bytes32(uint256(uint160(key))), errorMessage)); } } diff --git a/test/utils/structs/EnumerableMap.behavior.js b/test/utils/structs/EnumerableMap.behavior.js new file mode 100644 index 000000000..b1d0d0dce --- /dev/null +++ b/test/utils/structs/EnumerableMap.behavior.js @@ -0,0 +1,181 @@ +const { expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); +const { expect } = require('chai'); + +const zip = require('lodash.zip'); + +function shouldBehaveLikeMap (keys, values, zeroValue) { + const [keyA, keyB, keyC] = keys; + const [valueA, valueB, valueC] = values; + + async function expectMembersMatch (map, keys, values) { + expect(keys.length).to.equal(values.length); + + await Promise.all(keys.map(async key => + expect(await map.contains(key)).to.equal(true), + )); + + expect(await map.length()).to.bignumber.equal(keys.length.toString()); + + expect( + (await Promise.all(keys.map(key => map.get(key)))).map(k => k.toString()), + ).to.have.same.members( + values.map(value => value.toString()), + ); + + // To compare key-value pairs, we zip keys and values, and convert BNs to + // strings to workaround Chai limitations when dealing with nested arrays + expect(await Promise.all([...Array(keys.length).keys()].map(async (index) => { + const entry = await map.at(index); + return [entry.key.toString(), entry.value.toString()]; + }))).to.have.same.deep.members( + zip(keys.map(k => k.toString()), values.map(v => v.toString())), + ); + } + + it('starts empty', async function () { + expect(await this.map.contains(keyA)).to.equal(false); + + await expectMembersMatch(this.map, [], []); + }); + + describe('set', function () { + it('adds a key', async function () { + const receipt = await this.map.set(keyA, valueA); + expectEvent(receipt, 'OperationResult', { result: true }); + + await expectMembersMatch(this.map, [keyA], [valueA]); + }); + + it('adds several keys', async function () { + await this.map.set(keyA, valueA); + await this.map.set(keyB, valueB); + + await expectMembersMatch(this.map, [keyA, keyB], [valueA, valueB]); + expect(await this.map.contains(keyC)).to.equal(false); + }); + + it('returns false when adding keys already in the set', async function () { + await this.map.set(keyA, valueA); + + const receipt = (await this.map.set(keyA, valueA)); + expectEvent(receipt, 'OperationResult', { result: false }); + + await expectMembersMatch(this.map, [keyA], [valueA]); + }); + + it('updates values for keys already in the set', async function () { + await this.map.set(keyA, valueA); + + await this.map.set(keyA, valueB); + + await expectMembersMatch(this.map, [keyA], [valueB]); + }); + }); + + describe('remove', function () { + it('removes added keys', async function () { + await this.map.set(keyA, valueA); + + const receipt = await this.map.remove(keyA); + expectEvent(receipt, 'OperationResult', { result: true }); + + expect(await this.map.contains(keyA)).to.equal(false); + await expectMembersMatch(this.map, [], []); + }); + + it('returns false when removing keys not in the set', async function () { + const receipt = await this.map.remove(keyA); + expectEvent(receipt, 'OperationResult', { result: false }); + + expect(await this.map.contains(keyA)).to.equal(false); + }); + + it('adds and removes multiple keys', async function () { + // [] + + await this.map.set(keyA, valueA); + await this.map.set(keyC, valueC); + + // [A, C] + + await this.map.remove(keyA); + await this.map.remove(keyB); + + // [C] + + await this.map.set(keyB, valueB); + + // [C, B] + + await this.map.set(keyA, valueA); + await this.map.remove(keyC); + + // [A, B] + + await this.map.set(keyA, valueA); + await this.map.set(keyB, valueB); + + // [A, B] + + await this.map.set(keyC, valueC); + await this.map.remove(keyA); + + // [B, C] + + await this.map.set(keyA, valueA); + await this.map.remove(keyB); + + // [A, C] + + await expectMembersMatch(this.map, [keyA, keyC], [valueA, valueC]); + + expect(await this.map.contains(keyB)).to.equal(false); + }); + }); + + describe('read', function () { + beforeEach(async function () { + await this.map.set(keyA, valueA); + }); + + describe('get', function () { + it('existing value', async function () { + expect( + (await this.map.get(keyA)).toString(), + ).to.be.equal(valueA.toString()); + }); + it('missing value', async function () { + await expectRevert(this.map.get(keyB), 'EnumerableMap: nonexistent key'); + }); + }); + + describe('get with message', function () { + it('existing value', async function () { + expect( + (await this.map.getWithMessage(keyA, 'custom error string')) + .toString(), + ).to.be.equal(valueA.toString()); + }); + it('missing value', async function () { + await expectRevert(this.map.getWithMessage(keyB, 'custom error string'), 'custom error string'); + }); + }); + + describe('tryGet', function () { + it('existing value', async function () { + const result = await this.map.tryGet(keyA); + expect(result['0']).to.be.equal(true); + expect(result['1'].toString()).to.be.equal(valueA.toString()); + }); + it('missing value', async function () { + const result = await this.map.tryGet(keyB); + expect(result['0']).to.be.equal(false); + expect(result['1'].toString()).to.be.equal(zeroValue.toString()); + }); + }); + }); +} + +module.exports = { + shouldBehaveLikeMap, +}; diff --git a/test/utils/structs/EnumerableMap.test.js b/test/utils/structs/EnumerableMap.test.js new file mode 100644 index 000000000..866ff6439 --- /dev/null +++ b/test/utils/structs/EnumerableMap.test.js @@ -0,0 +1,58 @@ +const { BN, constants } = require('@openzeppelin/test-helpers'); + +const AddressToUintMapMock = artifacts.require('AddressToUintMapMock'); +const UintToAddressMapMock = artifacts.require('UintToAddressMapMock'); +const Bytes32ToBytes32MapMock = artifacts.require('Bytes32ToBytes32MapMock'); + +const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); + +contract('EnumerableMap', function (accounts) { + const [ accountA, accountB, accountC ] = accounts; + + const keyA = new BN('7891'); + const keyB = new BN('451'); + const keyC = new BN('9592328'); + + const bytesA = '0xdeadbeef'.padEnd(66, '0'); + const bytesB = '0x0123456789'.padEnd(66, '0'); + const bytesC = '0x42424242'.padEnd(66, '0'); + + // AddressToUintMap + describe('AddressToUintMap', function () { + beforeEach(async function () { + this.map = await AddressToUintMapMock.new(); + }); + + shouldBehaveLikeMap( + [accountA, accountB, accountC], + [keyA, keyB, keyC], + new BN('0'), + ); + }); + + // UintToAddressMap + describe('UintToAddressMap', function () { + beforeEach(async function () { + this.map = await UintToAddressMapMock.new(); + }); + + shouldBehaveLikeMap( + [keyA, keyB, keyC], + [accountA, accountB, accountC], + constants.ZERO_ADDRESS, + ); + }); + + // Bytes32ToBytes32Map + describe('Bytes32ToBytes32Map', function () { + beforeEach(async function () { + this.map = await Bytes32ToBytes32MapMock.new(); + }); + + shouldBehaveLikeMap( + [keyA, keyB, keyC].map(k => ('0x' + k.toString(16)).padEnd(66, '0')), + [bytesA, bytesB, bytesC], + constants.ZERO_BYTES32, + ); + }); +}); diff --git a/test/utils/structs/EnumerableMap/AddressToUintMap.test.js b/test/utils/structs/EnumerableMap/AddressToUintMap.test.js deleted file mode 100644 index 0a7947932..000000000 --- a/test/utils/structs/EnumerableMap/AddressToUintMap.test.js +++ /dev/null @@ -1,157 +0,0 @@ -const { BN, expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); -const { expect } = require('chai'); -const { expectMembersMatch } = require('./helpers'); - -const AddressToUintMapMock = artifacts.require('AddressToUintMapMock'); - -contract('AddressToUintMap', function (accounts) { - const [accountA, accountB, accountC] = accounts; - - const valueA = new BN('7891'); - const valueB = new BN('451'); - const valueC = new BN('9592328'); - - beforeEach(async function () { - this.map = await AddressToUintMapMock.new(); - }); - - it('starts empty', async function () { - expect(await this.map.contains(accountA)).to.equal(false); - - await expectMembersMatch(this.map, [], []); - }); - - describe('set', function () { - it('adds a key', async function () { - const receipt = await this.map.set(accountA, valueA); - - expectEvent(receipt, 'OperationResult', { result: true }); - - await expectMembersMatch(this.map, [accountA], [valueA]); - }); - - it('adds several keys', async function () { - await this.map.set(accountA, valueA); - await this.map.set(accountB, valueB); - - await expectMembersMatch(this.map, [accountA, accountB], [valueA, valueB]); - - expect(await this.map.contains(accountC)).to.equal(false); - }); - - it('returns false when adding keys already in the set', async function () { - await this.map.set(accountA, valueA); - - const receipt = await this.map.set(accountA, valueA); - - expectEvent(receipt, 'OperationResult', { result: false }); - - await expectMembersMatch(this.map, [accountA], [valueA]); - }); - - it('updates values for keys already in the set', async function () { - await this.map.set(accountA, valueA); - await this.map.set(accountA, valueB); - - await expectMembersMatch(this.map, [accountA], [valueB]); - }); - }); - - describe('remove', function () { - it('removes added keys', async function () { - await this.map.set(accountA, valueA); - - const receipt = await this.map.remove(accountA); - - expectEvent(receipt, 'OperationResult', { result: true }); - - expect(await this.map.contains(accountA)).to.equal(false); - - await expectMembersMatch(this.map, [], []); - }); - - it('returns false when removing keys not in the set', async function () { - const receipt = await this.map.remove(accountA); - - expectEvent(receipt, 'OperationResult', { result: false }); - - expect(await this.map.contains(accountA)).to.equal(false); - }); - - it('adds and removes multiple keys', async function () { - // [] - - await this.map.set(accountA, valueA); - await this.map.set(accountC, valueC); - - // [A, C] - - await this.map.remove(accountA); - await this.map.remove(accountB); - - // [C] - - await this.map.set(accountB, valueB); - - // [C, B] - - await this.map.set(accountA, valueA); - await this.map.remove(accountC); - - // [A, B] - - await this.map.set(accountA, valueA); - await this.map.set(accountB, valueB); - - // [A, B] - - await this.map.set(accountC, valueC); - await this.map.remove(accountA); - - // [B, C] - - await this.map.set(accountA, valueA); - await this.map.remove(accountB); - - // [A, C] - - await expectMembersMatch(this.map, [accountA, accountC], [valueA, valueC]); - - expect(await this.map.contains(accountB)).to.equal(false); - }); - }); - - describe('read', function () { - beforeEach(async function () { - await this.map.set(accountA, valueA); - }); - - describe('get', function () { - it('existing value', async function () { - expect(await this.map.get(accountA)).to.bignumber.equal(valueA); - }); - - it('missing value', async function () { - await expectRevert(this.map.get(accountB), 'EnumerableMap: nonexistent key'); - }); - }); - - describe('tryGet', function () { - const stringifyTryGetValue = ({ 0: result, 1: value }) => ({ 0: result, 1: value.toString() }); - - it('existing value', async function () { - const actual = stringifyTryGetValue(await this.map.tryGet(accountA)); - const expected = stringifyTryGetValue({ 0: true, 1: valueA }); - - expect(actual).to.deep.equal(expected); - }); - - it('missing value', async function () { - const actual = stringifyTryGetValue(await this.map.tryGet(accountB)); - const expected = stringifyTryGetValue({ 0: false, 1: new BN('0') }); - - expect(actual).to.deep.equal(expected); - }); - }); - }); -}); diff --git a/test/utils/structs/EnumerableMap/UintToAddressMap.test.js b/test/utils/structs/EnumerableMap/UintToAddressMap.test.js deleted file mode 100644 index 560ed5077..000000000 --- a/test/utils/structs/EnumerableMap/UintToAddressMap.test.js +++ /dev/null @@ -1,157 +0,0 @@ -const { BN, constants, expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); -const { expect } = require('chai'); -const { expectMembersMatch } = require('./helpers'); - -const UintToAddressMapMock = artifacts.require('UintToAddressMapMock'); - -contract('UintToAddressMap', function (accounts) { - const [accountA, accountB, accountC] = accounts; - - const keyA = new BN('7891'); - const keyB = new BN('451'); - const keyC = new BN('9592328'); - - beforeEach(async function () { - this.map = await UintToAddressMapMock.new(); - }); - - it('starts empty', async function () { - expect(await this.map.contains(keyA)).to.equal(false); - - await expectMembersMatch(this.map, [], []); - }); - - describe('set', function () { - it('adds a key', async function () { - const receipt = await this.map.set(keyA, accountA); - expectEvent(receipt, 'OperationResult', { result: true }); - - await expectMembersMatch(this.map, [keyA], [accountA]); - }); - - it('adds several keys', async function () { - await this.map.set(keyA, accountA); - await this.map.set(keyB, accountB); - - await expectMembersMatch(this.map, [keyA, keyB], [accountA, accountB]); - expect(await this.map.contains(keyC)).to.equal(false); - }); - - it('returns false when adding keys already in the set', async function () { - await this.map.set(keyA, accountA); - - const receipt = await this.map.set(keyA, accountA); - expectEvent(receipt, 'OperationResult', { result: false }); - - await expectMembersMatch(this.map, [keyA], [accountA]); - }); - - it('updates values for keys already in the set', async function () { - await this.map.set(keyA, accountA); - - await this.map.set(keyA, accountB); - - await expectMembersMatch(this.map, [keyA], [accountB]); - }); - }); - - describe('remove', function () { - it('removes added keys', async function () { - await this.map.set(keyA, accountA); - - const receipt = await this.map.remove(keyA); - expectEvent(receipt, 'OperationResult', { result: true }); - - expect(await this.map.contains(keyA)).to.equal(false); - await expectMembersMatch(this.map, [], []); - }); - - it('returns false when removing keys not in the set', async function () { - const receipt = await this.map.remove(keyA); - expectEvent(receipt, 'OperationResult', { result: false }); - - expect(await this.map.contains(keyA)).to.equal(false); - }); - - it('adds and removes multiple keys', async function () { - // [] - - await this.map.set(keyA, accountA); - await this.map.set(keyC, accountC); - - // [A, C] - - await this.map.remove(keyA); - await this.map.remove(keyB); - - // [C] - - await this.map.set(keyB, accountB); - - // [C, B] - - await this.map.set(keyA, accountA); - await this.map.remove(keyC); - - // [A, B] - - await this.map.set(keyA, accountA); - await this.map.set(keyB, accountB); - - // [A, B] - - await this.map.set(keyC, accountC); - await this.map.remove(keyA); - - // [B, C] - - await this.map.set(keyA, accountA); - await this.map.remove(keyB); - - // [A, C] - - await expectMembersMatch(this.map, [keyA, keyC], [accountA, accountC]); - - expect(await this.map.contains(keyB)).to.equal(false); - }); - }); - - describe('read', function () { - beforeEach(async function () { - await this.map.set(keyA, accountA); - }); - - describe('get', function () { - it('existing value', async function () { - expect(await this.map.get(keyA)).to.be.equal(accountA); - }); - it('missing value', async function () { - await expectRevert(this.map.get(keyB), 'EnumerableMap: nonexistent key'); - }); - }); - - describe('get with message', function () { - it('existing value', async function () { - expect(await this.map.getWithMessage(keyA, 'custom error string')).to.be.equal(accountA); - }); - it('missing value', async function () { - await expectRevert(this.map.getWithMessage(keyB, 'custom error string'), 'custom error string'); - }); - }); - - describe('tryGet', function () { - it('existing value', async function () { - expect(await this.map.tryGet(keyA)).to.be.deep.equal({ - 0: true, - 1: accountA, - }); - }); - it('missing value', async function () { - expect(await this.map.tryGet(keyB)).to.be.deep.equal({ - 0: false, - 1: constants.ZERO_ADDRESS, - }); - }); - }); - }); -}); diff --git a/test/utils/structs/EnumerableMap/helpers.js b/test/utils/structs/EnumerableMap/helpers.js deleted file mode 100644 index 456cdf156..000000000 --- a/test/utils/structs/EnumerableMap/helpers.js +++ /dev/null @@ -1,31 +0,0 @@ -const zip = require('lodash.zip'); - -const toStringArray = (array) => array.map((i) => i.toString()); - -async function expectMembersMatch (map, keys, values) { - const stringKeys = toStringArray(keys); - const stringValues = toStringArray(values); - - expect(keys.length).to.equal(values.length); - - await Promise.all(keys.map(async (key) => expect(await map.contains(key)).to.equal(true))); - - expect(await map.length()).to.bignumber.equal(keys.length.toString()); - - expect(toStringArray(await Promise.all(keys.map((key) => map.get(key))))).to.have.same.members(stringValues); - - // to compare key-value pairs, we zip keys and values - // we also stringify pairs because this helper is used for multiple types of maps - expect( - await Promise.all( - [...Array(keys.length).keys()].map(async (index) => { - const { key, value } = await map.at(index); - return [key.toString(), value.toString()]; - }), - ), - ).to.have.same.deep.members(zip(stringKeys, stringValues)); -} - -module.exports = { - expectMembersMatch, -}; From 0eba5112c8f0a2e084fa69aacd8e282cf996365b Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 22 Mar 2022 19:06:29 +0100 Subject: [PATCH 17/81] Allow the re-initialization of contracts (#3232) * allow re-initialization of contracts * fix lint * use a private function to avoid code duplication * use oz-retyped-from syntax * add documentation * rephrase * documentation * Update contracts/proxy/utils/Initializable.sol Co-authored-by: Francisco Giordano * reinitialize test * lint * typos and style * add note about relation between initializer and reinitializer * lint * set _initializing in the modifier * remove unnecessary variable set * rename _preventInitialize -> _disableInitializers * rename preventInitialize -> disableInitializers * test nested reinitializers in reverse order * docs typos and style * edit docs for consistency between initializer and reinitializer Co-authored-by: Francisco Giordano --- contracts/mocks/InitializableMock.sol | 29 ++++++++ contracts/proxy/utils/Initializable.sol | 94 ++++++++++++++++++++----- test/proxy/utils/Initializable.test.js | 83 ++++++++++++++++++---- 3 files changed, 176 insertions(+), 30 deletions(-) diff --git a/contracts/mocks/InitializableMock.sol b/contracts/mocks/InitializableMock.sol index 630e8bbfa..bdf53991f 100644 --- a/contracts/mocks/InitializableMock.sol +++ b/contracts/mocks/InitializableMock.sol @@ -59,3 +59,32 @@ contract ConstructorInitializableMock is Initializable { onlyInitializingRan = true; } } + +contract ReinitializerMock is Initializable { + uint256 public counter; + + function initialize() public initializer { + doStuff(); + } + + function reinitialize(uint8 i) public reinitializer(i) { + doStuff(); + } + + function nestedReinitialize(uint8 i, uint8 j) public reinitializer(i) { + reinitialize(j); + } + + function chainReinitialize(uint8 i, uint8 j) public { + reinitialize(i); + reinitialize(j); + } + + function disableInitializers() public { + _disableInitializers(); + } + + function doStuff() public onlyInitializing { + counter++; + } +} diff --git a/contracts/proxy/utils/Initializable.sol b/contracts/proxy/utils/Initializable.sol index 1fe4583a2..e6b2a4423 100644 --- a/contracts/proxy/utils/Initializable.sol +++ b/contracts/proxy/utils/Initializable.sol @@ -11,6 +11,26 @@ import "../../utils/Address.sol"; * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * + * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be + * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in + * case an upgrade adds a module that needs to be initialized. + * + * For example: + * + * [.hljs-theme-light.nopadding] + * ``` + * contract MyToken is ERC20Upgradeable { + * function initialize() initializer public { + * __ERC20_init("MyToken", "MTK"); + * } + * } + * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { + * function initializeV2() reinitializer(2) public { + * __ERC20Permit_init("MyToken"); + * } + * } + * ``` + * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * @@ -22,21 +42,24 @@ import "../../utils/Address.sol"; * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation - * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the - * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: + * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke + * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor - * constructor() initializer {} + * constructor() { + * _disableInitializers(); + * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. + * @custom:oz-retyped-from bool */ - bool private _initialized; + uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. @@ -44,22 +67,38 @@ abstract contract Initializable { bool private _initializing; /** - * @dev Modifier to protect an initializer function from being invoked twice. + * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, + * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { - // If the contract is initializing we ignore whether _initialized is set in order to support multiple - // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the - // contract may have been reentered. - require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); - - bool isTopLevelCall = !_initializing; + bool isTopLevelCall = _setInitializedVersion(1); if (isTopLevelCall) { _initializing = true; - _initialized = true; } - _; + if (isTopLevelCall) { + _initializing = false; + } + } + /** + * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the + * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be + * used to initialize parent contracts. + * + * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original + * initialization step. This is essential to configure modules that are added through upgrades and that require + * initialization. + * + * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in + * a contract, executing them in the right order is up to the developer or operator. + */ + modifier reinitializer(uint8 version) { + bool isTopLevelCall = _setInitializedVersion(version); + if (isTopLevelCall) { + _initializing = true; + } + _; if (isTopLevelCall) { _initializing = false; } @@ -67,14 +106,37 @@ abstract contract Initializable { /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the - * {initializer} modifier, directly or indirectly. + * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } - function _isConstructor() private view returns (bool) { - return !Address.isContract(address(this)); + /** + * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. + * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized + * to any version. It is recommended to use this to lock implementation contracts that are designed to be called + * through proxies. + */ + function _disableInitializers() internal virtual { + _setInitializedVersion(type(uint8).max); + } + + function _setInitializedVersion(uint8 version) private returns (bool) { + // If the contract is initializing we ignore whether _initialized is set in order to support multiple + // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level + // of initializers, because in other contexts the contract may have been reentered. + if (_initializing) { + require( + version == 1 && !Address.isContract(address(this)), + "Initializable: contract is already initialized" + ); + return false; + } else { + require(_initialized < version, "Initializable: contract is already initialized"); + _initialized = version; + return true; + } } } diff --git a/test/proxy/utils/Initializable.test.js b/test/proxy/utils/Initializable.test.js index 04884a1d4..1efb72850 100644 --- a/test/proxy/utils/Initializable.test.js +++ b/test/proxy/utils/Initializable.test.js @@ -1,8 +1,9 @@ const { expectRevert } = require('@openzeppelin/test-helpers'); -const { assert } = require('chai'); +const { expect } = require('chai'); const InitializableMock = artifacts.require('InitializableMock'); const ConstructorInitializableMock = artifacts.require('ConstructorInitializableMock'); +const ReinitializerMock = artifacts.require('ReinitializerMock'); const SampleChild = artifacts.require('SampleChild'); contract('Initializable', function (accounts) { @@ -13,7 +14,7 @@ contract('Initializable', function (accounts) { context('before initialize', function () { it('initializer has not run', async function () { - assert.isFalse(await this.contract.initializerRan()); + expect(await this.contract.initializerRan()).to.equal(false); }); }); @@ -23,7 +24,7 @@ contract('Initializable', function (accounts) { }); it('initializer has run', async function () { - assert.isTrue(await this.contract.initializerRan()); + expect(await this.contract.initializerRan()).to.equal(true); }); it('initializer does not run again', async function () { @@ -38,7 +39,7 @@ contract('Initializable', function (accounts) { it('onlyInitializing modifier succeeds', async function () { await this.contract.onlyInitializingNested(); - assert.isTrue(await this.contract.onlyInitializingRan()); + expect(await this.contract.onlyInitializingRan()).to.equal(true); }); }); @@ -49,15 +50,69 @@ contract('Initializable', function (accounts) { it('nested initializer can run during construction', async function () { const contract2 = await ConstructorInitializableMock.new(); - assert.isTrue(await contract2.initializerRan()); - assert.isTrue(await contract2.onlyInitializingRan()); + expect(await contract2.initializerRan()).to.equal(true); + expect(await contract2.onlyInitializingRan()).to.equal(true); + }); + + describe('reinitialization', function () { + beforeEach('deploying', async function () { + this.contract = await ReinitializerMock.new(); + }); + + it('can reinitialize', async function () { + expect(await this.contract.counter()).to.be.bignumber.equal('0'); + await this.contract.initialize(); + expect(await this.contract.counter()).to.be.bignumber.equal('1'); + await this.contract.reinitialize(2); + expect(await this.contract.counter()).to.be.bignumber.equal('2'); + await this.contract.reinitialize(3); + expect(await this.contract.counter()).to.be.bignumber.equal('3'); + }); + + it('can jump multiple steps', async function () { + expect(await this.contract.counter()).to.be.bignumber.equal('0'); + await this.contract.initialize(); + expect(await this.contract.counter()).to.be.bignumber.equal('1'); + await this.contract.reinitialize(128); + expect(await this.contract.counter()).to.be.bignumber.equal('2'); + }); + + it('cannot nest reinitializers', async function () { + expect(await this.contract.counter()).to.be.bignumber.equal('0'); + await expectRevert(this.contract.nestedReinitialize(2, 3), 'Initializable: contract is already initialized'); + await expectRevert(this.contract.nestedReinitialize(3, 2), 'Initializable: contract is already initialized'); + }); + + it('can chain reinitializers', async function () { + expect(await this.contract.counter()).to.be.bignumber.equal('0'); + await this.contract.chainReinitialize(2, 3); + expect(await this.contract.counter()).to.be.bignumber.equal('2'); + }); + + describe('contract locking', function () { + it('prevents initialization', async function () { + await this.contract.disableInitializers(); + await expectRevert(this.contract.initialize(), 'Initializable: contract is already initialized'); + }); + + it('prevents re-initialization', async function () { + await this.contract.disableInitializers(); + await expectRevert(this.contract.reinitialize(255), 'Initializable: contract is already initialized'); + }); + + it('can lock contract after initialization', async function () { + await this.contract.initialize(); + await this.contract.disableInitializers(); + await expectRevert(this.contract.reinitialize(255), 'Initializable: contract is already initialized'); + }); + }); }); describe('complex testing with inheritance', function () { - const mother = 12; + const mother = '12'; const gramps = '56'; - const father = 34; - const child = 78; + const father = '34'; + const child = '78'; beforeEach('deploying', async function () { this.contract = await SampleChild.new(); @@ -68,23 +123,23 @@ contract('Initializable', function (accounts) { }); it('initializes human', async function () { - assert.equal(await this.contract.isHuman(), true); + expect(await this.contract.isHuman()).to.be.equal(true); }); it('initializes mother', async function () { - assert.equal(await this.contract.mother(), mother); + expect(await this.contract.mother()).to.be.bignumber.equal(mother); }); it('initializes gramps', async function () { - assert.equal(await this.contract.gramps(), gramps); + expect(await this.contract.gramps()).to.be.bignumber.equal(gramps); }); it('initializes father', async function () { - assert.equal(await this.contract.father(), father); + expect(await this.contract.father()).to.be.bignumber.equal(father); }); it('initializes child', async function () { - assert.equal(await this.contract.child(), child); + expect(await this.contract.child()).to.be.bignumber.equal(child); }); }); }); From faf5820f0331c59c93b0dca3e08f3456c94d8982 Mon Sep 17 00:00:00 2001 From: Pandapip1 <45835846+Pandapip1@users.noreply.github.com> Date: Tue, 22 Mar 2022 17:16:20 -0400 Subject: [PATCH 18/81] Fix many spelling errors (#3274) --- CHANGELOG.md | 2 +- audit/2017-03.md | 2 +- certora/applyHarness.patch | 2 +- certora/specs/GovernorBase.spec | 6 +-- certora/specs/GovernorCountingSimple.spec | 10 ++-- contracts/finance/VestingWallet.sol | 2 +- contracts/governance/Governor.sol | 14 +++--- contracts/governance/IGovernor.sol | 4 +- contracts/governance/README.adoc | 2 +- contracts/governance/TimelockController.sol | 20 ++++---- .../extensions/GovernorTimelockCompound.sol | 6 +-- .../extensions/GovernorTimelockControl.sol | 6 +-- contracts/interfaces/IERC2981.sol | 2 +- contracts/proxy/Proxy.sol | 4 +- contracts/utils/math/SafeMath.sol | 2 +- contracts/utils/structs/DoubleEndedQueue.sol | 2 +- test/governance/TimelockController.test.js | 48 +++++++++---------- .../GovernorCompatibilityBravo.test.js | 2 +- test/helpers/governance.js | 6 +-- test/utils/cryptography/ECDSA.test.js | 2 +- test/utils/structs/DoubleEndedQueue.test.js | 2 +- 21 files changed, 73 insertions(+), 73 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3144e2063..2bc4cb11f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -458,7 +458,7 @@ Refer to the table below to adjust your inheritance list. * `SignedSafeMath`: added overflow-safe operations for signed integers (`int256`). ([#1559](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1559), [#1588](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1588)) ### Improvements - * The compiler version required by `Array` was behind the rest of the libray so it was updated to `v0.4.24`. ([#1553](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1553)) + * The compiler version required by `Array` was behind the rest of the library so it was updated to `v0.4.24`. ([#1553](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1553)) * Now conforming to a 4-space indentation code style. ([1508](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1508)) * `ERC20`: more gas efficient due to removed redundant `require`s. ([#1409](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1409)) * `ERC721`: fixed a bug that prevented internal data structures from being properly cleaned, missing potential gas refunds. ([#1539](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1539) and [#1549](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1549)) diff --git a/audit/2017-03.md b/audit/2017-03.md index 53eb702ab..5ca874beb 100644 --- a/audit/2017-03.md +++ b/audit/2017-03.md @@ -133,7 +133,7 @@ I presume that the goal of this contract is to allow and annotate a migration to We like these pauses! Note that these allow significant griefing potential by owners, and that this might not be obvious to participants in smart contracts using the OpenZeppelin framework. We would recommend that additional sample logic be added to for instance the TokenContract showing safer use of the pause and resume functions. In particular, we would recommend a timelock after which anyone could unpause the contract. -The modifers use the pattern `if(bool){_;}`. This is fine for functions that return false upon failure, but could be problematic for functions expected to throw upon failure. See our comments above on standardizing on `throw` or `return(false)`. +The modifiers use the pattern `if(bool){_;}`. This is fine for functions that return false upon failure, but could be problematic for functions expected to throw upon failure. See our comments above on standardizing on `throw` or `return(false)`. ## Ownership diff --git a/certora/applyHarness.patch b/certora/applyHarness.patch index 42b10fab5..0fbe9acad 100644 --- a/certora/applyHarness.patch +++ b/certora/applyHarness.patch @@ -71,7 +71,7 @@ diff -ruN governance/Governor.sol governance/Governor.sol + /** * @dev Restrict access to governor executing address. Some module might override the _executor function to make - * sure this modifier is consistant with the execution model. + * sure this modifier is consistent with the execution model. @@ -167,12 +167,12 @@ /** * @dev Amount of votes already cast passes the threshold limit. diff --git a/certora/specs/GovernorBase.spec b/certora/specs/GovernorBase.spec index 031b2680e..3dfc18037 100644 --- a/certora/specs/GovernorBase.spec +++ b/certora/specs/GovernorBase.spec @@ -173,11 +173,11 @@ rule executionOnlyIfQuoromReachedAndVoteSucceeded(uint256 pId, env e, method f){ /* * A user cannot vote twice */ - // Checked for castVote only. all 3 castVote functions call _castVote, so the completness of the verification is counted on - // the fact that the 3 functions themselves makes no chages, but rather call an internal function to execute. + // Checked for castVote only. all 3 castVote functions call _castVote, so the completeness of the verification is counted on + // the fact that the 3 functions themselves makes no changes, but rather call an internal function to execute. // That means that we do not check those 3 functions directly, however for castVote & castVoteWithReason it is quite trivial // to understand why this is ok. For castVoteBySig we basically assume that the signature referendum is correct without checking it. - // We could check each function seperately and pass the rule, but that would have uglyfied the code with no concrete + // We could check each function separately and pass the rule, but that would have uglyfied the code with no concrete // benefit, as it is evident that nothing is happening in the first 2 functions (calling a view function), and we do not desire to check the signature verification. rule doubleVoting(uint256 pId, uint8 sup, method f) { env e; diff --git a/certora/specs/GovernorCountingSimple.spec b/certora/specs/GovernorCountingSimple.spec index 6d2d5fbb7..7af73beb6 100644 --- a/certora/specs/GovernorCountingSimple.spec +++ b/certora/specs/GovernorCountingSimple.spec @@ -128,11 +128,11 @@ invariant OneIsNotMoreThanAll(uint256 pId) /* * Only sender's voting status can be changed by execution of any cast vote function */ -// Checked for castVote only. all 3 castVote functions call _castVote, so the completness of the verification is counted on - // the fact that the 3 functions themselves makes no chages, but rather call an internal function to execute. +// Checked for castVote only. all 3 castVote functions call _castVote, so the completeness of the verification is counted on + // the fact that the 3 functions themselves makes no changes, but rather call an internal function to execute. // That means that we do not check those 3 functions directly, however for castVote & castVoteWithReason it is quite trivial // to understand why this is ok. For castVoteBySig we basically assume that the signature referendum is correct without checking it. - // We could check each function seperately and pass the rule, but that would have uglyfied the code with no concrete + // We could check each function separately and pass the rule, but that would have uglyfied the code with no concrete // benefit, as it is evident that nothing is happening in the first 2 functions (calling a view function), and we do not desire to check the signature verification. rule noVoteForSomeoneElse(uint256 pId, uint8 sup, method f) { env e; calldataarg args; @@ -205,7 +205,7 @@ rule privilegedOnlyNumerator(method f, uint256 newQuorumNumerator){ uint256 quorumNumAfter = quorumNumerator(e); address executorCheck = getExecutor(e); - assert quorumNumBefore != quorumNumAfter => e.msg.sender == executorCheck, "non priveleged user changed quorum numerator"; + assert quorumNumBefore != quorumNumAfter => e.msg.sender == executorCheck, "non privileged user changed quorum numerator"; } rule privilegedOnlyTimelock(method f, uint256 newQuorumNumerator){ @@ -217,5 +217,5 @@ rule privilegedOnlyTimelock(method f, uint256 newQuorumNumerator){ uint256 timelockAfter = timelock(e); - assert timelockBefore != timelockAfter => e.msg.sender == timelockBefore, "non priveleged user changed timelock"; + assert timelockBefore != timelockAfter => e.msg.sender == timelockBefore, "non privileged user changed timelock"; } diff --git a/contracts/finance/VestingWallet.sol b/contracts/finance/VestingWallet.sol index 5ffbfcb65..486ad3789 100644 --- a/contracts/finance/VestingWallet.sol +++ b/contracts/finance/VestingWallet.sol @@ -120,7 +120,7 @@ contract VestingWallet is Context { } /** - * @dev Virtual implementation of the vesting formula. This returns the amout vested, as a function of time, for + * @dev Virtual implementation of the vesting formula. This returns the amount vested, as a function of time, for * an asset given its total historical allocation. */ function _vestingSchedule(uint256 totalAllocation, uint64 timestamp) internal view virtual returns (uint256) { diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index 8907d9468..7dc25a20f 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -46,7 +46,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { // This queue keeps track of the governor operating on itself. Calls to functions protected by the // {onlyGovernance} modifier needs to be whitelisted in this queue. Whitelisting is set in {_beforeExecute}, - // consummed by the {onlyGovernance} modifier and eventually reset in {_afterExecute}. This ensures that the + // consumed by the {onlyGovernance} modifier and eventually reset in {_afterExecute}. This ensures that the // execution of {onlyGovernance} protected calls can only be achieved through successful proposals. DoubleEndedQueue.Bytes32Deque private _governanceCall; @@ -64,7 +64,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { require(_msgSender() == _executor(), "Governor: onlyGovernance"); if (_executor() != address(this)) { bytes32 msgDataHash = keccak256(_msgData()); - // loop until poping the expected operation - throw if deque is empty (operation not authorized) + // loop until popping the expected operation - throw if deque is empty (operation not authorized) while (_governanceCall.popFront() != msgDataHash) {} } _; @@ -124,7 +124,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { * * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the * same proposal (with same operation and same description) will have the same id if submitted on multiple governors - * accross multiple networks. This also means that in order to execute the same operation twice (on the same + * across multiple networks. This also means that in order to execute the same operation twice (on the same * governor) the proposer will have to change the description in order to avoid proposal id conflicts. */ function hashProposal( @@ -229,7 +229,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { /** * @dev Default additional encoded parameters used by castVote methods that don't include them * - * Note: Should be overriden by specific implementations to use an appropriate value, the + * Note: Should be overridden by specific implementations to use an appropriate value, the * meaning of the additional params, in the context of that implementation */ function _defaultParams() internal view virtual returns (bytes memory) { @@ -308,7 +308,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { } /** - * @dev Internal execution mechanism. Can be overriden to implement different execution mechanism + * @dev Internal execution mechanism. Can be overridden to implement different execution mechanism */ function _execute( uint256, /* proposalId */ @@ -325,7 +325,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { } /** - * @dev Hook before execution is trigerred. + * @dev Hook before execution is triggered. */ function _beforeExecute( uint256, /* proposalId */ @@ -344,7 +344,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { } /** - * @dev Hook after execution is trigerred. + * @dev Hook after execution is triggered. */ function _afterExecute( uint256, /* proposalId */ diff --git a/contracts/governance/IGovernor.sol b/contracts/governance/IGovernor.sol index eaf443a97..abb75d2ee 100644 --- a/contracts/governance/IGovernor.sol +++ b/contracts/governance/IGovernor.sol @@ -158,8 +158,8 @@ abstract contract IGovernor is IERC165 { * @notice module:user-config * @dev Minimum number of cast voted required for a proposal to be successful. * - * Note: The `blockNumber` parameter corresponds to the snaphot used for counting vote. This allows to scale the - * quroum depending on values such as the totalSupply of a token at this block (see {ERC20Votes}). + * Note: The `blockNumber` parameter corresponds to the snapshot used for counting vote. This allows to scale the + * quorum depending on values such as the totalSupply of a token at this block (see {ERC20Votes}). */ function quorum(uint256 blockNumber) public view virtual returns (uint256); diff --git a/contracts/governance/README.adoc b/contracts/governance/README.adoc index 58daf56e7..9e393e9a0 100644 --- a/contracts/governance/README.adoc +++ b/contracts/governance/README.adoc @@ -40,7 +40,7 @@ Other extensions can customize the behavior or interface in multiple ways. * {GovernorCompatibilityBravo}: Extends the interface to be fully `GovernorBravo`-compatible. Note that events are compatible regardless of whether this extension is included or not. -* {GovernorSettings}: Manages some of the settings (voting delay, voting period duration, and proposal threshold) in a way that can be updated through a governance proposal, without requiering an upgrade. +* {GovernorSettings}: Manages some of the settings (voting delay, voting period duration, and proposal threshold) in a way that can be updated through a governance proposal, without requiring an upgrade. * {GovernorPreventLateQuorum}: Ensures there is a minimum voting period after quorum is reached as a security protection against large voters. diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index ba3d54fe1..b7fa20715 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -185,11 +185,11 @@ contract TimelockController is AccessControl { function hashOperationBatch( address[] calldata targets, uint256[] calldata values, - bytes[] calldata datas, + bytes[] calldata payloads, bytes32 predecessor, bytes32 salt ) public pure virtual returns (bytes32 hash) { - return keccak256(abi.encode(targets, values, datas, predecessor, salt)); + return keccak256(abi.encode(targets, values, payloads, predecessor, salt)); } /** @@ -226,18 +226,18 @@ contract TimelockController is AccessControl { function scheduleBatch( address[] calldata targets, uint256[] calldata values, - bytes[] calldata datas, + bytes[] calldata payloads, bytes32 predecessor, bytes32 salt, uint256 delay ) public virtual onlyRole(PROPOSER_ROLE) { require(targets.length == values.length, "TimelockController: length mismatch"); - require(targets.length == datas.length, "TimelockController: length mismatch"); + require(targets.length == payloads.length, "TimelockController: length mismatch"); - bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt); + bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt); _schedule(id, delay); for (uint256 i = 0; i < targets.length; ++i) { - emit CallScheduled(id, i, targets[i], values[i], datas[i], predecessor, delay); + emit CallScheduled(id, i, targets[i], values[i], payloads[i], predecessor, delay); } } @@ -301,17 +301,17 @@ contract TimelockController is AccessControl { function executeBatch( address[] calldata targets, uint256[] calldata values, - bytes[] calldata datas, + bytes[] calldata payloads, bytes32 predecessor, bytes32 salt ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { require(targets.length == values.length, "TimelockController: length mismatch"); - require(targets.length == datas.length, "TimelockController: length mismatch"); + require(targets.length == payloads.length, "TimelockController: length mismatch"); - bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt); + bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt); _beforeCall(id, predecessor); for (uint256 i = 0; i < targets.length; ++i) { - _call(id, i, targets[i], values[i], datas[i]); + _call(id, i, targets[i], values[i], payloads[i]); } _afterCall(id); } diff --git a/contracts/governance/extensions/GovernorTimelockCompound.sol b/contracts/governance/extensions/GovernorTimelockCompound.sol index 99aea98ba..d14489aa0 100644 --- a/contracts/governance/extensions/GovernorTimelockCompound.sol +++ b/contracts/governance/extensions/GovernorTimelockCompound.sol @@ -105,7 +105,7 @@ abstract contract GovernorTimelockCompound is IGovernorTimelock, Governor { } /** - * @dev Overriden version of the {Governor-state} function with added support for the `Queued` and `Expired` status. + * @dev Overridden version of the {Governor-state} function with added support for the `Queued` and `Expired` status. */ function state(uint256 proposalId) public view virtual override(IGovernor, Governor) returns (ProposalState) { ProposalState status = super.state(proposalId); @@ -167,7 +167,7 @@ abstract contract GovernorTimelockCompound is IGovernorTimelock, Governor { } /** - * @dev Overriden execute function that run the already queued proposal through the timelock. + * @dev Overridden execute function that run the already queued proposal through the timelock. */ function _execute( uint256 proposalId, @@ -185,7 +185,7 @@ abstract contract GovernorTimelockCompound is IGovernorTimelock, Governor { } /** - * @dev Overriden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already + * @dev Overridden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already * been queued. */ function _cancel( diff --git a/contracts/governance/extensions/GovernorTimelockControl.sol b/contracts/governance/extensions/GovernorTimelockControl.sol index 2b3022324..8ab992f2e 100644 --- a/contracts/governance/extensions/GovernorTimelockControl.sol +++ b/contracts/governance/extensions/GovernorTimelockControl.sol @@ -47,7 +47,7 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor { } /** - * @dev Overriden version of the {Governor-state} function with added support for the `Queued` status. + * @dev Overridden version of the {Governor-state} function with added support for the `Queued` status. */ function state(uint256 proposalId) public view virtual override(IGovernor, Governor) returns (ProposalState) { ProposalState status = super.state(proposalId); @@ -107,7 +107,7 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor { } /** - * @dev Overriden execute function that run the already queued proposal through the timelock. + * @dev Overridden execute function that run the already queued proposal through the timelock. */ function _execute( uint256, /* proposalId */ @@ -120,7 +120,7 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor { } /** - * @dev Overriden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already + * @dev Overridden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already * been queued. */ // This function can reenter through the external call to the timelock, but we assume the timelock is trusted and diff --git a/contracts/interfaces/IERC2981.sol b/contracts/interfaces/IERC2981.sol index f02139869..063582401 100644 --- a/contracts/interfaces/IERC2981.sol +++ b/contracts/interfaces/IERC2981.sol @@ -16,7 +16,7 @@ import "../utils/introspection/IERC165.sol"; interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of - * exchange. The royalty amount is denominated and should be payed in that same unit of exchange. + * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external diff --git a/contracts/proxy/Proxy.sol b/contracts/proxy/Proxy.sol index f0e74d22f..6a358fa47 100644 --- a/contracts/proxy/Proxy.sol +++ b/contracts/proxy/Proxy.sol @@ -45,7 +45,7 @@ abstract contract Proxy { } /** - * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function + * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); @@ -80,7 +80,7 @@ abstract contract Proxy { * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * - * If overriden should call `super._beforeFallback()`. + * If overridden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} } diff --git a/contracts/utils/math/SafeMath.sol b/contracts/utils/math/SafeMath.sol index 6eb0aa6bd..1e97d7602 100644 --- a/contracts/utils/math/SafeMath.sol +++ b/contracts/utils/math/SafeMath.sol @@ -28,7 +28,7 @@ library SafeMath { } /** - * @dev Returns the substraction of two unsigned integers, with an overflow flag. + * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ diff --git a/contracts/utils/structs/DoubleEndedQueue.sol b/contracts/utils/structs/DoubleEndedQueue.sol index 5ac2766eb..d1d968ef6 100644 --- a/contracts/utils/structs/DoubleEndedQueue.sol +++ b/contracts/utils/structs/DoubleEndedQueue.sol @@ -24,7 +24,7 @@ library DoubleEndedQueue { error Empty(); /** - * @dev An operation (e.g. {at}) could't be completed due to an index being out of bounds. + * @dev An operation (e.g. {at}) couldn't be completed due to an index being out of bounds. */ error OutOfBounds(); diff --git a/test/governance/TimelockController.test.js b/test/governance/TimelockController.test.js index 84cec6c57..7d8d03c05 100644 --- a/test/governance/TimelockController.test.js +++ b/test/governance/TimelockController.test.js @@ -25,7 +25,7 @@ function genOperation (target, value, data, predecessor, salt) { return { id, target, value, data, predecessor, salt }; } -function genOperationBatch (targets, values, datas, predecessor, salt) { +function genOperationBatch (targets, values, payloads, predecessor, salt) { const id = web3.utils.keccak256(web3.eth.abi.encodeParameters([ 'address[]', 'uint256[]', @@ -35,11 +35,11 @@ function genOperationBatch (targets, values, datas, predecessor, salt) { ], [ targets, values, - datas, + payloads, predecessor, salt, ])); - return { id, targets, values, datas, predecessor, salt }; + return { id, targets, values, payloads, predecessor, salt }; } contract('TimelockController', function (accounts) { @@ -119,7 +119,7 @@ contract('TimelockController', function (accounts) { expect(await this.timelock.hashOperationBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, )).to.be.equal(this.operation.id); @@ -163,7 +163,7 @@ contract('TimelockController', function (accounts) { .to.be.bignumber.equal(web3.utils.toBN(block.timestamp).add(MINDELAY)); }); - it('prevent overwritting active operation', async function () { + it('prevent overwriting active operation', async function () { await this.timelock.schedule( this.operation.target, this.operation.value, @@ -346,7 +346,7 @@ contract('TimelockController', function (accounts) { const receipt = await this.timelock.scheduleBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, MINDELAY, @@ -358,7 +358,7 @@ contract('TimelockController', function (accounts) { index: web3.utils.toBN(i), target: this.operation.targets[i], value: web3.utils.toBN(this.operation.values[i]), - data: this.operation.datas[i], + data: this.operation.payloads[i], predecessor: this.operation.predecessor, delay: MINDELAY, }); @@ -370,11 +370,11 @@ contract('TimelockController', function (accounts) { .to.be.bignumber.equal(web3.utils.toBN(block.timestamp).add(MINDELAY)); }); - it('prevent overwritting active operation', async function () { + it('prevent overwriting active operation', async function () { await this.timelock.scheduleBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, MINDELAY, @@ -385,7 +385,7 @@ contract('TimelockController', function (accounts) { this.timelock.scheduleBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, MINDELAY, @@ -400,7 +400,7 @@ contract('TimelockController', function (accounts) { this.timelock.scheduleBatch( this.operation.targets, [], - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, MINDELAY, @@ -430,7 +430,7 @@ contract('TimelockController', function (accounts) { this.timelock.scheduleBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, MINDELAY, @@ -445,7 +445,7 @@ contract('TimelockController', function (accounts) { this.timelock.scheduleBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, MINDELAY - 1, @@ -472,7 +472,7 @@ contract('TimelockController', function (accounts) { this.timelock.executeBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, { from: executor }, @@ -486,7 +486,7 @@ contract('TimelockController', function (accounts) { ({ receipt: this.receipt, logs: this.logs } = await this.timelock.scheduleBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, MINDELAY, @@ -499,7 +499,7 @@ contract('TimelockController', function (accounts) { this.timelock.executeBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, { from: executor }, @@ -516,7 +516,7 @@ contract('TimelockController', function (accounts) { this.timelock.executeBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, { from: executor }, @@ -535,7 +535,7 @@ contract('TimelockController', function (accounts) { const receipt = await this.timelock.executeBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, { from: executor }, @@ -546,7 +546,7 @@ contract('TimelockController', function (accounts) { index: web3.utils.toBN(i), target: this.operation.targets[i], value: web3.utils.toBN(this.operation.values[i]), - data: this.operation.datas[i], + data: this.operation.payloads[i], }); } }); @@ -556,7 +556,7 @@ contract('TimelockController', function (accounts) { this.timelock.executeBatch( this.operation.targets, this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, { from: other }, @@ -570,7 +570,7 @@ contract('TimelockController', function (accounts) { this.timelock.executeBatch( [], this.operation.values, - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, { from: executor }, @@ -584,7 +584,7 @@ contract('TimelockController', function (accounts) { this.timelock.executeBatch( this.operation.targets, [], - this.operation.datas, + this.operation.payloads, this.operation.predecessor, this.operation.salt, { from: executor }, @@ -633,7 +633,7 @@ contract('TimelockController', function (accounts) { await this.timelock.scheduleBatch( operation.targets, operation.values, - operation.datas, + operation.payloads, operation.predecessor, operation.salt, MINDELAY, @@ -644,7 +644,7 @@ contract('TimelockController', function (accounts) { this.timelock.executeBatch( operation.targets, operation.values, - operation.datas, + operation.payloads, operation.predecessor, operation.salt, { from: executor }, diff --git a/test/governance/compatibility/GovernorCompatibilityBravo.test.js b/test/governance/compatibility/GovernorCompatibilityBravo.test.js index 7ab8ed328..2d0208ada 100644 --- a/test/governance/compatibility/GovernorCompatibilityBravo.test.js +++ b/test/governance/compatibility/GovernorCompatibilityBravo.test.js @@ -215,7 +215,7 @@ contract('GovernorCompatibilityBravo', function (accounts) { describe('should revert', function () { describe('on propose', function () { - it('if proposal doesnt meet proposalThreshold', async function () { + it('if proposal does not meet proposalThreshold', async function () { await expectRevert( this.helper.propose({ from: other }), 'GovernorCompatibilityBravo: proposer votes below proposal threshold', diff --git a/test/helpers/governance.js b/test/helpers/governance.js index accbf79ac..c56ec4c89 100644 --- a/test/helpers/governance.js +++ b/test/helpers/governance.js @@ -106,13 +106,13 @@ class GovernorHelper { opts, ))) : vote.params - // otherwize if params + // otherwise if params ? this.governor.castVoteWithReasonAndParams(...concatOpts( [ proposal.id, vote.support, vote.reason || '', vote.params ], opts, )) : vote.reason - // otherwize if reason + // otherwise if reason ? this.governor.castVoteWithReason(...concatOpts( [ proposal.id, vote.support, vote.reason ], opts, @@ -165,7 +165,7 @@ class GovernorHelper { const descriptionHash = web3.utils.keccak256(description); - // condensed version for queing end executing + // condensed version for queueing end executing const shortProposal = [ targets, values, diff --git a/test/utils/cryptography/ECDSA.test.js b/test/utils/cryptography/ECDSA.test.js index d15399669..fff3e2c30 100644 --- a/test/utils/cryptography/ECDSA.test.js +++ b/test/utils/cryptography/ECDSA.test.js @@ -47,7 +47,7 @@ function split (signature) { web3.utils.bytesToHex(raw.slice(32, 64)), // s ]; default: - expect.fail('Invalid siganture length, cannot split'); + expect.fail('Invalid signature length, cannot split'); } } diff --git a/test/utils/structs/DoubleEndedQueue.test.js b/test/utils/structs/DoubleEndedQueue.test.js index e10bf64e1..d1de09c33 100644 --- a/test/utils/structs/DoubleEndedQueue.test.js +++ b/test/utils/structs/DoubleEndedQueue.test.js @@ -69,7 +69,7 @@ contract('DoubleEndedQueue', function (accounts) { describe('push', function () { it('front', async function () { await this.deque.pushFront(bytesD); - this.content.unshift(bytesD); // add element at the begining + this.content.unshift(bytesD); // add element at the beginning expect(await getContent(this.deque)).to.have.ordered.members(this.content); }); From 05077f70f1379b0a2960711fbecb8a23c3b4c256 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 18:47:06 -0300 Subject: [PATCH 19/81] Update actions/cache action to v3 (#3277) Co-authored-by: Renovate Bot --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 05d8b2ade..264dc71e5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 12.x - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: cache with: path: '**/node_modules' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d119119c0..0877b5fef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 12.x - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: cache with: path: '**/node_modules' @@ -42,7 +42,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 12.x - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: cache with: path: '**/node_modules' @@ -62,7 +62,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 12.x - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: cache with: path: '**/node_modules' From 15d51741395248d709ccbc0906f437170571f502 Mon Sep 17 00:00:00 2001 From: GitHubPang <61439577+GitHubPang@users.noreply.github.com> Date: Wed, 23 Mar 2022 16:21:33 +0800 Subject: [PATCH 20/81] Fix minor typo in CONTRIBUTING.md. (#3284) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c55795d1..501284773 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,7 +51,7 @@ refer to some very important conditions that your PR must meet in order to be ac 6) Maintainers will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of OpenZeppelin Contracts. -*IMPORTANT* Please pay attention to the maintainer's feedback, since its a necessary step to keep up with the standards OpenZeppelin Contracts attains to. +*IMPORTANT* Please pay attention to the maintainer's feedback, since it's a necessary step to keep up with the standards OpenZeppelin Contracts attains to. ## All set! From 74c9130a5916904ba397a903db446cd049a3d22d Mon Sep 17 00:00:00 2001 From: gh3sthauss <35971947+gh3sthauss@users.noreply.github.com> Date: Wed, 23 Mar 2022 17:31:25 +0300 Subject: [PATCH 21/81] typo fixed (#3264) From 76fca3aec8e6ce2caf1c9c9a2c8396fe0882591a Mon Sep 17 00:00:00 2001 From: Ashwin Yardi <43699109+ashwinYardi@users.noreply.github.com> Date: Thu, 24 Mar 2022 05:55:00 +0530 Subject: [PATCH 22/81] Add ERC721 and ERC1155 receiver support in Governor, Timelock (#3230) * add ERC721 and ERC1155 receiver support in Governor, Timelock and MinimalForwarder (#3174) * revert the nft receiver hooks from MinimalForwarder and linting updates * add ERC165 support & simplify test * add changelog entry Co-authored-by: Hadrien Croubois --- CHANGELOG.md | 2 + contracts/governance/Governor.sol | 43 +++- contracts/governance/TimelockController.sol | 49 +++- test/governance/Governor.test.js | 55 +++++ test/governance/TimelockController.test.js | 235 +++++++++++++------- 5 files changed, 296 insertions(+), 88 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bc4cb11f..d59db4c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) * `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196)) * `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259)) + * `Governor`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by governors. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230)) + * `TimelockController`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by timelocks. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230)) ### Breaking changes diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index 7dc25a20f..8b13585e6 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -3,6 +3,8 @@ pragma solidity ^0.8.0; +import "../token/ERC721/IERC721Receiver.sol"; +import "../token/ERC1155/IERC1155Receiver.sol"; import "../utils/cryptography/ECDSA.sol"; import "../utils/cryptography/draft-EIP712.sol"; import "../utils/introspection/ERC165.sol"; @@ -24,7 +26,7 @@ import "./IGovernor.sol"; * * _Available since v4.3._ */ -abstract contract Governor is Context, ERC165, EIP712, IGovernor { +abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receiver, IERC1155Receiver { using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque; using SafeCast for uint256; using Timers for Timers.BlockNumber; @@ -97,6 +99,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { this.castVoteWithReasonAndParamsBySig.selector ^ this.getVotesWithParams.selector) || interfaceId == type(IGovernor).interfaceId || + interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } @@ -552,4 +555,42 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor { function _executor() internal view virtual returns (address) { return address(this); } + + /** + * @dev See {IERC721Receiver-onERC721Received}. + */ + function onERC721Received( + address, + address, + uint256, + bytes memory + ) public virtual override returns (bytes4) { + return this.onERC721Received.selector; + } + + /** + * @dev See {IERC1155Receiver-onERC1155Received}. + */ + function onERC1155Received( + address, + address, + uint256, + uint256, + bytes memory + ) public virtual override returns (bytes4) { + return this.onERC1155Received.selector; + } + + /** + * @dev See {IERC1155Receiver-onERC1155BatchReceived}. + */ + function onERC1155BatchReceived( + address, + address, + uint256[] memory, + uint256[] memory, + bytes memory + ) public virtual override returns (bytes4) { + return this.onERC1155BatchReceived.selector; + } } diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index b7fa20715..376023fe3 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -4,6 +4,8 @@ pragma solidity ^0.8.0; import "../access/AccessControl.sol"; +import "../token/ERC721/IERC721Receiver.sol"; +import "../token/ERC1155/IERC1155Receiver.sol"; /** * @dev Contract module which acts as a timelocked controller. When set as the @@ -20,7 +22,7 @@ import "../access/AccessControl.sol"; * * _Available since v3.3._ */ -contract TimelockController is AccessControl { +contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver { bytes32 public constant TIMELOCK_ADMIN_ROLE = keccak256("TIMELOCK_ADMIN_ROLE"); bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); @@ -117,6 +119,13 @@ contract TimelockController is AccessControl { */ receive() external payable {} + /** + * @dev See {IERC165-supportsInterface}. + */ + function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, AccessControl) returns (bool) { + return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); + } + /** * @dev Returns whether an id correspond to a registered operation. This * includes both Pending, Ready and Done operations. @@ -365,4 +374,42 @@ contract TimelockController is AccessControl { emit MinDelayChange(_minDelay, newDelay); _minDelay = newDelay; } + + /** + * @dev See {IERC721Receiver-onERC721Received}. + */ + function onERC721Received( + address, + address, + uint256, + bytes memory + ) public virtual override returns (bytes4) { + return this.onERC721Received.selector; + } + + /** + * @dev See {IERC1155Receiver-onERC1155Received}. + */ + function onERC1155Received( + address, + address, + uint256, + uint256, + bytes memory + ) public virtual override returns (bytes4) { + return this.onERC1155Received.selector; + } + + /** + * @dev See {IERC1155Receiver-onERC1155BatchReceived}. + */ + function onERC1155BatchReceived( + address, + address, + uint256[] memory, + uint256[] memory, + bytes memory + ) public virtual override returns (bytes4) { + return this.onERC1155BatchReceived.selector; + } } diff --git a/test/governance/Governor.test.js b/test/governance/Governor.test.js index 8ef3b3b7a..bd10dcd68 100644 --- a/test/governance/Governor.test.js +++ b/test/governance/Governor.test.js @@ -14,6 +14,8 @@ const { const Token = artifacts.require('ERC20VotesMock'); const Governor = artifacts.require('GovernorMock'); const CallReceiver = artifacts.require('CallReceiverMock'); +const ERC721Mock = artifacts.require('ERC721Mock'); +const ERC1155Mock = artifacts.require('ERC1155Mock'); contract('Governor', function (accounts) { const [ owner, proposer, voter1, voter2, voter3, voter4 ] = accounts; @@ -55,6 +57,7 @@ contract('Governor', function (accounts) { shouldSupportInterfaces([ 'ERC165', + 'ERC1155Receiver', 'Governor', 'GovernorWithParams', ]); @@ -574,4 +577,56 @@ contract('Governor', function (accounts) { expect(await this.mock.proposalThreshold()).to.be.bignumber.equal('1000000000000000000'); }); }); + + describe('safe receive', function () { + describe('ERC721', function () { + const name = 'Non Fungible Token'; + const symbol = 'NFT'; + const tokenId = new BN(1); + + beforeEach(async function () { + this.token = await ERC721Mock.new(name, symbol); + await this.token.mint(owner, tokenId); + }); + + it('can receive an ERC721 safeTransfer', async function () { + await this.token.safeTransferFrom(owner, this.mock.address, tokenId, { from: owner }); + }); + }); + + describe('ERC1155', function () { + const uri = 'https://token-cdn-domain/{id}.json'; + const tokenIds = { + 1: new BN(1000), + 2: new BN(2000), + 3: new BN(3000), + }; + + beforeEach(async function () { + this.token = await ERC1155Mock.new(uri); + await this.token.mintBatch(owner, Object.keys(tokenIds), Object.values(tokenIds), '0x'); + }); + + it('can receive ERC1155 safeTransfer', async function () { + await this.token.safeTransferFrom( + owner, + this.mock.address, + ...Object.entries(tokenIds)[0], // id + amount + '0x', + { from: owner }, + ); + }); + + it('can receive ERC1155 safeBatchTransfer', async function () { + await this.token.safeBatchTransferFrom( + owner, + this.mock.address, + Object.keys(tokenIds), + Object.values(tokenIds), + '0x', + { from: owner }, + ); + }); + }); + }); }); diff --git a/test/governance/TimelockController.test.js b/test/governance/TimelockController.test.js index 7d8d03c05..4584b2252 100644 --- a/test/governance/TimelockController.test.js +++ b/test/governance/TimelockController.test.js @@ -1,11 +1,18 @@ -const { constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers'); +const { BN, constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers'); const { ZERO_BYTES32 } = constants; const { expect } = require('chai'); +const { + shouldSupportInterfaces, +} = require('../utils/introspection/SupportsInterface.behavior'); + const TimelockController = artifacts.require('TimelockController'); const CallReceiverMock = artifacts.require('CallReceiverMock'); const Implementation2 = artifacts.require('Implementation2'); +const ERC721Mock = artifacts.require('ERC721Mock'); +const ERC1155Mock = artifacts.require('ERC1155Mock'); + const MINDELAY = time.duration.days(1); function genOperation (target, value, data, predecessor, salt) { @@ -52,40 +59,44 @@ contract('TimelockController', function (accounts) { beforeEach(async function () { // Deploy new timelock - this.timelock = await TimelockController.new( + this.mock = await TimelockController.new( MINDELAY, [ proposer ], [ executor ], { from: admin }, ); - expect(await this.timelock.hasRole(CANCELLER_ROLE, proposer)).to.be.equal(true); - await this.timelock.revokeRole(CANCELLER_ROLE, proposer, { from: admin }); - await this.timelock.grantRole(CANCELLER_ROLE, canceller, { from: admin }); + expect(await this.mock.hasRole(CANCELLER_ROLE, proposer)).to.be.equal(true); + await this.mock.revokeRole(CANCELLER_ROLE, proposer, { from: admin }); + await this.mock.grantRole(CANCELLER_ROLE, canceller, { from: admin }); // Mocks this.callreceivermock = await CallReceiverMock.new({ from: admin }); this.implementation2 = await Implementation2.new({ from: admin }); }); - it('initial state', async function () { - expect(await this.timelock.getMinDelay()).to.be.bignumber.equal(MINDELAY); + shouldSupportInterfaces([ + 'ERC1155Receiver', + ]); - expect(await this.timelock.TIMELOCK_ADMIN_ROLE()).to.be.equal(TIMELOCK_ADMIN_ROLE); - expect(await this.timelock.PROPOSER_ROLE()).to.be.equal(PROPOSER_ROLE); - expect(await this.timelock.EXECUTOR_ROLE()).to.be.equal(EXECUTOR_ROLE); - expect(await this.timelock.CANCELLER_ROLE()).to.be.equal(CANCELLER_ROLE); + it('initial state', async function () { + expect(await this.mock.getMinDelay()).to.be.bignumber.equal(MINDELAY); + + expect(await this.mock.TIMELOCK_ADMIN_ROLE()).to.be.equal(TIMELOCK_ADMIN_ROLE); + expect(await this.mock.PROPOSER_ROLE()).to.be.equal(PROPOSER_ROLE); + expect(await this.mock.EXECUTOR_ROLE()).to.be.equal(EXECUTOR_ROLE); + expect(await this.mock.CANCELLER_ROLE()).to.be.equal(CANCELLER_ROLE); expect(await Promise.all([ PROPOSER_ROLE, CANCELLER_ROLE, EXECUTOR_ROLE ].map(role => - this.timelock.hasRole(role, proposer), + this.mock.hasRole(role, proposer), ))).to.be.deep.equal([ true, false, false ]); expect(await Promise.all([ PROPOSER_ROLE, CANCELLER_ROLE, EXECUTOR_ROLE ].map(role => - this.timelock.hasRole(role, canceller), + this.mock.hasRole(role, canceller), ))).to.be.deep.equal([ false, true, false ]); expect(await Promise.all([ PROPOSER_ROLE, CANCELLER_ROLE, EXECUTOR_ROLE ].map(role => - this.timelock.hasRole(role, executor), + this.mock.hasRole(role, executor), ))).to.be.deep.equal([ false, false, true ]); }); @@ -99,7 +110,7 @@ contract('TimelockController', function (accounts) { '0xba41db3be0a9929145cfe480bd0f1f003689104d275ae912099f925df424ef94', '0x60d9109846ab510ed75c15f979ae366a8a2ace11d34ba9788c13ac296db50e6e', ); - expect(await this.timelock.hashOperation( + expect(await this.mock.hashOperation( this.operation.target, this.operation.value, this.operation.data, @@ -116,7 +127,7 @@ contract('TimelockController', function (accounts) { '0xce8f45069cc71d25f71ba05062de1a3974f9849b004de64a70998bca9d29c2e7', '0x8952d74c110f72bfe5accdf828c74d53a7dfb71235dfa8a1e8c75d8576b372ff', ); - expect(await this.timelock.hashOperationBatch( + expect(await this.mock.hashOperationBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -138,7 +149,7 @@ contract('TimelockController', function (accounts) { }); it('proposer can schedule', async function () { - const receipt = await this.timelock.schedule( + const receipt = await this.mock.schedule( this.operation.target, this.operation.value, this.operation.data, @@ -159,12 +170,12 @@ contract('TimelockController', function (accounts) { const block = await web3.eth.getBlock(receipt.receipt.blockHash); - expect(await this.timelock.getTimestamp(this.operation.id)) + expect(await this.mock.getTimestamp(this.operation.id)) .to.be.bignumber.equal(web3.utils.toBN(block.timestamp).add(MINDELAY)); }); it('prevent overwriting active operation', async function () { - await this.timelock.schedule( + await this.mock.schedule( this.operation.target, this.operation.value, this.operation.data, @@ -175,7 +186,7 @@ contract('TimelockController', function (accounts) { ); await expectRevert( - this.timelock.schedule( + this.mock.schedule( this.operation.target, this.operation.value, this.operation.data, @@ -190,7 +201,7 @@ contract('TimelockController', function (accounts) { it('prevent non-proposer from commiting', async function () { await expectRevert( - this.timelock.schedule( + this.mock.schedule( this.operation.target, this.operation.value, this.operation.data, @@ -205,7 +216,7 @@ contract('TimelockController', function (accounts) { it('enforce minimum delay', async function () { await expectRevert( - this.timelock.schedule( + this.mock.schedule( this.operation.target, this.operation.value, this.operation.data, @@ -232,7 +243,7 @@ contract('TimelockController', function (accounts) { it('revert if operation is not scheduled', async function () { await expectRevert( - this.timelock.execute( + this.mock.execute( this.operation.target, this.operation.value, this.operation.data, @@ -246,7 +257,7 @@ contract('TimelockController', function (accounts) { describe('with scheduled operation', function () { beforeEach(async function () { - ({ receipt: this.receipt, logs: this.logs } = await this.timelock.schedule( + ({ receipt: this.receipt, logs: this.logs } = await this.mock.schedule( this.operation.target, this.operation.value, this.operation.data, @@ -259,7 +270,7 @@ contract('TimelockController', function (accounts) { it('revert if execution comes too early 1/2', async function () { await expectRevert( - this.timelock.execute( + this.mock.execute( this.operation.target, this.operation.value, this.operation.data, @@ -272,11 +283,11 @@ contract('TimelockController', function (accounts) { }); it('revert if execution comes too early 2/2', async function () { - const timestamp = await this.timelock.getTimestamp(this.operation.id); + const timestamp = await this.mock.getTimestamp(this.operation.id); await time.increaseTo(timestamp - 5); // -1 is too tight, test sometime fails await expectRevert( - this.timelock.execute( + this.mock.execute( this.operation.target, this.operation.value, this.operation.data, @@ -290,12 +301,12 @@ contract('TimelockController', function (accounts) { describe('on time', function () { beforeEach(async function () { - const timestamp = await this.timelock.getTimestamp(this.operation.id); + const timestamp = await this.mock.getTimestamp(this.operation.id); await time.increaseTo(timestamp); }); it('executor can reveal', async function () { - const receipt = await this.timelock.execute( + const receipt = await this.mock.execute( this.operation.target, this.operation.value, this.operation.data, @@ -314,7 +325,7 @@ contract('TimelockController', function (accounts) { it('prevent non-executor from revealing', async function () { await expectRevert( - this.timelock.execute( + this.mock.execute( this.operation.target, this.operation.value, this.operation.data, @@ -343,7 +354,7 @@ contract('TimelockController', function (accounts) { }); it('proposer can schedule', async function () { - const receipt = await this.timelock.scheduleBatch( + const receipt = await this.mock.scheduleBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -366,12 +377,12 @@ contract('TimelockController', function (accounts) { const block = await web3.eth.getBlock(receipt.receipt.blockHash); - expect(await this.timelock.getTimestamp(this.operation.id)) + expect(await this.mock.getTimestamp(this.operation.id)) .to.be.bignumber.equal(web3.utils.toBN(block.timestamp).add(MINDELAY)); }); it('prevent overwriting active operation', async function () { - await this.timelock.scheduleBatch( + await this.mock.scheduleBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -382,7 +393,7 @@ contract('TimelockController', function (accounts) { ); await expectRevert( - this.timelock.scheduleBatch( + this.mock.scheduleBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -397,7 +408,7 @@ contract('TimelockController', function (accounts) { it('length of batch parameter must match #1', async function () { await expectRevert( - this.timelock.scheduleBatch( + this.mock.scheduleBatch( this.operation.targets, [], this.operation.payloads, @@ -412,7 +423,7 @@ contract('TimelockController', function (accounts) { it('length of batch parameter must match #1', async function () { await expectRevert( - this.timelock.scheduleBatch( + this.mock.scheduleBatch( this.operation.targets, this.operation.values, [], @@ -427,7 +438,7 @@ contract('TimelockController', function (accounts) { it('prevent non-proposer from commiting', async function () { await expectRevert( - this.timelock.scheduleBatch( + this.mock.scheduleBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -442,7 +453,7 @@ contract('TimelockController', function (accounts) { it('enforce minimum delay', async function () { await expectRevert( - this.timelock.scheduleBatch( + this.mock.scheduleBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -469,7 +480,7 @@ contract('TimelockController', function (accounts) { it('revert if operation is not scheduled', async function () { await expectRevert( - this.timelock.executeBatch( + this.mock.executeBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -483,7 +494,7 @@ contract('TimelockController', function (accounts) { describe('with scheduled operation', function () { beforeEach(async function () { - ({ receipt: this.receipt, logs: this.logs } = await this.timelock.scheduleBatch( + ({ receipt: this.receipt, logs: this.logs } = await this.mock.scheduleBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -496,7 +507,7 @@ contract('TimelockController', function (accounts) { it('revert if execution comes too early 1/2', async function () { await expectRevert( - this.timelock.executeBatch( + this.mock.executeBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -509,11 +520,11 @@ contract('TimelockController', function (accounts) { }); it('revert if execution comes too early 2/2', async function () { - const timestamp = await this.timelock.getTimestamp(this.operation.id); + const timestamp = await this.mock.getTimestamp(this.operation.id); await time.increaseTo(timestamp - 5); // -1 is to tight, test sometime fails await expectRevert( - this.timelock.executeBatch( + this.mock.executeBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -527,12 +538,12 @@ contract('TimelockController', function (accounts) { describe('on time', function () { beforeEach(async function () { - const timestamp = await this.timelock.getTimestamp(this.operation.id); + const timestamp = await this.mock.getTimestamp(this.operation.id); await time.increaseTo(timestamp); }); it('executor can reveal', async function () { - const receipt = await this.timelock.executeBatch( + const receipt = await this.mock.executeBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -553,7 +564,7 @@ contract('TimelockController', function (accounts) { it('prevent non-executor from revealing', async function () { await expectRevert( - this.timelock.executeBatch( + this.mock.executeBatch( this.operation.targets, this.operation.values, this.operation.payloads, @@ -567,7 +578,7 @@ contract('TimelockController', function (accounts) { it('length mismatch #1', async function () { await expectRevert( - this.timelock.executeBatch( + this.mock.executeBatch( [], this.operation.values, this.operation.payloads, @@ -581,7 +592,7 @@ contract('TimelockController', function (accounts) { it('length mismatch #2', async function () { await expectRevert( - this.timelock.executeBatch( + this.mock.executeBatch( this.operation.targets, [], this.operation.payloads, @@ -595,7 +606,7 @@ contract('TimelockController', function (accounts) { it('length mismatch #3', async function () { await expectRevert( - this.timelock.executeBatch( + this.mock.executeBatch( this.operation.targets, this.operation.values, [], @@ -630,7 +641,7 @@ contract('TimelockController', function (accounts) { '0x8ac04aa0d6d66b8812fb41d39638d37af0a9ab11da507afd65c509f8ed079d3e', ); - await this.timelock.scheduleBatch( + await this.mock.scheduleBatch( operation.targets, operation.values, operation.payloads, @@ -641,7 +652,7 @@ contract('TimelockController', function (accounts) { ); await time.increase(MINDELAY); await expectRevert( - this.timelock.executeBatch( + this.mock.executeBatch( operation.targets, operation.values, operation.payloads, @@ -664,7 +675,7 @@ contract('TimelockController', function (accounts) { ZERO_BYTES32, '0xa2485763600634800df9fc9646fb2c112cf98649c55f63dd1d9c7d13a64399d9', ); - ({ receipt: this.receipt, logs: this.logs } = await this.timelock.schedule( + ({ receipt: this.receipt, logs: this.logs } = await this.mock.schedule( this.operation.target, this.operation.value, this.operation.data, @@ -676,20 +687,20 @@ contract('TimelockController', function (accounts) { }); it('canceller can cancel', async function () { - const receipt = await this.timelock.cancel(this.operation.id, { from: canceller }); + const receipt = await this.mock.cancel(this.operation.id, { from: canceller }); expectEvent(receipt, 'Cancelled', { id: this.operation.id }); }); it('cannot cancel invalid operation', async function () { await expectRevert( - this.timelock.cancel(constants.ZERO_BYTES32, { from: canceller }), + this.mock.cancel(constants.ZERO_BYTES32, { from: canceller }), 'TimelockController: operation cannot be cancelled', ); }); it('prevent non-canceller from canceling', async function () { await expectRevert( - this.timelock.cancel(this.operation.id, { from: other }), + this.mock.cancel(this.operation.id, { from: other }), `AccessControl: account ${other.toLowerCase()} is missing role ${CANCELLER_ROLE}`, ); }); @@ -699,7 +710,7 @@ contract('TimelockController', function (accounts) { describe('maintenance', function () { it('prevent unauthorized maintenance', async function () { await expectRevert( - this.timelock.updateDelay(0, { from: other }), + this.mock.updateDelay(0, { from: other }), 'TimelockController: caller must be timelock', ); }); @@ -707,14 +718,14 @@ contract('TimelockController', function (accounts) { it('timelock scheduled maintenance', async function () { const newDelay = time.duration.hours(6); const operation = genOperation( - this.timelock.address, + this.mock.address, 0, - this.timelock.contract.methods.updateDelay(newDelay.toString()).encodeABI(), + this.mock.contract.methods.updateDelay(newDelay.toString()).encodeABI(), ZERO_BYTES32, '0xf8e775b2c5f4d66fb5c7fa800f35ef518c262b6014b3c0aee6ea21bff157f108', ); - await this.timelock.schedule( + await this.mock.schedule( operation.target, operation.value, operation.data, @@ -724,7 +735,7 @@ contract('TimelockController', function (accounts) { { from: proposer }, ); await time.increase(MINDELAY); - const receipt = await this.timelock.execute( + const receipt = await this.mock.execute( operation.target, operation.value, operation.data, @@ -734,7 +745,7 @@ contract('TimelockController', function (accounts) { ); expectEvent(receipt, 'MinDelayChange', { newDuration: newDelay.toString(), oldDuration: MINDELAY }); - expect(await this.timelock.getMinDelay()).to.be.bignumber.equal(newDelay); + expect(await this.mock.getMinDelay()).to.be.bignumber.equal(newDelay); }); }); @@ -754,7 +765,7 @@ contract('TimelockController', function (accounts) { this.operation1.id, '0x036e1311cac523f9548e6461e29fb1f8f9196b91910a41711ea22f5de48df07d', ); - await this.timelock.schedule( + await this.mock.schedule( this.operation1.target, this.operation1.value, this.operation1.data, @@ -763,7 +774,7 @@ contract('TimelockController', function (accounts) { MINDELAY, { from: proposer }, ); - await this.timelock.schedule( + await this.mock.schedule( this.operation2.target, this.operation2.value, this.operation2.data, @@ -777,7 +788,7 @@ contract('TimelockController', function (accounts) { it('cannot execute before dependency', async function () { await expectRevert( - this.timelock.execute( + this.mock.execute( this.operation2.target, this.operation2.value, this.operation2.data, @@ -790,7 +801,7 @@ contract('TimelockController', function (accounts) { }); it('can execute after dependency', async function () { - await this.timelock.execute( + await this.mock.execute( this.operation1.target, this.operation1.value, this.operation1.data, @@ -798,7 +809,7 @@ contract('TimelockController', function (accounts) { this.operation1.salt, { from: executor }, ); - await this.timelock.execute( + await this.mock.execute( this.operation2.target, this.operation2.value, this.operation2.data, @@ -821,7 +832,7 @@ contract('TimelockController', function (accounts) { '0x8043596363daefc89977b25f9d9b4d06c3910959ef0c4d213557a903e1b555e2', ); - await this.timelock.schedule( + await this.mock.schedule( operation.target, operation.value, operation.data, @@ -831,7 +842,7 @@ contract('TimelockController', function (accounts) { { from: proposer }, ); await time.increase(MINDELAY); - await this.timelock.execute( + await this.mock.execute( operation.target, operation.value, operation.data, @@ -852,7 +863,7 @@ contract('TimelockController', function (accounts) { '0xb1b1b276fdf1a28d1e00537ea73b04d56639128b08063c1a2f70a52e38cba693', ); - await this.timelock.schedule( + await this.mock.schedule( operation.target, operation.value, operation.data, @@ -863,7 +874,7 @@ contract('TimelockController', function (accounts) { ); await time.increase(MINDELAY); await expectRevert( - this.timelock.execute( + this.mock.execute( operation.target, operation.value, operation.data, @@ -884,7 +895,7 @@ contract('TimelockController', function (accounts) { '0xe5ca79f295fc8327ee8a765fe19afb58f4a0cbc5053642bfdd7e73bc68e0fc67', ); - await this.timelock.schedule( + await this.mock.schedule( operation.target, operation.value, operation.data, @@ -895,7 +906,7 @@ contract('TimelockController', function (accounts) { ); await time.increase(MINDELAY); await expectRevert( - this.timelock.execute( + this.mock.execute( operation.target, operation.value, operation.data, @@ -916,7 +927,7 @@ contract('TimelockController', function (accounts) { '0xf3274ce7c394c5b629d5215723563a744b817e1730cca5587c567099a14578fd', ); - await this.timelock.schedule( + await this.mock.schedule( operation.target, operation.value, operation.data, @@ -927,7 +938,7 @@ contract('TimelockController', function (accounts) { ); await time.increase(MINDELAY); await expectRevert( - this.timelock.execute( + this.mock.execute( operation.target, operation.value, operation.data, @@ -948,7 +959,7 @@ contract('TimelockController', function (accounts) { '0x5ab73cd33477dcd36c1e05e28362719d0ed59a7b9ff14939de63a43073dc1f44', ); - await this.timelock.schedule( + await this.mock.schedule( operation.target, operation.value, operation.data, @@ -959,10 +970,10 @@ contract('TimelockController', function (accounts) { ); await time.increase(MINDELAY); - expect(await web3.eth.getBalance(this.timelock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); expect(await web3.eth.getBalance(this.callreceivermock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); - await this.timelock.execute( + await this.mock.execute( operation.target, operation.value, operation.data, @@ -971,7 +982,7 @@ contract('TimelockController', function (accounts) { { from: executor, value: 1 }, ); - expect(await web3.eth.getBalance(this.timelock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); expect(await web3.eth.getBalance(this.callreceivermock.address)).to.be.bignumber.equal(web3.utils.toBN(1)); }); @@ -984,7 +995,7 @@ contract('TimelockController', function (accounts) { '0xb78edbd920c7867f187e5aa6294ae5a656cfbf0dea1ccdca3751b740d0f2bdf8', ); - await this.timelock.schedule( + await this.mock.schedule( operation.target, operation.value, operation.data, @@ -995,11 +1006,11 @@ contract('TimelockController', function (accounts) { ); await time.increase(MINDELAY); - expect(await web3.eth.getBalance(this.timelock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); expect(await web3.eth.getBalance(this.callreceivermock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); await expectRevert( - this.timelock.execute( + this.mock.execute( operation.target, operation.value, operation.data, @@ -1010,7 +1021,7 @@ contract('TimelockController', function (accounts) { 'TimelockController: underlying transaction reverted', ); - expect(await web3.eth.getBalance(this.timelock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); expect(await web3.eth.getBalance(this.callreceivermock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); }); @@ -1023,7 +1034,7 @@ contract('TimelockController', function (accounts) { '0xdedb4563ef0095db01d81d3f2decf57cf83e4a72aa792af14c43a792b56f4de6', ); - await this.timelock.schedule( + await this.mock.schedule( operation.target, operation.value, operation.data, @@ -1034,11 +1045,11 @@ contract('TimelockController', function (accounts) { ); await time.increase(MINDELAY); - expect(await web3.eth.getBalance(this.timelock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); expect(await web3.eth.getBalance(this.callreceivermock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); await expectRevert( - this.timelock.execute( + this.mock.execute( operation.target, operation.value, operation.data, @@ -1049,8 +1060,60 @@ contract('TimelockController', function (accounts) { 'TimelockController: underlying transaction reverted', ); - expect(await web3.eth.getBalance(this.timelock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); + expect(await web3.eth.getBalance(this.mock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); expect(await web3.eth.getBalance(this.callreceivermock.address)).to.be.bignumber.equal(web3.utils.toBN(0)); }); }); + + describe('safe receive', function () { + describe('ERC721', function () { + const name = 'Non Fungible Token'; + const symbol = 'NFT'; + const tokenId = new BN(1); + + beforeEach(async function () { + this.token = await ERC721Mock.new(name, symbol); + await this.token.mint(other, tokenId); + }); + + it('can receive an ERC721 safeTransfer', async function () { + await this.token.safeTransferFrom(other, this.mock.address, tokenId, { from: other }); + }); + }); + + describe('ERC1155', function () { + const uri = 'https://token-cdn-domain/{id}.json'; + const tokenIds = { + 1: new BN(1000), + 2: new BN(2000), + 3: new BN(3000), + }; + + beforeEach(async function () { + this.token = await ERC1155Mock.new(uri); + await this.token.mintBatch(other, Object.keys(tokenIds), Object.values(tokenIds), '0x'); + }); + + it('can receive ERC1155 safeTransfer', async function () { + await this.token.safeTransferFrom( + other, + this.mock.address, + ...Object.entries(tokenIds)[0], // id + amount + '0x', + { from: other }, + ); + }); + + it('can receive ERC1155 safeBatchTransfer', async function () { + await this.token.safeBatchTransferFrom( + other, + this.mock.address, + Object.keys(tokenIds), + Object.values(tokenIds), + '0x', + { from: other }, + ); + }); + }); + }); }); From bfff03c0d2a59bcd8e2ead1da9aed9edf0080d05 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Fri, 25 Mar 2022 10:36:08 +0100 Subject: [PATCH 23/81] add missing PR link in Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d59db4c10..1bef21841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ * `DoubleEndedQueue`: a new data structure that supports efficient push and pop to both front and back, useful for FIFO and LIFO queues. ([#3153](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3153)) * `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147)) * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) - * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. + * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) * `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196)) * `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259)) From 76eee35971c2541585e05cbf258510dda7b2fbc6 Mon Sep 17 00:00:00 2001 From: Mihir Wadekar Date: Fri, 25 Mar 2022 03:02:15 -0700 Subject: [PATCH 24/81] Improve revert message in Governor (#3275) * Fixed typo * fix testing and adding changelog Co-authored-by: Hadrien Croubois --- CHANGELOG.md | 3 ++- contracts/governance/Governor.sol | 2 +- .../compatibility/GovernorCompatibilityBravo.test.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bef21841..2eef2cb91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,9 @@ * `ERC1155`: Add a `_afterTokenTransfer` hook for improved extensibility. ([#3166](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3166)) * `DoubleEndedQueue`: a new data structure that supports efficient push and pop to both front and back, useful for FIFO and LIFO queues. ([#3153](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3153)) * `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147)) - * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) + * `Governor`: rewording of revert reason for consistency. ([#3275](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3275)) + * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) * `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196)) * `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259)) diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index 8b13585e6..a18b98577 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -250,7 +250,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive ) public virtual override returns (uint256) { require( getVotes(_msgSender(), block.number - 1) >= proposalThreshold(), - "GovernorCompatibilityBravo: proposer votes below proposal threshold" + "Governor: proposer votes below proposal threshold" ); uint256 proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description))); diff --git a/test/governance/compatibility/GovernorCompatibilityBravo.test.js b/test/governance/compatibility/GovernorCompatibilityBravo.test.js index 2d0208ada..5f12e9fac 100644 --- a/test/governance/compatibility/GovernorCompatibilityBravo.test.js +++ b/test/governance/compatibility/GovernorCompatibilityBravo.test.js @@ -218,7 +218,7 @@ contract('GovernorCompatibilityBravo', function (accounts) { it('if proposal does not meet proposalThreshold', async function () { await expectRevert( this.helper.propose({ from: other }), - 'GovernorCompatibilityBravo: proposer votes below proposal threshold', + 'Governor: proposer votes below proposal threshold', ); }); }); From e029096ca4e97c54fef79b077c6be169c66a4633 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 28 Mar 2022 20:36:30 +0200 Subject: [PATCH 25/81] Add Initialized event (#3294) Co-authored-by: Francisco Giordano --- CHANGELOG.md | 2 ++ contracts/proxy/utils/Initializable.sol | 7 +++++ test/proxy/utils/Initializable.test.js | 41 ++++++++++++++++++++++--- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2eef2cb91..086c58cc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ * `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259)) * `Governor`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by governors. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230)) * `TimelockController`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by timelocks. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230)) + * `Initializable`: add a reinitializer modifier that enables the initialization of new modules, added to already initialized contracts through upgradeability. ([#3232](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3232)) + * `Initializable`: add an Initialized event that tracks initialized version numbers. ([#3294](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3294)) ### Breaking changes diff --git a/contracts/proxy/utils/Initializable.sol b/contracts/proxy/utils/Initializable.sol index e6b2a4423..3ec66bb6e 100644 --- a/contracts/proxy/utils/Initializable.sol +++ b/contracts/proxy/utils/Initializable.sol @@ -66,6 +66,11 @@ abstract contract Initializable { */ bool private _initializing; + /** + * @dev Triggered when the contract has been initialized or reinitialized. + */ + event Initialized(uint8 version); + /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. @@ -78,6 +83,7 @@ abstract contract Initializable { _; if (isTopLevelCall) { _initializing = false; + emit Initialized(1); } } @@ -101,6 +107,7 @@ abstract contract Initializable { _; if (isTopLevelCall) { _initializing = false; + emit Initialized(version); } } diff --git a/test/proxy/utils/Initializable.test.js b/test/proxy/utils/Initializable.test.js index 1efb72850..9879b4820 100644 --- a/test/proxy/utils/Initializable.test.js +++ b/test/proxy/utils/Initializable.test.js @@ -1,4 +1,4 @@ -const { expectRevert } = require('@openzeppelin/test-helpers'); +const { expectEvent, expectRevert } = require('@openzeppelin/test-helpers'); const { expect } = require('chai'); const InitializableMock = artifacts.require('InitializableMock'); @@ -12,13 +12,13 @@ contract('Initializable', function (accounts) { this.contract = await InitializableMock.new(); }); - context('before initialize', function () { + describe('before initialize', function () { it('initializer has not run', async function () { expect(await this.contract.initializerRan()).to.equal(false); }); }); - context('after initialize', function () { + describe('after initialize', function () { beforeEach('initializing', async function () { await this.contract.initialize(); }); @@ -32,7 +32,7 @@ contract('Initializable', function (accounts) { }); }); - context('nested under an initializer', function () { + describe('nested under an initializer', function () { it('initializer modifier reverts', async function () { await expectRevert(this.contract.initializerNested(), 'Initializable: contract is already initialized'); }); @@ -108,6 +108,39 @@ contract('Initializable', function (accounts) { }); }); + describe('events', function () { + it('constructor initialization emits event', async function () { + const contract = await ConstructorInitializableMock.new(); + + await expectEvent.inTransaction(contract.transactionHash, contract, 'Initialized', { version: '1' }); + }); + + it('initialization emits event', async function () { + const contract = await ReinitializerMock.new(); + + const { receipt } = await contract.initialize(); + expect(receipt.logs.filter(({ event }) => event === 'Initialized').length).to.be.equal(1); + expectEvent(receipt, 'Initialized', { version: '1' }); + }); + + it('reinitialization emits event', async function () { + const contract = await ReinitializerMock.new(); + + const { receipt } = await contract.reinitialize(128); + expect(receipt.logs.filter(({ event }) => event === 'Initialized').length).to.be.equal(1); + expectEvent(receipt, 'Initialized', { version: '128' }); + }); + + it('chained reinitialization emits multiple events', async function () { + const contract = await ReinitializerMock.new(); + + const { receipt } = await contract.chainReinitialize(2, 3); + expect(receipt.logs.filter(({ event }) => event === 'Initialized').length).to.be.equal(2); + expectEvent(receipt, 'Initialized', { version: '2' }); + expectEvent(receipt, 'Initialized', { version: '3' }); + }); + }); + describe('complex testing with inheritance', function () { const mother = '12'; const gramps = '56'; From ae270b0d8931c587a987cf3a36e510906e305214 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 28 Mar 2022 22:48:28 +0200 Subject: [PATCH 26/81] Align data location of interface with implementation (#3295) Co-authored-by: chriseth Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + contracts/governance/IGovernor.sol | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 086c58cc2..80e962a15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147)) * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) * `Governor`: rewording of revert reason for consistency. ([#3275](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3275)) + * `Governor`: fix an inconsistency in data locations that could lead to invalid bytecode being produced. ([#3295](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3295)) * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) * `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196)) diff --git a/contracts/governance/IGovernor.sol b/contracts/governance/IGovernor.sol index abb75d2ee..6959825b8 100644 --- a/contracts/governance/IGovernor.sol +++ b/contracts/governance/IGovernor.sol @@ -111,9 +111,9 @@ abstract contract IGovernor is IERC165 { * @dev Hashing function used to (re)build the proposal id from the proposal details.. */ function hashProposal( - address[] calldata targets, - uint256[] calldata values, - bytes[] calldata calldatas, + address[] memory targets, + uint256[] memory values, + bytes[] memory calldatas, bytes32 descriptionHash ) public pure virtual returns (uint256); From 02fcc75bb7f35376c22def91b0fb9bc7a50b9458 Mon Sep 17 00:00:00 2001 From: S E R A Y A Date: Tue, 29 Mar 2022 11:15:43 +0200 Subject: [PATCH 27/81] Add ERC1155URIStorage (#3210) * Add ERC721URIStorage-like extension for ERC1155 * Add tests for ERC1155URIStorage extension * add changelog entry for ERC721URIStorage * Fix linting errors * Emit URI event in ERC1155URIStorage * Remove exists check and ERC1155Supply dependency * Fix lint error * Overwrite ERC1155 uri method * Update ERC1155URIStorage specs * Fix ERC1155URIStorageMock * Rename _setTokenURI => _setURI in ERC1155URIStorage * Add baseURI to ERC1155URIStorage * Move super.uri call in ERC1155URIStorage * Clearify ERC1155URIStorage description in change log * reorder changelog & add documentation * improve documentation * fix typo Co-authored-by: Hadrien Croubois --- CHANGELOG.md | 9 +-- contracts/mocks/ERC1155URIStorageMock.sol | 22 +++++++ contracts/token/ERC1155/README.adoc | 2 + .../ERC1155/extensions/ERC1155URIStorage.sol | 62 +++++++++++++++++ .../extensions/ERC1155URIStorage.test.js | 66 +++++++++++++++++++ 5 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 contracts/mocks/ERC1155URIStorageMock.sol create mode 100644 contracts/token/ERC1155/extensions/ERC1155URIStorage.sol create mode 100644 test/token/ERC1155/extensions/ERC1155URIStorage.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 80e962a15..5fbf6f5cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,18 +5,19 @@ * `AccessControl`: add a virtual `_checkRole(bytes32)` function that can be overridden to alter the `onlyRole` modifier behavior. ([#3137](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3137)) * `EnumerableMap`: add new `AddressToUintMap` map type. ([#3150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3150)) * `EnumerableMap`: add new `Bytes32ToBytes32Map` map type. ([#3192](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3192)) + * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) + * `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259)) + * `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196)) * `ERC1155`: Add a `_afterTokenTransfer` hook for improved extensibility. ([#3166](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3166)) + * `ERC1155URIStorage`: add a new extension that implements a `_setURI` behavior similar to ERC721's `_setTokenURI`. ([#3210](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3210)) * `DoubleEndedQueue`: a new data structure that supports efficient push and pop to both front and back, useful for FIFO and LIFO queues. ([#3153](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3153)) * `Governor`: improved security of `onlyGovernance` modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. ([#3147](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3147)) * `Governor`: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. The `params` argument added to `_countVote` method, and included in the newly added `_getVotes` method, can be used by counting and voting modules respectively for such purposes. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) * `Governor`: rewording of revert reason for consistency. ([#3275](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3275)) * `Governor`: fix an inconsistency in data locations that could lead to invalid bytecode being produced. ([#3295](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3295)) - * `ERC20FlashMint`: support infinite allowance when paying back a flash loan. ([#3226](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3226)) - * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) - * `draft-ERC20Permit`: replace `immutable` with `constant` for `_PERMIT_TYPEHASH` since the `keccak256` of string literals is treated specially and the hash is evaluated at compile time. ([#3196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3196)) - * `ERC20Wrapper`: the `decimals()` function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. ([#3259](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3259)) * `Governor`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by governors. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230)) * `TimelockController`: Implement `IERC721Receiver` and `IERC1155Receiver` to improve token custody by timelocks. ([#3230](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3230)) + * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) * `Initializable`: add a reinitializer modifier that enables the initialization of new modules, added to already initialized contracts through upgradeability. ([#3232](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3232)) * `Initializable`: add an Initialized event that tracks initialized version numbers. ([#3294](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3294)) diff --git a/contracts/mocks/ERC1155URIStorageMock.sol b/contracts/mocks/ERC1155URIStorageMock.sol new file mode 100644 index 000000000..e3cbce4f5 --- /dev/null +++ b/contracts/mocks/ERC1155URIStorageMock.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "./ERC1155Mock.sol"; +import "../token/ERC1155/extensions/ERC1155URIStorage.sol"; + +contract ERC1155URIStorageMock is ERC1155Mock, ERC1155URIStorage { + constructor(string memory _uri) ERC1155Mock(_uri) {} + + function uri(uint256 tokenId) public view virtual override(ERC1155, ERC1155URIStorage) returns (string memory) { + return ERC1155URIStorage.uri(tokenId); + } + + function setURI(uint256 tokenId, string memory _tokenURI) public { + _setURI(tokenId, _tokenURI); + } + + function setBaseURI(string memory baseURI) public { + _setBaseURI(baseURI); + } +} diff --git a/contracts/token/ERC1155/README.adoc b/contracts/token/ERC1155/README.adoc index 2e0b22bae..13ffbdbdd 100644 --- a/contracts/token/ERC1155/README.adoc +++ b/contracts/token/ERC1155/README.adoc @@ -36,6 +36,8 @@ NOTE: This core set of contracts is designed to be unopinionated, allowing devel {{ERC1155Supply}} +{{ERC1155URIStorage}} + == Presets These contracts are preconfigured combinations of the above features. They can be used through inheritance or as models to copy and paste their source code. diff --git a/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol b/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol new file mode 100644 index 000000000..42ecce7fd --- /dev/null +++ b/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "../../../utils/Strings.sol"; +import "../ERC1155.sol"; + +/** + * @dev ERC1155 token with storage based token URI management. + * Inspired by the ERC721URIStorage extension + * + * _Available since v4.6._ + */ +abstract contract ERC1155URIStorage is ERC1155 { + using Strings for uint256; + + // Optional base URI + string private _baseURI = ""; + + // Optional mapping for token URIs + mapping(uint256 => string) private _tokenURIs; + + /** + * @dev See {IERC1155MetadataURI-uri}. + * + * This implementation returns the concatenation of the `_baseURI` + * and the token-specific uri if the latter is set + * + * This enables the following behaviors: + * + * - if `_tokenURIs[tokenId]` is set, then the result is the concatenation + * of `_baseURI` and `_tokenURIs[tokenId]` (keep in mind that `_baseURI` + * is empty per default); + * + * - if `_tokenURIs[tokenId]` is NOT set then we fallback to `super.uri()` + * which in most cases will contain `ERC1155._uri`; + * + * - if `_tokenURIs[tokenId]` is NOT set, and if the parents do not have a + * uri value set, then the result is empty. + */ + function uri(uint256 tokenId) public view virtual override returns (string memory) { + string memory tokenURI = _tokenURIs[tokenId]; + + // If token URI is set, concatenate base URI and tokenURI (via abi.encodePacked). + return bytes(tokenURI).length > 0 ? string(abi.encodePacked(_baseURI, tokenURI)) : super.uri(tokenId); + } + + /** + * @dev Sets `tokenURI` as the tokenURI of `tokenId`. + */ + function _setURI(uint256 tokenId, string memory tokenURI) internal virtual { + _tokenURIs[tokenId] = tokenURI; + emit URI(uri(tokenId), tokenId); + } + + /** + * @dev Sets `baseURI` as the `_baseURI` for all tokens + */ + function _setBaseURI(string memory baseURI) internal virtual { + _baseURI = baseURI; + } +} diff --git a/test/token/ERC1155/extensions/ERC1155URIStorage.test.js b/test/token/ERC1155/extensions/ERC1155URIStorage.test.js new file mode 100644 index 000000000..7ba7e5662 --- /dev/null +++ b/test/token/ERC1155/extensions/ERC1155URIStorage.test.js @@ -0,0 +1,66 @@ +const { BN, expectEvent } = require('@openzeppelin/test-helpers'); + +const { expect } = require('chai'); +const { artifacts } = require('hardhat'); + +const ERC1155URIStorageMock = artifacts.require('ERC1155URIStorageMock'); + +contract(['ERC1155URIStorage'], function (accounts) { + const [ holder ] = accounts; + + const erc1155Uri = 'https://token.com/nfts/'; + const baseUri = 'https://token.com/'; + + const tokenId = new BN('1'); + const amount = new BN('3000'); + + describe('with base uri set', function () { + beforeEach(async function () { + this.token = await ERC1155URIStorageMock.new(erc1155Uri); + this.token.setBaseURI(baseUri); + + await this.token.mint(holder, tokenId, amount, '0x'); + }); + + it('can request the token uri, returning the erc1155 uri if no token uri was set', async function () { + const receivedTokenUri = await this.token.uri(tokenId); + + expect(receivedTokenUri).to.be.equal(erc1155Uri); + }); + + it('can request the token uri, returning the concatenated uri if a token uri was set', async function () { + const tokenUri = '1234/'; + const receipt = await this.token.setURI(tokenId, tokenUri); + + const receivedTokenUri = await this.token.uri(tokenId); + + const expectedUri = `${baseUri}${tokenUri}`; + expect(receivedTokenUri).to.be.equal(expectedUri); + expectEvent(receipt, 'URI', { value: expectedUri, id: tokenId }); + }); + }); + + describe('with base uri set to the empty string', function () { + beforeEach(async function () { + this.token = await ERC1155URIStorageMock.new(''); + + await this.token.mint(holder, tokenId, amount, '0x'); + }); + + it('can request the token uri, returning an empty string if no token uri was set', async function () { + const receivedTokenUri = await this.token.uri(tokenId); + + expect(receivedTokenUri).to.be.equal(''); + }); + + it('can request the token uri, returning the token uri if a token uri was set', async function () { + const tokenUri = 'ipfs://1234/'; + const receipt = await this.token.setURI(tokenId, tokenUri); + + const receivedTokenUri = await this.token.uri(tokenId); + + expect(receivedTokenUri).to.be.equal(tokenUri); + expectEvent(receipt, 'URI', { value: tokenUri, id: tokenId }); + }); + }); +}); From 668a648bc677740ab64eb26337de72544c4119ca Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 30 Mar 2022 16:41:04 +0200 Subject: [PATCH 28/81] Add utilities for CrossChain messaging (#3183) Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + contracts/access/AccessControlCrossChain.sol | 44 ++++++++ contracts/access/README.adoc | 2 + contracts/crosschain/CrossChainEnabled.sol | 53 +++++++++ contracts/crosschain/README.adoc | 34 ++++++ .../crosschain/amb/CrossChainEnabledAMB.sol | 47 ++++++++ contracts/crosschain/amb/LibAMB.sol | 34 ++++++ .../arbitrum/CrossChainEnabledArbitrumL1.sol | 43 ++++++++ .../arbitrum/CrossChainEnabledArbitrumL2.sol | 34 ++++++ .../crosschain/arbitrum/LibArbitrumL1.sol | 42 ++++++++ .../crosschain/arbitrum/LibArbitrumL2.sol | 42 ++++++++ contracts/crosschain/errors.sol | 6 ++ .../optimism/CrossChainEnabledOptimism.sol | 40 +++++++ contracts/crosschain/optimism/LibOptimism.sol | 35 ++++++ .../polygon/CrossChainEnabledPolygonChild.sol | 71 ++++++++++++ .../extensions/GovernorTimelockCompound.sol | 55 +--------- .../mocks/AccessControlCrossChainMock.sol | 22 ++++ contracts/mocks/crosschain/bridges.sol | 102 ++++++++++++++++++ contracts/mocks/crosschain/receivers.sol | 46 ++++++++ contracts/vendor/amb/IAMB.sol | 48 +++++++++ contracts/vendor/arbitrum/IArbSys.sol | 98 +++++++++++++++++ contracts/vendor/arbitrum/IBridge.sol | 65 +++++++++++ contracts/vendor/arbitrum/IInbox.sol | 91 ++++++++++++++++ .../vendor/arbitrum/IMessageProvider.sol | 25 +++++ contracts/vendor/arbitrum/IOutbox.sol | 50 +++++++++ .../vendor/compound/ICompoundTimelock.sol | 85 +++++++++++++++ contracts/vendor/compound/LICENSE | 11 ++ .../vendor/optimism/ICrossDomainMessenger.sol | 37 +++++++ contracts/vendor/optimism/LICENSE | 22 ++++ .../vendor/polygon/IFxMessageProcessor.sol | 10 ++ package.json | 2 +- test/access/AccessControlCrossChain.test.js | 59 ++++++++++ test/crosschain/CrossChainEnabled.test.js | 83 ++++++++++++++ test/helpers/crosschain.js | 63 +++++++++++ test/helpers/customError.js | 24 +++++ test/utils/structs/DoubleEndedQueue.test.js | 24 ++--- 36 files changed, 1477 insertions(+), 73 deletions(-) create mode 100644 contracts/access/AccessControlCrossChain.sol create mode 100644 contracts/crosschain/CrossChainEnabled.sol create mode 100644 contracts/crosschain/README.adoc create mode 100644 contracts/crosschain/amb/CrossChainEnabledAMB.sol create mode 100644 contracts/crosschain/amb/LibAMB.sol create mode 100644 contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol create mode 100644 contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol create mode 100644 contracts/crosschain/arbitrum/LibArbitrumL1.sol create mode 100644 contracts/crosschain/arbitrum/LibArbitrumL2.sol create mode 100644 contracts/crosschain/errors.sol create mode 100644 contracts/crosschain/optimism/CrossChainEnabledOptimism.sol create mode 100644 contracts/crosschain/optimism/LibOptimism.sol create mode 100644 contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol create mode 100644 contracts/mocks/AccessControlCrossChainMock.sol create mode 100644 contracts/mocks/crosschain/bridges.sol create mode 100644 contracts/mocks/crosschain/receivers.sol create mode 100644 contracts/vendor/amb/IAMB.sol create mode 100644 contracts/vendor/arbitrum/IArbSys.sol create mode 100644 contracts/vendor/arbitrum/IBridge.sol create mode 100644 contracts/vendor/arbitrum/IInbox.sol create mode 100644 contracts/vendor/arbitrum/IMessageProvider.sol create mode 100644 contracts/vendor/arbitrum/IOutbox.sol create mode 100644 contracts/vendor/compound/ICompoundTimelock.sol create mode 100644 contracts/vendor/compound/LICENSE create mode 100644 contracts/vendor/optimism/ICrossDomainMessenger.sol create mode 100644 contracts/vendor/optimism/LICENSE create mode 100644 contracts/vendor/polygon/IFxMessageProcessor.sol create mode 100644 test/access/AccessControlCrossChain.test.js create mode 100644 test/crosschain/CrossChainEnabled.test.js create mode 100644 test/helpers/crosschain.js create mode 100644 test/helpers/customError.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fbf6f5cd..2ae2da67e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased + * `crosschain`: Add a new set of contracts for cross-chain applications. `CrossChainEnabled` is a base contract with instantiations for several chains and bridges, and `AccessControlCrossChain` is an extension of access control that allows cross-chain operation. ([#3183](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3183)) * `AccessControl`: add a virtual `_checkRole(bytes32)` function that can be overridden to alter the `onlyRole` modifier behavior. ([#3137](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3137)) * `EnumerableMap`: add new `AddressToUintMap` map type. ([#3150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3150)) * `EnumerableMap`: add new `Bytes32ToBytes32Map` map type. ([#3192](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3192)) diff --git a/contracts/access/AccessControlCrossChain.sol b/contracts/access/AccessControlCrossChain.sol new file mode 100644 index 000000000..21e425150 --- /dev/null +++ b/contracts/access/AccessControlCrossChain.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "./AccessControl.sol"; +import "../crosschain/CrossChainEnabled.sol"; + +/** + * @dev An extension to {AccessControl} with support for cross-chain access management. + * For each role, is extension implements an equivalent "aliased" role that is used for + * restricting calls originating from other chains. + * + * For example, if a function `myFunction` is protected by `onlyRole(SOME_ROLE)`, and + * if an address `x` has role `SOME_ROLE`, it would be able to call `myFunction` directly. + * A wallet or contract at the same address on another chain would however not be able + * to call this function. In order to do so, it would require to have the role + * `_crossChainRoleAlias(SOME_ROLE)`. + * + * This aliasing is required to protect against multiple contracts living at the same + * address on different chains but controlled by conflicting entities. + * + * _Available since v4.6._ + */ +abstract contract AccessControlCrossChain is AccessControl, CrossChainEnabled { + bytes32 public constant CROSSCHAIN_ALIAS = keccak256("CROSSCHAIN_ALIAS"); + + /** + * @dev See {AccessControl-_checkRole}. + */ + function _checkRole(bytes32 role) internal view virtual override { + if (_isCrossChain()) { + _checkRole(_crossChainRoleAlias(role), _crossChainSender()); + } else { + super._checkRole(role); + } + } + + /** + * @dev Returns the aliased role corresponding to `role`. + */ + function _crossChainRoleAlias(bytes32 role) internal pure virtual returns (bytes32) { + return role ^ CROSSCHAIN_ALIAS; + } +} diff --git a/contracts/access/README.adoc b/contracts/access/README.adoc index 2e84c09ad..0959e1a73 100644 --- a/contracts/access/README.adoc +++ b/contracts/access/README.adoc @@ -16,6 +16,8 @@ This directory provides ways to restrict who can access the functions of a contr {{AccessControl}} +{{AccessControlCrossChain}} + {{IAccessControlEnumerable}} {{AccessControlEnumerable}} diff --git a/contracts/crosschain/CrossChainEnabled.sol b/contracts/crosschain/CrossChainEnabled.sol new file mode 100644 index 000000000..cd30a679a --- /dev/null +++ b/contracts/crosschain/CrossChainEnabled.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "./errors.sol"; + +/** + * @dev Provides information for building cross-chain aware contracts. This + * abstract contract provides accessors and modifiers to control the execution + * flow when receiving cross-chain messages. + * + * Actual implementations of cross-chain aware contracts, which are based on + * this abstraction, will have to inherit from a bridge-specific + * specialization. Such specializations are provided under + * `crosschain//CrossChainEnabled.sol`. + * + * _Available since v4.6._ + */ +abstract contract CrossChainEnabled { + /** + * @dev Throws if the current function call is not the result of a + * cross-chain execution. + */ + modifier onlyCrossChain() { + if (!_isCrossChain()) revert NotCrossChainCall(); + _; + } + + /** + * @dev Throws if the current function call is not the result of a + * cross-chain execution initiated by `account`. + */ + modifier onlyCrossChainSender(address expected) { + address actual = _crossChainSender(); + if (expected != actual) revert InvalidCrossChainSender(actual, expected); + _; + } + + /** + * @dev Returns whether the current function call is the result of a + * cross-chain message. + */ + function _isCrossChain() internal view virtual returns (bool); + + /** + * @dev Returns the address of the sender of the cross-chain message that + * triggered the current function call. + * + * IMPORTANT: Should revert with `NotCrossChainCall` if the current function + * call is not the result of a cross-chain message. + */ + function _crossChainSender() internal view virtual returns (address); +} diff --git a/contracts/crosschain/README.adoc b/contracts/crosschain/README.adoc new file mode 100644 index 000000000..2fce20320 --- /dev/null +++ b/contracts/crosschain/README.adoc @@ -0,0 +1,34 @@ += Cross Chain Awareness + +[.readme-notice] +NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/crosschain + +This directory provides building blocks to improve cross-chain awareness of smart contracts. + +- {CrossChainEnabled} is an abstraction that contains accessors and modifiers to control the execution flow when receiving cross-chain messages. + +== CrossChainEnabled specializations + +The following specializations of {CrossChainEnabled} provide implementations of the {CrossChainEnabled} abstraction for specific bridges. This can be used to complexe cross-chain aware components such as {AccessControlCrossChain}. + +{{CrossChainEnabledAMB}} + +{{CrossChainEnabledArbitrumL1}} + +{{CrossChainEnabledArbitrumL2}} + +{{CrossChainEnabledOptimism}} + +{{CrossChainEnabledPolygonChild}} + +== Libraries for cross-chain + +In addition to the {CrossChainEnable} abstraction, cross-chain awareness is also available through libraries. These libraries can be used to build complex designs such as contracts with the ability to interact with multiple bridges. + +{{LibAMB}} + +{{LibArbitrumL1}} + +{{LibArbitrumL2}} + +{{LibOptimism}} diff --git a/contracts/crosschain/amb/CrossChainEnabledAMB.sol b/contracts/crosschain/amb/CrossChainEnabledAMB.sol new file mode 100644 index 000000000..445f04780 --- /dev/null +++ b/contracts/crosschain/amb/CrossChainEnabledAMB.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "../CrossChainEnabled.sol"; +import "./LibAMB.sol"; + +/** + * @dev [AMB](https://docs.tokenbridge.net/amb-bridge/about-amb-bridge) + * specialization or the {CrossChainEnabled} abstraction. + * + * As of february 2020, AMB bridges are available between the following chains: + * - [ETH <> xDai](https://docs.tokenbridge.net/eth-xdai-amb-bridge/about-the-eth-xdai-amb) + * - [ETH <> qDai](https://docs.tokenbridge.net/eth-qdai-bridge/about-the-eth-qdai-amb) + * - [ETH <> ETC](https://docs.tokenbridge.net/eth-etc-amb-bridge/about-the-eth-etc-amb) + * - [ETH <> BSC](https://docs.tokenbridge.net/eth-bsc-amb/about-the-eth-bsc-amb) + * - [ETH <> POA](https://docs.tokenbridge.net/eth-poa-amb-bridge/about-the-eth-poa-amb) + * - [BSC <> xDai](https://docs.tokenbridge.net/bsc-xdai-amb/about-the-bsc-xdai-amb) + * - [POA <> xDai](https://docs.tokenbridge.net/poa-xdai-amb/about-the-poa-xdai-amb) + * - [Rinkeby <> xDai](https://docs.tokenbridge.net/rinkeby-xdai-amb-bridge/about-the-rinkeby-xdai-amb) + * - [Kovan <> Sokol](https://docs.tokenbridge.net/kovan-sokol-amb-bridge/about-the-kovan-sokol-amb) + * + * _Available since v4.6._ + */ +contract CrossChainEnabledAMB is CrossChainEnabled { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable + address private immutable _bridge; + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor(address bridge) { + _bridge = bridge; + } + + /** + * @dev see {CrossChainEnabled-_isCrossChain} + */ + function _isCrossChain() internal view virtual override returns (bool) { + return LibAMB.isCrossChain(_bridge); + } + + /** + * @dev see {CrossChainEnabled-_crossChainSender} + */ + function _crossChainSender() internal view virtual override onlyCrossChain returns (address) { + return LibAMB.crossChainSender(_bridge); + } +} diff --git a/contracts/crosschain/amb/LibAMB.sol b/contracts/crosschain/amb/LibAMB.sol new file mode 100644 index 000000000..74ee922bf --- /dev/null +++ b/contracts/crosschain/amb/LibAMB.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import {IAMB as AMB_Bridge} from "../../vendor/amb/IAMB.sol"; +import "../errors.sol"; + +/** + * @dev Primitives for cross-chain aware contracts using the + * [AMB](https://docs.tokenbridge.net/amb-bridge/about-amb-bridge) + * family of bridges. + */ +library LibAMB { + /** + * @dev Returns whether the current function call is the result of a + * cross-chain message relayed by `bridge`. + */ + function isCrossChain(address bridge) internal view returns (bool) { + return msg.sender == bridge; + } + + /** + * @dev Returns the address of the sender that triggered the current + * cross-chain message through `bridge`. + * + * NOTE: {isCrossChain} should be checked before trying to recover the + * sender, as it will revert with `NotCrossChainCall` if the current + * function call is not the result of a cross-chain message. + */ + function crossChainSender(address bridge) internal view returns (address) { + if (!isCrossChain(bridge)) revert NotCrossChainCall(); + return AMB_Bridge(bridge).messageSender(); + } +} diff --git a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol new file mode 100644 index 000000000..69c5abd56 --- /dev/null +++ b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "../CrossChainEnabled.sol"; +import "./LibArbitrumL1.sol"; + +/** + * @dev [Arbitrum](https://arbitrum.io/) specialization or the + * {CrossChainEnabled} abstraction the L1 side (mainnet). + * + * This version should only be deployed on L1 to process cross-chain messages + * originating from L2. For the other side, use {CrossChainEnabledArbitrumL2}. + * + * The bridge contract is provided and maintained by the arbitrum team. You can + * find the address of this contract on the rinkeby testnet in + * [Arbitrum's developer documentation](https://developer.offchainlabs.com/docs/useful_addresses). + * + * _Available since v4.6._ + */ +abstract contract CrossChainEnabledArbitrumL1 is CrossChainEnabled { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable + address private immutable _bridge; + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor(address bridge) { + _bridge = bridge; + } + + /** + * @dev see {CrossChainEnabled-_isCrossChain} + */ + function _isCrossChain() internal view virtual override returns (bool) { + return LibArbitrumL1.isCrossChain(_bridge); + } + + /** + * @dev see {CrossChainEnabled-_crossChainSender} + */ + function _crossChainSender() internal view virtual override onlyCrossChain returns (address) { + return LibArbitrumL1.crossChainSender(_bridge); + } +} diff --git a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol new file mode 100644 index 000000000..061862efd --- /dev/null +++ b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "../CrossChainEnabled.sol"; +import "./LibArbitrumL2.sol"; + +/** + * @dev [Arbitrum](https://arbitrum.io/) specialization or the + * {CrossChainEnabled} abstraction the L2 side (arbitrum). + * + * This version should only be deployed on L2 to process cross-chain messages + * originating from L1. For the other side, use {CrossChainEnabledArbitrumL1}. + * + * Arbitrum L2 includes the `ArbSys` contract at a fixed address. Therefore, + * this specialization of {CrossChainEnabled} does not include a constructor. + * + * _Available since v4.6._ + */ +abstract contract CrossChainEnabledArbitrumL2 is CrossChainEnabled { + /** + * @dev see {CrossChainEnabled-_isCrossChain} + */ + function _isCrossChain() internal view virtual override returns (bool) { + return LibArbitrumL2.isCrossChain(LibArbitrumL2.ARBSYS); + } + + /** + * @dev see {CrossChainEnabled-_crossChainSender} + */ + function _crossChainSender() internal view virtual override onlyCrossChain returns (address) { + return LibArbitrumL2.crossChainSender(LibArbitrumL2.ARBSYS); + } +} diff --git a/contracts/crosschain/arbitrum/LibArbitrumL1.sol b/contracts/crosschain/arbitrum/LibArbitrumL1.sol new file mode 100644 index 000000000..55c9a50d4 --- /dev/null +++ b/contracts/crosschain/arbitrum/LibArbitrumL1.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import {IBridge as ArbitrumL1_Bridge} from "../../vendor/arbitrum/IBridge.sol"; +import {IInbox as ArbitrumL1_Inbox} from "../../vendor/arbitrum/IInbox.sol"; +import {IOutbox as ArbitrumL1_Outbox} from "../../vendor/arbitrum/IOutbox.sol"; +import "../errors.sol"; + +/** + * @dev Primitives for cross-chain aware contracts for + * [Arbitrum](https://arbitrum.io/). + * + * This version should only be used on L1 to process cross-chain messages + * originating from L2. For the other side, use {LibArbitrumL2}. + */ +library LibArbitrumL1 { + /** + * @dev Returns whether the current function call is the result of a + * cross-chain message relayed by the `bridge`. + */ + function isCrossChain(address bridge) internal view returns (bool) { + return msg.sender == bridge; + } + + /** + * @dev Returns the address of the sender that triggered the current + * cross-chain message through the `bridge`. + * + * NOTE: {isCrossChain} should be checked before trying to recover the + * sender, as it will revert with `NotCrossChainCall` if the current + * function call is not the result of a cross-chain message. + */ + function crossChainSender(address bridge) internal view returns (address) { + if (!isCrossChain(bridge)) revert NotCrossChainCall(); + + address sender = ArbitrumL1_Outbox(ArbitrumL1_Bridge(bridge).activeOutbox()).l2ToL1Sender(); + require(sender != address(0), "LibArbitrumL1: system messages without sender"); + + return sender; + } +} diff --git a/contracts/crosschain/arbitrum/LibArbitrumL2.sol b/contracts/crosschain/arbitrum/LibArbitrumL2.sol new file mode 100644 index 000000000..c8a6f541a --- /dev/null +++ b/contracts/crosschain/arbitrum/LibArbitrumL2.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import {IArbSys as ArbitrumL2_Bridge} from "../../vendor/arbitrum/IArbSys.sol"; +import "../errors.sol"; + +/** + * @dev Primitives for cross-chain aware contracts for + * [Arbitrum](https://arbitrum.io/). + * + * This version should only be used on L2 to process cross-chain messages + * originating from L1. For the other side, use {LibArbitrumL1}. + */ +library LibArbitrumL2 { + /** + * @dev Returns whether the current function call is the result of a + * cross-chain message relayed by `arbsys`. + */ + address public constant ARBSYS = 0x0000000000000000000000000000000000000064; + + function isCrossChain(address arbsys) internal view returns (bool) { + return ArbitrumL2_Bridge(arbsys).isTopLevelCall(); + } + + /** + * @dev Returns the address of the sender that triggered the current + * cross-chain message through `arbsys`. + * + * NOTE: {isCrossChain} should be checked before trying to recover the + * sender, as it will revert with `NotCrossChainCall` if the current + * function call is not the result of a cross-chain message. + */ + function crossChainSender(address arbsys) internal view returns (address) { + if (!isCrossChain(arbsys)) revert NotCrossChainCall(); + + return + ArbitrumL2_Bridge(arbsys).wasMyCallersAddressAliased() + ? ArbitrumL2_Bridge(arbsys).myCallersAddressWithoutAliasing() + : msg.sender; + } +} diff --git a/contracts/crosschain/errors.sol b/contracts/crosschain/errors.sol new file mode 100644 index 000000000..fcc947784 --- /dev/null +++ b/contracts/crosschain/errors.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +error NotCrossChainCall(); +error InvalidCrossChainSender(address actual, address expected); diff --git a/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol b/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol new file mode 100644 index 000000000..fe3564cbf --- /dev/null +++ b/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "../CrossChainEnabled.sol"; +import "./LibOptimism.sol"; + +/** + * @dev [Optimism](https://www.optimism.io/) specialization or the + * {CrossChainEnabled} abstraction. + * + * The messenger (`CrossDomainMessenger`) contract is provided and maintained by + * the optimism team. You can find the address of this contract on mainnet and + * kovan in the [deployments section of Optimism monorepo](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/deployments). + * + * _Available since v4.6._ + */ +abstract contract CrossChainEnabledOptimism is CrossChainEnabled { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable + address private immutable _messenger; + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor(address messenger) { + _messenger = messenger; + } + + /** + * @dev see {CrossChainEnabled-_isCrossChain} + */ + function _isCrossChain() internal view virtual override returns (bool) { + return LibOptimism.isCrossChain(_messenger); + } + + /** + * @dev see {CrossChainEnabled-_crossChainSender} + */ + function _crossChainSender() internal view virtual override onlyCrossChain returns (address) { + return LibOptimism.crossChainSender(_messenger); + } +} diff --git a/contracts/crosschain/optimism/LibOptimism.sol b/contracts/crosschain/optimism/LibOptimism.sol new file mode 100644 index 000000000..3dfc5daf4 --- /dev/null +++ b/contracts/crosschain/optimism/LibOptimism.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import {ICrossDomainMessenger as Optimism_Bridge} from "../../vendor/optimism/ICrossDomainMessenger.sol"; +import "../errors.sol"; + +/** + * @dev Primitives for cross-chain aware contracts for [Optimism](https://www.optimism.io/). + * See the [documentation](https://community.optimism.io/docs/developers/bridge/messaging/#accessing-msg-sender) + * for the functionality used here. + */ +library LibOptimism { + /** + * @dev Returns whether the current function call is the result of a + * cross-chain message relayed by `messenger`. + */ + function isCrossChain(address messenger) internal view returns (bool) { + return msg.sender == messenger; + } + + /** + * @dev Returns the address of the sender that triggered the current + * cross-chain message through `messenger`. + * + * NOTE: {isCrossChain} should be checked before trying to recover the + * sender, as it will revert with `NotCrossChainCall` if the current + * function call is not the result of a cross-chain message. + */ + function crossChainSender(address messenger) internal view returns (address) { + if (!isCrossChain(messenger)) revert NotCrossChainCall(); + + return Optimism_Bridge(messenger).xDomainMessageSender(); + } +} diff --git a/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol b/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol new file mode 100644 index 000000000..e7555a3c8 --- /dev/null +++ b/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "../CrossChainEnabled.sol"; +import "../../security/ReentrancyGuard.sol"; +import "../../utils/Address.sol"; +import "../../vendor/polygon/IFxMessageProcessor.sol"; + +address constant DEFAULT_SENDER = 0x000000000000000000000000000000000000dEaD; + +/** + * @dev [Polygon](https://polygon.technology/) specialization or the + * {CrossChainEnabled} abstraction the child side (polygon/mumbai). + * + * This version should only be deployed on child chain to process cross-chain + * messages originating from the parent chain. + * + * The fxChild contract is provided and maintained by the polygon team. You can + * find the address of this contract polygon and mumbai in + * [Polygon's Fx-Portal documentation](https://docs.polygon.technology/docs/develop/l1-l2-communication/fx-portal/#contract-addresses). + * + * _Available since v4.6._ + */ +abstract contract CrossChainEnabledPolygonChild is IFxMessageProcessor, CrossChainEnabled, ReentrancyGuard { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable + address private immutable _fxChild; + address private _sender = DEFAULT_SENDER; + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor(address fxChild) { + _fxChild = fxChild; + } + + /** + * @dev see {CrossChainEnabled-_isCrossChain} + */ + function _isCrossChain() internal view virtual override returns (bool) { + return msg.sender == _fxChild; + } + + /** + * @dev see {CrossChainEnabled-_crossChainSender} + */ + function _crossChainSender() internal view virtual override onlyCrossChain returns (address) { + return _sender; + } + + /** + * @dev External entry point to receive and relay messages originating + * from the fxChild. + * + * Non-reentrancy is crucial to avoid a cross-chain call being able + * to impersonate anyone by just looping through this with user-defined + * arguments. + * + * Note: if _fxChild calls any other function that does a delegate-call, + * then security could be compromised. + */ + function processMessageFromRoot( + uint256, /* stateId */ + address rootMessageSender, + bytes calldata data + ) external override nonReentrant { + require(msg.sender == _fxChild, "unauthorized cross-chain relay"); + + _sender = rootMessageSender; + Address.functionDelegateCall(address(this), data, "crosschain execution failled"); + _sender = DEFAULT_SENDER; + } +} diff --git a/contracts/governance/extensions/GovernorTimelockCompound.sol b/contracts/governance/extensions/GovernorTimelockCompound.sol index d14489aa0..b6421b895 100644 --- a/contracts/governance/extensions/GovernorTimelockCompound.sol +++ b/contracts/governance/extensions/GovernorTimelockCompound.sol @@ -6,60 +6,7 @@ pragma solidity ^0.8.0; import "./IGovernorTimelock.sol"; import "../Governor.sol"; import "../../utils/math/SafeCast.sol"; - -/** - * https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol[Compound's timelock] interface - */ -interface ICompoundTimelock { - receive() external payable; - - // solhint-disable-next-line func-name-mixedcase - function GRACE_PERIOD() external view returns (uint256); - - // solhint-disable-next-line func-name-mixedcase - function MINIMUM_DELAY() external view returns (uint256); - - // solhint-disable-next-line func-name-mixedcase - function MAXIMUM_DELAY() external view returns (uint256); - - function admin() external view returns (address); - - function pendingAdmin() external view returns (address); - - function delay() external view returns (uint256); - - function queuedTransactions(bytes32) external view returns (bool); - - function setDelay(uint256) external; - - function acceptAdmin() external; - - function setPendingAdmin(address) external; - - function queueTransaction( - address target, - uint256 value, - string memory signature, - bytes memory data, - uint256 eta - ) external returns (bytes32); - - function cancelTransaction( - address target, - uint256 value, - string memory signature, - bytes memory data, - uint256 eta - ) external; - - function executeTransaction( - address target, - uint256 value, - string memory signature, - bytes memory data, - uint256 eta - ) external payable returns (bytes memory); -} +import "../../vendor/compound/ICompoundTimelock.sol"; /** * @dev Extension of {Governor} that binds the execution process to a Compound Timelock. This adds a delay, enforced by diff --git a/contracts/mocks/AccessControlCrossChainMock.sol b/contracts/mocks/AccessControlCrossChainMock.sol new file mode 100644 index 000000000..90adb740c --- /dev/null +++ b/contracts/mocks/AccessControlCrossChainMock.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "../access/AccessControlCrossChain.sol"; +import "../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol"; + +contract AccessControlCrossChainMock is AccessControlCrossChain, CrossChainEnabledArbitrumL2 { + constructor() { + _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); + } + + function setRoleAdmin(bytes32 roleId, bytes32 adminRoleId) public { + _setRoleAdmin(roleId, adminRoleId); + } + + function senderProtected(bytes32 roleId) public onlyRole(roleId) {} + + function crossChainRoleAlias(bytes32 role) public pure virtual returns (bytes32) { + return _crossChainRoleAlias(role); + } +} diff --git a/contracts/mocks/crosschain/bridges.sol b/contracts/mocks/crosschain/bridges.sol new file mode 100644 index 000000000..5b9d20358 --- /dev/null +++ b/contracts/mocks/crosschain/bridges.sol @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "../../utils/Address.sol"; +import "../../vendor/polygon/IFxMessageProcessor.sol"; + +abstract contract BaseRelayMock { + // needed to parse custom errors + error NotCrossChainCall(); + error InvalidCrossChainSender(address sender, address expected); + + address internal _currentSender; + + function relayAs( + address target, + bytes calldata data, + address sender + ) external virtual { + address previousSender = _currentSender; + + _currentSender = sender; + + (bool success, bytes memory returndata) = target.call(data); + Address.verifyCallResult(success, returndata, "low-level call reverted"); + + _currentSender = previousSender; + } +} + +/** + * AMB + */ +contract BridgeAMBMock is BaseRelayMock { + function messageSender() public view returns (address) { + return _currentSender; + } +} + +/** + * Arbitrum + */ +contract BridgeArbitrumL1Mock is BaseRelayMock { + address public immutable inbox = address(new BridgeArbitrumL1Inbox()); + address public immutable outbox = address(new BridgeArbitrumL1Outbox()); + + function activeOutbox() public view returns (address) { + return outbox; + } + + function currentSender() public view returns (address) { + return _currentSender; + } +} + +contract BridgeArbitrumL1Inbox { + address public immutable bridge = msg.sender; +} + +contract BridgeArbitrumL1Outbox { + address public immutable bridge = msg.sender; + + function l2ToL1Sender() public view returns (address) { + return BridgeArbitrumL1Mock(bridge).currentSender(); + } +} + +contract BridgeArbitrumL2Mock is BaseRelayMock { + function isTopLevelCall() public view returns (bool) { + return _currentSender != address(0); + } + + function wasMyCallersAddressAliased() public pure returns (bool) { + return true; + } + + function myCallersAddressWithoutAliasing() public view returns (address) { + return _currentSender; + } +} + +/** + * Optimism + */ +contract BridgeOptimismMock is BaseRelayMock { + function xDomainMessageSender() public view returns (address) { + return _currentSender; + } +} + +/** + * Polygon + */ +contract BridgePolygonChildMock is BaseRelayMock { + function relayAs( + address target, + bytes calldata data, + address sender + ) external override { + IFxMessageProcessor(target).processMessageFromRoot(0, sender, data); + } +} diff --git a/contracts/mocks/crosschain/receivers.sol b/contracts/mocks/crosschain/receivers.sol new file mode 100644 index 000000000..57b9b5d7e --- /dev/null +++ b/contracts/mocks/crosschain/receivers.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.4; + +import "../../access/Ownable.sol"; +import "../../crosschain/amb/CrossChainEnabledAMB.sol"; +import "../../crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol"; +import "../../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol"; +import "../../crosschain/optimism/CrossChainEnabledOptimism.sol"; +import "../../crosschain/polygon/CrossChainEnabledPolygonChild.sol"; + +abstract contract Receiver is Ownable, CrossChainEnabled { + function crossChainRestricted() external onlyCrossChain {} + + function crossChainOwnerRestricted() external onlyCrossChainSender(owner()) {} +} + +/** + * AMB + */ +contract CrossChainEnabledAMBMock is Receiver, CrossChainEnabledAMB { + constructor(address bridge) CrossChainEnabledAMB(bridge) {} +} + +/** + * Arbitrum + */ +contract CrossChainEnabledArbitrumL1Mock is Receiver, CrossChainEnabledArbitrumL1 { + constructor(address bridge) CrossChainEnabledArbitrumL1(bridge) {} +} + +contract CrossChainEnabledArbitrumL2Mock is Receiver, CrossChainEnabledArbitrumL2 {} + +/** + * Optimism + */ +contract CrossChainEnabledOptimismMock is Receiver, CrossChainEnabledOptimism { + constructor(address bridge) CrossChainEnabledOptimism(bridge) {} +} + +/** + * Polygon + */ +contract CrossChainEnabledPolygonChildMock is Receiver, CrossChainEnabledPolygonChild { + constructor(address bridge) CrossChainEnabledPolygonChild(bridge) {} +} diff --git a/contracts/vendor/amb/IAMB.sol b/contracts/vendor/amb/IAMB.sol new file mode 100644 index 000000000..529913f7b --- /dev/null +++ b/contracts/vendor/amb/IAMB.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IAMB { + event UserRequestForAffirmation(bytes32 indexed messageId, bytes encodedData); + event UserRequestForSignature(bytes32 indexed messageId, bytes encodedData); + event AffirmationCompleted( + address indexed sender, + address indexed executor, + bytes32 indexed messageId, + bool status + ); + event RelayedMessage(address indexed sender, address indexed executor, bytes32 indexed messageId, bool status); + + function messageSender() external view returns (address); + + function maxGasPerTx() external view returns (uint256); + + function transactionHash() external view returns (bytes32); + + function messageId() external view returns (bytes32); + + function messageSourceChainId() external view returns (bytes32); + + function messageCallStatus(bytes32 _messageId) external view returns (bool); + + function failedMessageDataHash(bytes32 _messageId) external view returns (bytes32); + + function failedMessageReceiver(bytes32 _messageId) external view returns (address); + + function failedMessageSender(bytes32 _messageId) external view returns (address); + + function requireToPassMessage( + address _contract, + bytes calldata _data, + uint256 _gas + ) external returns (bytes32); + + function requireToConfirmMessage( + address _contract, + bytes calldata _data, + uint256 _gas + ) external returns (bytes32); + + function sourceChainId() external view returns (uint256); + + function destinationChainId() external view returns (uint256); +} diff --git a/contracts/vendor/arbitrum/IArbSys.sol b/contracts/vendor/arbitrum/IArbSys.sol new file mode 100644 index 000000000..3658e4660 --- /dev/null +++ b/contracts/vendor/arbitrum/IArbSys.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.4.21 <0.9.0; + +/** + * @title Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064. Exposes a variety of system-level functionality. + */ +interface IArbSys { + /** + * @notice Get internal version number identifying an ArbOS build + * @return version number as int + */ + function arbOSVersion() external pure returns (uint256); + + function arbChainID() external view returns (uint256); + + /** + * @notice Get Arbitrum block number (distinct from L1 block number; Arbitrum genesis block has block number 0) + * @return block number as int + */ + function arbBlockNumber() external view returns (uint256); + + /** + * @notice Send given amount of Eth to dest from sender. + * This is a convenience function, which is equivalent to calling sendTxToL1 with empty calldataForL1. + * @param destination recipient address on L1 + * @return unique identifier for this L2-to-L1 transaction. + */ + function withdrawEth(address destination) external payable returns (uint256); + + /** + * @notice Send a transaction to L1 + * @param destination recipient address on L1 + * @param calldataForL1 (optional) calldata for L1 contract call + * @return a unique identifier for this L2-to-L1 transaction. + */ + function sendTxToL1(address destination, bytes calldata calldataForL1) external payable returns (uint256); + + /** + * @notice get the number of transactions issued by the given external account or the account sequence number of the given contract + * @param account target account + * @return the number of transactions issued by the given external account or the account sequence number of the given contract + */ + function getTransactionCount(address account) external view returns (uint256); + + /** + * @notice get the value of target L2 storage slot + * This function is only callable from address 0 to prevent contracts from being able to call it + * @param account target account + * @param index target index of storage slot + * @return stotage value for the given account at the given index + */ + function getStorageAt(address account, uint256 index) external view returns (uint256); + + /** + * @notice check if current call is coming from l1 + * @return true if the caller of this was called directly from L1 + */ + function isTopLevelCall() external view returns (bool); + + /** + * @notice check if the caller (of this caller of this) is an aliased L1 contract address + * @return true iff the caller's address is an alias for an L1 contract address + */ + function wasMyCallersAddressAliased() external view returns (bool); + + /** + * @notice return the address of the caller (of this caller of this), without applying L1 contract address aliasing + * @return address of the caller's caller, without applying L1 contract address aliasing + */ + function myCallersAddressWithoutAliasing() external view returns (address); + + /** + * @notice map L1 sender contract address to its L2 alias + * @param sender sender address + * @param dest destination address + * @return aliased sender address + */ + function mapL1SenderContractAddressToL2Alias(address sender, address dest) external pure returns (address); + + /** + * @notice get the caller's amount of available storage gas + * @return amount of storage gas available to the caller + */ + function getStorageGasAvailable() external view returns (uint256); + + event L2ToL1Transaction( + address caller, + address indexed destination, + uint256 indexed uniqueId, + uint256 indexed batchNumber, + uint256 indexInBatch, + uint256 arbBlockNum, + uint256 ethBlockNum, + uint256 timestamp, + uint256 callvalue, + bytes data + ); +} diff --git a/contracts/vendor/arbitrum/IBridge.sol b/contracts/vendor/arbitrum/IBridge.sol new file mode 100644 index 000000000..631fce68f --- /dev/null +++ b/contracts/vendor/arbitrum/IBridge.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +pragma solidity ^0.8.0; + +interface IBridge { + event MessageDelivered( + uint256 indexed messageIndex, + bytes32 indexed beforeInboxAcc, + address inbox, + uint8 kind, + address sender, + bytes32 messageDataHash + ); + + event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data); + + event InboxToggle(address indexed inbox, bool enabled); + + event OutboxToggle(address indexed outbox, bool enabled); + + function deliverMessageToInbox( + uint8 kind, + address sender, + bytes32 messageDataHash + ) external payable returns (uint256); + + function executeCall( + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (bool success, bytes memory returnData); + + // These are only callable by the admin + function setInbox(address inbox, bool enabled) external; + + function setOutbox(address inbox, bool enabled) external; + + // View functions + + function activeOutbox() external view returns (address); + + function allowedInboxes(address inbox) external view returns (bool); + + function allowedOutboxes(address outbox) external view returns (bool); + + function inboxAccs(uint256 index) external view returns (bytes32); + + function messageCount() external view returns (uint256); +} diff --git a/contracts/vendor/arbitrum/IInbox.sol b/contracts/vendor/arbitrum/IInbox.sol new file mode 100644 index 000000000..462e24738 --- /dev/null +++ b/contracts/vendor/arbitrum/IInbox.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +pragma solidity ^0.8.0; + +import "./IMessageProvider.sol"; + +interface IInbox is IMessageProvider { + function sendL2Message(bytes calldata messageData) external returns (uint256); + + function sendUnsignedTransaction( + uint256 maxGas, + uint256 gasPriceBid, + uint256 nonce, + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (uint256); + + function sendContractTransaction( + uint256 maxGas, + uint256 gasPriceBid, + address destAddr, + uint256 amount, + bytes calldata data + ) external returns (uint256); + + function sendL1FundedUnsignedTransaction( + uint256 maxGas, + uint256 gasPriceBid, + uint256 nonce, + address destAddr, + bytes calldata data + ) external payable returns (uint256); + + function sendL1FundedContractTransaction( + uint256 maxGas, + uint256 gasPriceBid, + address destAddr, + bytes calldata data + ) external payable returns (uint256); + + function createRetryableTicket( + address destAddr, + uint256 arbTxCallValue, + uint256 maxSubmissionCost, + address submissionRefundAddress, + address valueRefundAddress, + uint256 maxGas, + uint256 gasPriceBid, + bytes calldata data + ) external payable returns (uint256); + + function createRetryableTicketNoRefundAliasRewrite( + address destAddr, + uint256 arbTxCallValue, + uint256 maxSubmissionCost, + address submissionRefundAddress, + address valueRefundAddress, + uint256 maxGas, + uint256 gasPriceBid, + bytes calldata data + ) external payable returns (uint256); + + function depositEth(uint256 maxSubmissionCost) external payable returns (uint256); + + function bridge() external view returns (address); + + function pauseCreateRetryables() external; + + function unpauseCreateRetryables() external; + + function startRewriteAddress() external; + + function stopRewriteAddress() external; +} diff --git a/contracts/vendor/arbitrum/IMessageProvider.sol b/contracts/vendor/arbitrum/IMessageProvider.sol new file mode 100644 index 000000000..76208e215 --- /dev/null +++ b/contracts/vendor/arbitrum/IMessageProvider.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +pragma solidity ^0.8.0; + +interface IMessageProvider { + event InboxMessageDelivered(uint256 indexed messageNum, bytes data); + + event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); +} diff --git a/contracts/vendor/arbitrum/IOutbox.sol b/contracts/vendor/arbitrum/IOutbox.sol new file mode 100644 index 000000000..9128a2049 --- /dev/null +++ b/contracts/vendor/arbitrum/IOutbox.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: Apache-2.0 + +/* + * Copyright 2021, Offchain Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +pragma solidity ^0.8.0; + +interface IOutbox { + event OutboxEntryCreated( + uint256 indexed batchNum, + uint256 outboxEntryIndex, + bytes32 outputRoot, + uint256 numInBatch + ); + event OutBoxTransactionExecuted( + address indexed destAddr, + address indexed l2Sender, + uint256 indexed outboxEntryIndex, + uint256 transactionIndex + ); + + function l2ToL1Sender() external view returns (address); + + function l2ToL1Block() external view returns (uint256); + + function l2ToL1EthBlock() external view returns (uint256); + + function l2ToL1Timestamp() external view returns (uint256); + + function l2ToL1BatchNum() external view returns (uint256); + + function l2ToL1OutputId() external view returns (bytes32); + + function processOutgoingMessages(bytes calldata sendsData, uint256[] calldata sendLengths) external; + + function outboxEntryExists(uint256 batchNum) external view returns (bool); +} diff --git a/contracts/vendor/compound/ICompoundTimelock.sol b/contracts/vendor/compound/ICompoundTimelock.sol new file mode 100644 index 000000000..1581a8daa --- /dev/null +++ b/contracts/vendor/compound/ICompoundTimelock.sol @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +/** + * https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol[Compound's timelock] interface + */ +interface ICompoundTimelock { + event NewAdmin(address indexed newAdmin); + event NewPendingAdmin(address indexed newPendingAdmin); + event NewDelay(uint256 indexed newDelay); + event CancelTransaction( + bytes32 indexed txHash, + address indexed target, + uint256 value, + string signature, + bytes data, + uint256 eta + ); + event ExecuteTransaction( + bytes32 indexed txHash, + address indexed target, + uint256 value, + string signature, + bytes data, + uint256 eta + ); + event QueueTransaction( + bytes32 indexed txHash, + address indexed target, + uint256 value, + string signature, + bytes data, + uint256 eta + ); + + receive() external payable; + + // solhint-disable-next-line func-name-mixedcase + function GRACE_PERIOD() external view returns (uint256); + + // solhint-disable-next-line func-name-mixedcase + function MINIMUM_DELAY() external view returns (uint256); + + // solhint-disable-next-line func-name-mixedcase + function MAXIMUM_DELAY() external view returns (uint256); + + function admin() external view returns (address); + + function pendingAdmin() external view returns (address); + + function delay() external view returns (uint256); + + function queuedTransactions(bytes32) external view returns (bool); + + function setDelay(uint256) external; + + function acceptAdmin() external; + + function setPendingAdmin(address) external; + + function queueTransaction( + address target, + uint256 value, + string memory signature, + bytes memory data, + uint256 eta + ) external returns (bytes32); + + function cancelTransaction( + address target, + uint256 value, + string memory signature, + bytes memory data, + uint256 eta + ) external; + + function executeTransaction( + address target, + uint256 value, + string memory signature, + bytes memory data, + uint256 eta + ) external payable returns (bytes memory); +} diff --git a/contracts/vendor/compound/LICENSE b/contracts/vendor/compound/LICENSE new file mode 100644 index 000000000..7da232470 --- /dev/null +++ b/contracts/vendor/compound/LICENSE @@ -0,0 +1,11 @@ +Copyright 2020 Compound Labs, Inc. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/contracts/vendor/optimism/ICrossDomainMessenger.sol b/contracts/vendor/optimism/ICrossDomainMessenger.sol new file mode 100644 index 000000000..be09e857d --- /dev/null +++ b/contracts/vendor/optimism/ICrossDomainMessenger.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT +pragma solidity >0.5.0 <0.9.0; + +/** + * @title ICrossDomainMessenger + */ +interface ICrossDomainMessenger { + /********** + * Events * + **********/ + + event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit); + event RelayedMessage(bytes32 indexed msgHash); + event FailedRelayedMessage(bytes32 indexed msgHash); + + /************* + * Variables * + *************/ + + function xDomainMessageSender() external view returns (address); + + /******************** + * Public Functions * + ********************/ + + /** + * Sends a cross domain message to the target messenger. + * @param _target Target contract address. + * @param _message Message to send to the target. + * @param _gasLimit Gas limit for the provided message. + */ + function sendMessage( + address _target, + bytes calldata _message, + uint32 _gasLimit + ) external; +} diff --git a/contracts/vendor/optimism/LICENSE b/contracts/vendor/optimism/LICENSE new file mode 100644 index 000000000..6a7da5218 --- /dev/null +++ b/contracts/vendor/optimism/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright 2020-2021 Optimism + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/contracts/vendor/polygon/IFxMessageProcessor.sol b/contracts/vendor/polygon/IFxMessageProcessor.sol new file mode 100644 index 000000000..cf346bc6b --- /dev/null +++ b/contracts/vendor/polygon/IFxMessageProcessor.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IFxMessageProcessor { + function processMessageFromRoot( + uint256 stateId, + address rootMessageSender, + bytes calldata data + ) external; +} diff --git a/package.json b/package.json index 2d9d0d515..e2c0b973f 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "test": "hardhat test", "test:inheritance": "node scripts/inheritanceOrdering artifacts/build-info/*", "gas-report": "env ENABLE_GAS_REPORT=true npm run test", - "slither": "npm run clean && slither . --detect reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas" + "slither": "npm run clean && slither . --detect reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas --filter-paths contracts/mocks" }, "repository": { "type": "git", diff --git a/test/access/AccessControlCrossChain.test.js b/test/access/AccessControlCrossChain.test.js new file mode 100644 index 000000000..cb4f3626d --- /dev/null +++ b/test/access/AccessControlCrossChain.test.js @@ -0,0 +1,59 @@ +const { expectRevert } = require('@openzeppelin/test-helpers'); +const { BridgeHelper } = require('../helpers/crosschain'); + +const { + shouldBehaveLikeAccessControl, +} = require('./AccessControl.behavior.js'); + +const crossChainRoleAlias = (role) => web3.utils.leftPad( + web3.utils.toHex(web3.utils.toBN(role).xor(web3.utils.toBN(web3.utils.soliditySha3('CROSSCHAIN_ALIAS')))), + 64, +); + +const AccessControlCrossChainMock = artifacts.require('AccessControlCrossChainMock'); + +const ROLE = web3.utils.soliditySha3('ROLE'); + +contract('AccessControl', function (accounts) { + before(async function () { + this.bridge = await BridgeHelper.deploy(); + }); + + beforeEach(async function () { + this.accessControl = await AccessControlCrossChainMock.new({ from: accounts[0] }); + }); + + shouldBehaveLikeAccessControl('AccessControl', ...accounts); + + describe('CrossChain enabled', function () { + beforeEach(async function () { + await this.accessControl.grantRole(ROLE, accounts[0], { from: accounts[0] }); + await this.accessControl.grantRole(crossChainRoleAlias(ROLE), accounts[1], { from: accounts[0] }); + }); + + it('check alliassing', async function () { + expect(await this.accessControl.crossChainRoleAlias(ROLE)).to.be.bignumber.equal(crossChainRoleAlias(ROLE)); + }); + + it('Crosschain calls not authorized to non-aliased addresses', async function () { + await expectRevert( + this.bridge.call( + accounts[0], + this.accessControl, + 'senderProtected', + [ ROLE ], + ), + `AccessControl: account ${accounts[0].toLowerCase()} is missing role ${crossChainRoleAlias(ROLE)}`, + ); + }); + + it('Crosschain calls not authorized to non-aliased addresses', async function () { + await this.bridge.call( + accounts[1], + this.accessControl, + 'senderProtected', + [ ROLE ], + ); + }); + }); +}); diff --git a/test/crosschain/CrossChainEnabled.test.js b/test/crosschain/CrossChainEnabled.test.js new file mode 100644 index 000000000..7e64d2980 --- /dev/null +++ b/test/crosschain/CrossChainEnabled.test.js @@ -0,0 +1,83 @@ +const { BridgeHelper } = require('../helpers/crosschain'); +const { expectRevertCustomError } = require('../helpers/customError'); + +function randomAddress () { + return web3.utils.toChecksumAddress(web3.utils.randomHex(20)); +} + +const CrossChainEnabledAMBMock = artifacts.require('CrossChainEnabledAMBMock'); +const CrossChainEnabledArbitrumL1Mock = artifacts.require('CrossChainEnabledArbitrumL1Mock'); +const CrossChainEnabledArbitrumL2Mock = artifacts.require('CrossChainEnabledArbitrumL2Mock'); +const CrossChainEnabledOptimismMock = artifacts.require('CrossChainEnabledOptimismMock'); +const CrossChainEnabledPolygonChildMock = artifacts.require('CrossChainEnabledPolygonChildMock'); + +function shouldBehaveLikeReceiver (sender = randomAddress()) { + it('should reject same-chain calls', async function () { + await expectRevertCustomError( + this.receiver.crossChainRestricted(), + 'NotCrossChainCall()', + ); + }); + + it('should restrict to cross-chain call from a invalid sender', async function () { + await expectRevertCustomError( + this.bridge.call(sender, this.receiver, 'crossChainOwnerRestricted()'), + `InvalidCrossChainSender("${sender}", "${await this.receiver.owner()}")`, + ); + }); + + it('should grant access to cross-chain call from the owner', async function () { + await this.bridge.call( + await this.receiver.owner(), + this.receiver, + 'crossChainOwnerRestricted()', + ); + }); +} + +contract('CrossChainEnabled', function () { + describe('AMB', function () { + beforeEach(async function () { + this.bridge = await BridgeHelper.deploy('AMB'); + this.receiver = await CrossChainEnabledAMBMock.new(this.bridge.address); + }); + + shouldBehaveLikeReceiver(); + }); + + describe('Arbitrum-L1', function () { + beforeEach(async function () { + this.bridge = await BridgeHelper.deploy('Arbitrum-L1'); + this.receiver = await CrossChainEnabledArbitrumL1Mock.new(this.bridge.address); + }); + + shouldBehaveLikeReceiver(); + }); + + describe('Arbitrum-L2', function () { + beforeEach(async function () { + this.bridge = await BridgeHelper.deploy('Arbitrum-L2'); + this.receiver = await CrossChainEnabledArbitrumL2Mock.new(this.bridge.address); + }); + + shouldBehaveLikeReceiver(); + }); + + describe('Optimism', function () { + beforeEach(async function () { + this.bridge = await BridgeHelper.deploy('Optimism'); + this.receiver = await CrossChainEnabledOptimismMock.new(this.bridge.address); + }); + + shouldBehaveLikeReceiver(); + }); + + describe('Polygon-Child', function () { + beforeEach(async function () { + this.bridge = await BridgeHelper.deploy('Polygon-Child'); + this.receiver = await CrossChainEnabledPolygonChildMock.new(this.bridge.address); + }); + + shouldBehaveLikeReceiver(); + }); +}); diff --git a/test/helpers/crosschain.js b/test/helpers/crosschain.js new file mode 100644 index 000000000..d4d25d1a1 --- /dev/null +++ b/test/helpers/crosschain.js @@ -0,0 +1,63 @@ +const { promisify } = require('util'); + +const BridgeAMBMock = artifacts.require('BridgeAMBMock'); +const BridgeArbitrumL1Mock = artifacts.require('BridgeArbitrumL1Mock'); +const BridgeArbitrumL2Mock = artifacts.require('BridgeArbitrumL2Mock'); +const BridgeOptimismMock = artifacts.require('BridgeOptimismMock'); +const BridgePolygonChildMock = artifacts.require('BridgePolygonChildMock'); + +class BridgeHelper { + static async deploy (type) { + return new BridgeHelper(await deployBridge(type)); + } + + constructor (bridge) { + this.bridge = bridge; + this.address = bridge.address; + } + + call (from, target, selector = undefined, args = []) { + return this.bridge.relayAs( + target.address || target, + selector + ? target.contract.methods[selector](...args).encodeABI() + : '0x', + from, + ); + } +} + +async function deployBridge (type = 'Arbitrum-L2') { + switch (type) { + case 'AMB': + return BridgeAMBMock.new(); + + case 'Arbitrum-L1': + return BridgeArbitrumL1Mock.new(); + + case 'Arbitrum-L2': { + const instance = await BridgeArbitrumL2Mock.new(); + const code = await web3.eth.getCode(instance.address); + await promisify(web3.currentProvider.send.bind(web3.currentProvider))({ + jsonrpc: '2.0', + method: 'hardhat_setCode', + params: [ '0x0000000000000000000000000000000000000064', code ], + id: new Date().getTime(), + }); + return BridgeArbitrumL2Mock.at('0x0000000000000000000000000000000000000064'); + } + + case 'Optimism': + return BridgeOptimismMock.new(); + + case 'Polygon-Child': + return BridgePolygonChildMock.new(); + + default: + throw new Error(`CrossChain: ${type} is not supported`); + } +} + +module.exports = { + BridgeHelper, +}; diff --git a/test/helpers/customError.js b/test/helpers/customError.js new file mode 100644 index 000000000..8fea43426 --- /dev/null +++ b/test/helpers/customError.js @@ -0,0 +1,24 @@ +const { config } = require('hardhat'); + +const optimizationsEnabled = config.solidity.compilers.some(c => c.settings.optimizer.enabled); + +/** Revert handler that supports custom errors. */ +async function expectRevertCustomError (promise, reason) { + try { + await promise; + expect.fail('Expected promise to throw but it didn\'t'); + } catch (revert) { + if (reason) { + if (optimizationsEnabled) { + // Optimizations currently mess with Hardhat's decoding of custom errors + expect(revert.message).to.include.oneOf([reason, 'unrecognized return data or custom error']); + } else { + expect(revert.message).to.include(reason); + } + } + } +}; + +module.exports = { + expectRevertCustomError, +}; diff --git a/test/utils/structs/DoubleEndedQueue.test.js b/test/utils/structs/DoubleEndedQueue.test.js index d1de09c33..545c82a72 100644 --- a/test/utils/structs/DoubleEndedQueue.test.js +++ b/test/utils/structs/DoubleEndedQueue.test.js @@ -1,5 +1,5 @@ const { expectEvent } = require('@openzeppelin/test-helpers'); -const { expect } = require('chai'); +const { expectRevertCustomError } = require('../../helpers/customError'); const Bytes32DequeMock = artifacts.require('Bytes32DequeMock'); @@ -10,18 +10,6 @@ async function getContent (deque) { return values; } -/** Revert handler that supports custom errors. */ -async function expectRevert (promise, reason) { - try { - await promise; - expect.fail('Expected promise to throw but it didn\'t'); - } catch (error) { - if (reason) { - expect(error.message).to.include(reason); - } - } -} - contract('DoubleEndedQueue', function (accounts) { const bytesA = '0xdeadbeef'.padEnd(66, '0'); const bytesB = '0x0123456789'.padEnd(66, '0'); @@ -39,10 +27,10 @@ contract('DoubleEndedQueue', function (accounts) { }); it('reverts on accesses', async function () { - await expectRevert(this.deque.popBack(), 'Empty()'); - await expectRevert(this.deque.popFront(), 'Empty()'); - await expectRevert(this.deque.back(), 'Empty()'); - await expectRevert(this.deque.front(), 'Empty()'); + await expectRevertCustomError(this.deque.popBack(), 'Empty()'); + await expectRevertCustomError(this.deque.popFront(), 'Empty()'); + await expectRevertCustomError(this.deque.back(), 'Empty()'); + await expectRevertCustomError(this.deque.front(), 'Empty()'); }); }); @@ -63,7 +51,7 @@ contract('DoubleEndedQueue', function (accounts) { }); it('out of bounds access', async function () { - await expectRevert(this.deque.at(this.content.length), 'OutOfBounds()'); + await expectRevertCustomError(this.deque.at(this.content.length), 'OutOfBounds()'); }); describe('push', function () { From e7719ded561aa33359484d3c5b934098f6c4c521 Mon Sep 17 00:00:00 2001 From: Jeff <33238297+lamothe-hub@users.noreply.github.com> Date: Wed, 30 Mar 2022 10:34:17 -0500 Subject: [PATCH 29/81] Match IERC721 function order with EIP spec (#3287) --- contracts/token/ERC721/IERC721.sol | 58 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/contracts/token/ERC721/IERC721.sol b/contracts/token/ERC721/IERC721.sol index fc58b032b..9a313867d 100644 --- a/contracts/token/ERC721/IERC721.sol +++ b/contracts/token/ERC721/IERC721.sol @@ -38,6 +38,26 @@ interface IERC721 is IERC165 { */ function ownerOf(uint256 tokenId) external view returns (address owner); + /** + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; + /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. @@ -93,15 +113,6 @@ interface IERC721 is IERC165 { */ function approve(address to, uint256 tokenId) external; - /** - * @dev Returns the account approved for `tokenId` token. - * - * Requirements: - * - * - `tokenId` must exist. - */ - function getApproved(uint256 tokenId) external view returns (address operator); - /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. @@ -114,30 +125,19 @@ interface IERC721 is IERC165 { */ function setApprovalForAll(address operator, bool _approved) external; + /** + * @dev Returns the account approved for `tokenId` token. + * + * Requirements: + * + * - `tokenId` must exist. + */ + function getApproved(uint256 tokenId) external view returns (address operator); + /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); - - /** - * @dev Safely transfers `tokenId` token from `from` to `to`. - * - * Requirements: - * - * - `from` cannot be the zero address. - * - `to` cannot be the zero address. - * - `tokenId` token must exist and be owned by `from`. - * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. - * - * Emits a {Transfer} event. - */ - function safeTransferFrom( - address from, - address to, - uint256 tokenId, - bytes calldata data - ) external; } From 3f49408fb60eddc7b45e6ee28d5baf95ce1dc665 Mon Sep 17 00:00:00 2001 From: Jean Cvllr <31145285+CJ42@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:36:37 +0100 Subject: [PATCH 30/81] Move event definition at the top of IERC20, IERC777 and IERC1820 (#3228) --- contracts/token/ERC20/IERC20.sol | 28 ++++++++-------- contracts/token/ERC777/IERC777.sol | 32 ++++++++++++++----- .../utils/introspection/IERC1820Registry.sol | 8 ++--- 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/contracts/token/ERC20/IERC20.sol b/contracts/token/ERC20/IERC20.sol index 810ff275f..f0ede8a4d 100644 --- a/contracts/token/ERC20/IERC20.sol +++ b/contracts/token/ERC20/IERC20.sol @@ -7,6 +7,20 @@ pragma solidity ^0.8.0; * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { + /** + * @dev Emitted when `value` tokens are moved from one account (`from`) to + * another (`to`). + * + * Note that `value` may be zero. + */ + event Transfer(address indexed from, address indexed to, uint256 value); + + /** + * @dev Emitted when the allowance of a `spender` for an `owner` is set by + * a call to {approve}. `value` is the new allowance. + */ + event Approval(address indexed owner, address indexed spender, uint256 value); + /** * @dev Returns the amount of tokens in existence. */ @@ -65,18 +79,4 @@ interface IERC20 { address to, uint256 amount ) external returns (bool); - - /** - * @dev Emitted when `value` tokens are moved from one account (`from`) to - * another (`to`). - * - * Note that `value` may be zero. - */ - event Transfer(address indexed from, address indexed to, uint256 value); - - /** - * @dev Emitted when the allowance of a `spender` for an `owner` is set by - * a call to {approve}. `value` is the new allowance. - */ - event Approval(address indexed owner, address indexed spender, uint256 value); } diff --git a/contracts/token/ERC777/IERC777.sol b/contracts/token/ERC777/IERC777.sol index 5a729176e..71bbf1ac2 100644 --- a/contracts/token/ERC777/IERC777.sol +++ b/contracts/token/ERC777/IERC777.sol @@ -13,6 +13,30 @@ pragma solidity ^0.8.0; * {ERC1820Implementer}. */ interface IERC777 { + /** + * @dev Emitted when `amount` tokens are created by `operator` and assigned to `to`. + * + * Note that some additional user `data` and `operatorData` can be logged in the event. + */ + event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData); + + /** + * @dev Emitted when `operator` destroys `amount` tokens from `account`. + * + * Note that some additional user `data` and `operatorData` can be logged in the event. + */ + event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData); + + /** + * @dev Emitted when `operator` is made operator for `tokenHolder` + */ + event AuthorizedOperator(address indexed operator, address indexed tokenHolder); + + /** + * @dev Emitted when `operator` is revoked its operator status for `tokenHolder` + */ + event RevokedOperator(address indexed operator, address indexed tokenHolder); + /** * @dev Returns the name of the token. */ @@ -182,12 +206,4 @@ interface IERC777 { bytes data, bytes operatorData ); - - event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData); - - event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData); - - event AuthorizedOperator(address indexed operator, address indexed tokenHolder); - - event RevokedOperator(address indexed operator, address indexed tokenHolder); } diff --git a/contracts/utils/introspection/IERC1820Registry.sol b/contracts/utils/introspection/IERC1820Registry.sol index 26dc8e62b..5d688d432 100644 --- a/contracts/utils/introspection/IERC1820Registry.sol +++ b/contracts/utils/introspection/IERC1820Registry.sol @@ -18,6 +18,10 @@ pragma solidity ^0.8.0; * For an in-depth explanation and source code analysis, see the EIP text. */ interface IERC1820Registry { + event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer); + + event ManagerChanged(address indexed account, address indexed newManager); + /** * @dev Sets `newManager` as the manager for `account`. A manager of an * account is able to set interface implementers for it. @@ -109,8 +113,4 @@ interface IERC1820Registry { * @return True if `account` implements `interfaceId`, false otherwise. */ function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool); - - event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer); - - event ManagerChanged(address indexed account, address indexed newManager); } From 2a4ca654046e65553af89355e24785e50735a92c Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 30 Mar 2022 22:29:53 -0300 Subject: [PATCH 31/81] Update release script to stop publishing old openzeppelin-solidity package --- scripts/release/release.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/release/release.sh b/scripts/release/release.sh index 97116d4a7..699a04a64 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -38,7 +38,7 @@ push_release_branch_and_tag() { publish() { dist_tag="$1" - log "Publishing openzeppelin-solidity on npm" + log "Publishing @openzeppelin/contracts on npm" npm publish --tag "$dist_tag" --otp "$(prompt_otp)" log "Publishing @openzeppelin/contracts on npm" @@ -49,8 +49,10 @@ publish() { if [[ "$dist_tag" == "latest" ]]; then otp="$(prompt_otp)" - npm dist-tag rm --otp "$otp" openzeppelin-solidity next npm dist-tag rm --otp "$otp" @openzeppelin/contracts next + + # No longer updated! + # npm dist-tag rm --otp "$otp" openzeppelin-solidity next fi } @@ -143,7 +145,7 @@ elif [[ "$*" == "final" ]]; then push_and_publish latest - npm deprecate 'openzeppelin-solidity@>=4.0.0' "This package is now published as @openzeppelin/contracts. Please change your dependency." + # npm deprecate 'openzeppelin-solidity@>=4.0.0' "This package is now published as @openzeppelin/contracts. Please change your dependency." log "Remember to merge the release branch into master and push upstream" From 2bd75a44bb5f419d132bdca6f1bf483d1479f550 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 30 Mar 2022 23:15:27 -0300 Subject: [PATCH 32/81] Fix release script to only release @openzeppelin/contracts --- scripts/release/release.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/scripts/release/release.sh b/scripts/release/release.sh index 699a04a64..af5091b62 100755 --- a/scripts/release/release.sh +++ b/scripts/release/release.sh @@ -38,21 +38,13 @@ push_release_branch_and_tag() { publish() { dist_tag="$1" - log "Publishing @openzeppelin/contracts on npm" - npm publish --tag "$dist_tag" --otp "$(prompt_otp)" - log "Publishing @openzeppelin/contracts on npm" cd contracts - env ALREADY_COMPILED= \ - npm publish --tag "$dist_tag" --otp "$(prompt_otp)" + npm publish --tag "$dist_tag" --otp "$(prompt_otp)" cd .. if [[ "$dist_tag" == "latest" ]]; then - otp="$(prompt_otp)" - npm dist-tag rm --otp "$otp" @openzeppelin/contracts next - - # No longer updated! - # npm dist-tag rm --otp "$otp" openzeppelin-solidity next + npm dist-tag rm --otp "$(prompt_otp)" @openzeppelin/contracts next fi } @@ -145,8 +137,6 @@ elif [[ "$*" == "final" ]]; then push_and_publish latest - # npm deprecate 'openzeppelin-solidity@>=4.0.0' "This package is now published as @openzeppelin/contracts. Please change your dependency." - log "Remember to merge the release branch into master and push upstream" else From d2832ca7a9096afa77a7c5b669292c0ca5f3ddb7 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 31 Mar 2022 20:01:22 +0200 Subject: [PATCH 33/81] make ERC2981:royaltyInfo public (#3305) --- CHANGELOG.md | 3 +++ contracts/token/common/ERC2981.sol | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ae2da67e..e3394576a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Unreleased + * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) + ## Unreleased * `crosschain`: Add a new set of contracts for cross-chain applications. `CrossChainEnabled` is a base contract with instantiations for several chains and bridges, and `AccessControlCrossChain` is an extension of access control that allows cross-chain operation. ([#3183](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3183)) diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index 90d7ed34a..cee7cb09f 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -40,13 +40,7 @@ abstract contract ERC2981 is IERC2981, ERC165 { /** * @inheritdoc IERC2981 */ - function royaltyInfo(uint256 _tokenId, uint256 _salePrice) - external - view - virtual - override - returns (address, uint256) - { + function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { From 9af5af8fffe9964cd1d20a39f399fea173d18653 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 31 Mar 2022 20:04:04 +0200 Subject: [PATCH 34/81] add transpilation guards to the crosschain mocks (#3306) --- contracts/mocks/crosschain/receivers.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/mocks/crosschain/receivers.sol b/contracts/mocks/crosschain/receivers.sol index 57b9b5d7e..06498c503 100644 --- a/contracts/mocks/crosschain/receivers.sol +++ b/contracts/mocks/crosschain/receivers.sol @@ -19,6 +19,7 @@ abstract contract Receiver is Ownable, CrossChainEnabled { * AMB */ contract CrossChainEnabledAMBMock is Receiver, CrossChainEnabledAMB { + /// @custom:oz-upgrades-unsafe-allow constructor constructor(address bridge) CrossChainEnabledAMB(bridge) {} } @@ -26,6 +27,7 @@ contract CrossChainEnabledAMBMock is Receiver, CrossChainEnabledAMB { * Arbitrum */ contract CrossChainEnabledArbitrumL1Mock is Receiver, CrossChainEnabledArbitrumL1 { + /// @custom:oz-upgrades-unsafe-allow constructor constructor(address bridge) CrossChainEnabledArbitrumL1(bridge) {} } @@ -35,6 +37,7 @@ contract CrossChainEnabledArbitrumL2Mock is Receiver, CrossChainEnabledArbitrumL * Optimism */ contract CrossChainEnabledOptimismMock is Receiver, CrossChainEnabledOptimism { + /// @custom:oz-upgrades-unsafe-allow constructor constructor(address bridge) CrossChainEnabledOptimism(bridge) {} } @@ -42,5 +45,6 @@ contract CrossChainEnabledOptimismMock is Receiver, CrossChainEnabledOptimism { * Polygon */ contract CrossChainEnabledPolygonChildMock is Receiver, CrossChainEnabledPolygonChild { + /// @custom:oz-upgrades-unsafe-allow constructor constructor(address bridge) CrossChainEnabledPolygonChild(bridge) {} } From f85eb5b72547b1ef6e623195f394e0416eb0b4ee Mon Sep 17 00:00:00 2001 From: JulissaDantes Date: Thu, 31 Mar 2022 17:28:47 -0400 Subject: [PATCH 35/81] Use slither action (#3278) Co-authored-by: Francisco Giordano --- .github/workflows/slither.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 23 ----------------------- package.json | 3 +-- slither.config.json | 4 ++++ 4 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/slither.yml create mode 100644 slither.config.json diff --git a/.github/workflows/slither.yml b/.github/workflows/slither.yml new file mode 100644 index 000000000..df312b948 --- /dev/null +++ b/.github/workflows/slither.yml @@ -0,0 +1,28 @@ +name: Slither Analysis +on: + push: + branches: + - master + - release-v* + pull_request: {} + workflow_dispatch: {} + +jobs: + analyze: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 12.x + - uses: actions/cache@v3 + id: cache + with: + path: '**/node_modules' + key: npm-v2-${{ hashFiles('**/package-lock.json') }} + restore-keys: npm-v2- + - run: npm ci + if: steps.cache.outputs.cache-hit != 'true' + - name: Clean project + run: npm run clean + - uses: crytic/slither-action@v0.1.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0877b5fef..3ba8242fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,26 +54,3 @@ jobs: env: NODE_OPTIONS: --max_old_space_size=4096 - uses: codecov/codecov-action@v2 - - slither: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 12.x - - uses: actions/cache@v3 - id: cache - with: - path: '**/node_modules' - key: npm-v2-${{ hashFiles('**/package-lock.json') }} - restore-keys: npm-v2- - - run: npm ci - if: steps.cache.outputs.cache-hit != 'true' - - name: Set up Python - uses: actions/setup-python@v2 - - - name: Install dependencies - run: pip3 install slither-analyzer - - name: Summary of static analysis - run: npm run slither diff --git a/package.json b/package.json index e2c0b973f..750e7eafc 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,7 @@ "version": "scripts/release/version.sh", "test": "hardhat test", "test:inheritance": "node scripts/inheritanceOrdering artifacts/build-info/*", - "gas-report": "env ENABLE_GAS_REPORT=true npm run test", - "slither": "npm run clean && slither . --detect reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas --filter-paths contracts/mocks" + "gas-report": "env ENABLE_GAS_REPORT=true npm run test" }, "repository": { "type": "git", diff --git a/slither.config.json b/slither.config.json new file mode 100644 index 000000000..e52e3f5d5 --- /dev/null +++ b/slither.config.json @@ -0,0 +1,4 @@ +{ + "detectors_to_run": "reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas", + "filter_paths": "contracts/mocks" +} \ No newline at end of file From 049701eacd14f1173b02af6015c662839fb6aa94 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 18:42:01 -0300 Subject: [PATCH 36/81] Update crytic/slither-action action to v0.1.1 (#3307) Co-authored-by: Renovate Bot --- .github/workflows/slither.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slither.yml b/.github/workflows/slither.yml index df312b948..6290d506b 100644 --- a/.github/workflows/slither.yml +++ b/.github/workflows/slither.yml @@ -25,4 +25,4 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' - name: Clean project run: npm run clean - - uses: crytic/slither-action@v0.1.0 + - uses: crytic/slither-action@v0.1.1 From 0762479dd518a23821eeb17c622f1227461441d1 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 31 Mar 2022 23:41:05 -0300 Subject: [PATCH 37/81] Fix tests on upgradeable contracts after transpilation --- contracts/mocks/crosschain/bridges.sol | 4 ++++ contracts/mocks/crosschain/receivers.sol | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/contracts/mocks/crosschain/bridges.sol b/contracts/mocks/crosschain/bridges.sol index 5b9d20358..6a2b97470 100644 --- a/contracts/mocks/crosschain/bridges.sol +++ b/contracts/mocks/crosschain/bridges.sol @@ -41,7 +41,9 @@ contract BridgeAMBMock is BaseRelayMock { * Arbitrum */ contract BridgeArbitrumL1Mock is BaseRelayMock { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address public immutable inbox = address(new BridgeArbitrumL1Inbox()); + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address public immutable outbox = address(new BridgeArbitrumL1Outbox()); function activeOutbox() public view returns (address) { @@ -54,10 +56,12 @@ contract BridgeArbitrumL1Mock is BaseRelayMock { } contract BridgeArbitrumL1Inbox { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address public immutable bridge = msg.sender; } contract BridgeArbitrumL1Outbox { + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address public immutable bridge = msg.sender; function l2ToL1Sender() public view returns (address) { diff --git a/contracts/mocks/crosschain/receivers.sol b/contracts/mocks/crosschain/receivers.sol index 06498c503..601a2ac10 100644 --- a/contracts/mocks/crosschain/receivers.sol +++ b/contracts/mocks/crosschain/receivers.sol @@ -9,10 +9,14 @@ import "../../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol"; import "../../crosschain/optimism/CrossChainEnabledOptimism.sol"; import "../../crosschain/polygon/CrossChainEnabledPolygonChild.sol"; -abstract contract Receiver is Ownable, CrossChainEnabled { +abstract contract Receiver is CrossChainEnabled { + // we don't use Ownable because it messes up testing for the upgradeable contracts + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment + address public immutable owner = msg.sender; + function crossChainRestricted() external onlyCrossChain {} - function crossChainOwnerRestricted() external onlyCrossChainSender(owner()) {} + function crossChainOwnerRestricted() external onlyCrossChainSender(owner) {} } /** From 69c3781043b9671012c5b19fdea81784a70a5289 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Fri, 1 Apr 2022 00:16:32 -0300 Subject: [PATCH 38/81] Remove unused constructor argument --- test/crosschain/CrossChainEnabled.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/crosschain/CrossChainEnabled.test.js b/test/crosschain/CrossChainEnabled.test.js index 7e64d2980..6aeb4db7d 100644 --- a/test/crosschain/CrossChainEnabled.test.js +++ b/test/crosschain/CrossChainEnabled.test.js @@ -57,7 +57,7 @@ contract('CrossChainEnabled', function () { describe('Arbitrum-L2', function () { beforeEach(async function () { this.bridge = await BridgeHelper.deploy('Arbitrum-L2'); - this.receiver = await CrossChainEnabledArbitrumL2Mock.new(this.bridge.address); + this.receiver = await CrossChainEnabledArbitrumL2Mock.new(); }); shouldBehaveLikeReceiver(); From 742e85be7c08dff21410ba4aa9c60f6a033befb8 Mon Sep 17 00:00:00 2001 From: Amin Bashiri Date: Sat, 2 Apr 2022 14:43:33 +0430 Subject: [PATCH 39/81] Change zero address revert message in the balanceOf function of ERC721 and ERC1155 (#3314) --- contracts/token/ERC1155/ERC1155.sol | 2 +- contracts/token/ERC721/ERC721.sol | 2 +- test/token/ERC1155/ERC1155.behavior.js | 4 ++-- test/token/ERC721/ERC721.behavior.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index a9a619842..d14d26955 100644 --- a/contracts/token/ERC1155/ERC1155.sol +++ b/contracts/token/ERC1155/ERC1155.sol @@ -68,7 +68,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { - require(account != address(0), "ERC1155: balance query for the zero address"); + require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 1346260a9..b6855f531 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -60,7 +60,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { - require(owner != address(0), "ERC721: balance query for the zero address"); + require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } diff --git a/test/token/ERC1155/ERC1155.behavior.js b/test/token/ERC1155/ERC1155.behavior.js index 13b08ac63..0e87f5af1 100644 --- a/test/token/ERC1155/ERC1155.behavior.js +++ b/test/token/ERC1155/ERC1155.behavior.js @@ -23,7 +23,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, it('reverts when queried about the zero address', async function () { await expectRevert( this.token.balanceOf(ZERO_ADDRESS, firstTokenId), - 'ERC1155: balance query for the zero address', + 'ERC1155: address zero is not a valid owner', ); }); @@ -106,7 +106,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, [firstTokenHolder, secondTokenHolder, ZERO_ADDRESS], [firstTokenId, secondTokenId, unknownTokenId], ), - 'ERC1155: balance query for the zero address', + 'ERC1155: address zero is not a valid owner', ); }); diff --git a/test/token/ERC721/ERC721.behavior.js b/test/token/ERC721/ERC721.behavior.js index 67fa98a47..75944be70 100644 --- a/test/token/ERC721/ERC721.behavior.js +++ b/test/token/ERC721/ERC721.behavior.js @@ -46,7 +46,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('when querying the zero address', function () { it('throws', async function () { await expectRevert( - this.token.balanceOf(ZERO_ADDRESS), 'ERC721: balance query for the zero address', + this.token.balanceOf(ZERO_ADDRESS), 'ERC721: address zero is not a valid owner', ); }); }); From 3fb25b604bda2af48bab75b8d9179b8ed3b7b87c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 16:56:57 -0300 Subject: [PATCH 40/81] Update codecov/codecov-action action to v3 (#3320) Co-authored-by: Renovate Bot --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ba8242fa..db6abf6a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,4 +53,4 @@ jobs: - run: npm run coverage env: NODE_OPTIONS: --max_old_space_size=4096 - - uses: codecov/codecov-action@v2 + - uses: codecov/codecov-action@v3 From f81b80fb3957ad9c86bb9f9504dd49a8ef409022 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 18:07:25 -0300 Subject: [PATCH 41/81] Update lockfile (#3309) Co-authored-by: Renovate Bot --- package-lock.json | 6573 ++++++++++++++++++++++----------------------- 1 file changed, 3146 insertions(+), 3427 deletions(-) diff --git a/package-lock.json b/package-lock.json index caef323a8..79972dda3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -150,9 +150,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.2.tgz", - "integrity": "sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", + "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", "dev": true, "dependencies": { "regenerator-runtime": "^0.13.4" @@ -207,9 +207,9 @@ } }, "node_modules/@ensdomains/ensjs/node_modules/ethers": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.5.4.tgz", - "integrity": "sha512-N9IAXsF8iKhgHIC6pquzRgPBJEzc9auw3JoRkaKe+y4Wl/LFBtDDunNe7YmdomontECAcC5APaAgWZBiu1kirw==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.2.tgz", + "integrity": "sha512-EzGCbns24/Yluu7+ToWnMca3SXJ1Jk1BvWB7CCmVNxyOeM4LLvw2OLuIHhlkhQk1dtOcj9UMsdkxUh8RiG1dxQ==", "dev": true, "funding": [ { @@ -222,36 +222,36 @@ } ], "dependencies": { - "@ethersproject/abi": "5.5.0", - "@ethersproject/abstract-provider": "5.5.1", - "@ethersproject/abstract-signer": "5.5.0", - "@ethersproject/address": "5.5.0", - "@ethersproject/base64": "5.5.0", - "@ethersproject/basex": "5.5.0", - "@ethersproject/bignumber": "5.5.0", - "@ethersproject/bytes": "5.5.0", - "@ethersproject/constants": "5.5.0", - "@ethersproject/contracts": "5.5.0", - "@ethersproject/hash": "5.5.0", - "@ethersproject/hdnode": "5.5.0", - "@ethersproject/json-wallets": "5.5.0", - "@ethersproject/keccak256": "5.5.0", - "@ethersproject/logger": "5.5.0", - "@ethersproject/networks": "5.5.2", - "@ethersproject/pbkdf2": "5.5.0", - "@ethersproject/properties": "5.5.0", - "@ethersproject/providers": "5.5.3", - "@ethersproject/random": "5.5.1", - "@ethersproject/rlp": "5.5.0", - "@ethersproject/sha2": "5.5.0", - "@ethersproject/signing-key": "5.5.0", - "@ethersproject/solidity": "5.5.0", - "@ethersproject/strings": "5.5.0", - "@ethersproject/transactions": "5.5.0", - "@ethersproject/units": "5.5.0", - "@ethersproject/wallet": "5.5.0", - "@ethersproject/web": "5.5.1", - "@ethersproject/wordlists": "5.5.0" + "@ethersproject/abi": "5.6.0", + "@ethersproject/abstract-provider": "5.6.0", + "@ethersproject/abstract-signer": "5.6.0", + "@ethersproject/address": "5.6.0", + "@ethersproject/base64": "5.6.0", + "@ethersproject/basex": "5.6.0", + "@ethersproject/bignumber": "5.6.0", + "@ethersproject/bytes": "5.6.1", + "@ethersproject/constants": "5.6.0", + "@ethersproject/contracts": "5.6.0", + "@ethersproject/hash": "5.6.0", + "@ethersproject/hdnode": "5.6.0", + "@ethersproject/json-wallets": "5.6.0", + "@ethersproject/keccak256": "5.6.0", + "@ethersproject/logger": "5.6.0", + "@ethersproject/networks": "5.6.1", + "@ethersproject/pbkdf2": "5.6.0", + "@ethersproject/properties": "5.6.0", + "@ethersproject/providers": "5.6.2", + "@ethersproject/random": "5.6.0", + "@ethersproject/rlp": "5.6.0", + "@ethersproject/sha2": "5.6.0", + "@ethersproject/signing-key": "5.6.0", + "@ethersproject/solidity": "5.6.0", + "@ethersproject/strings": "5.6.0", + "@ethersproject/transactions": "5.6.0", + "@ethersproject/units": "5.6.0", + "@ethersproject/wallet": "5.6.0", + "@ethersproject/web": "5.6.0", + "@ethersproject/wordlists": "5.6.0" } }, "node_modules/@ensdomains/resolver": { @@ -282,52 +282,37 @@ } }, "node_modules/@ethereumjs/block": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.1.tgz", - "integrity": "sha512-o5d/zpGl4SdVfdTfrsq9ZgYMXddc0ucKMiFW5OphBCX+ep4xzYnSjboFcZXT2V/tcSBr84VrKWWp21CGVb3DGw==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.2.tgz", + "integrity": "sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw==", "dev": true, "dependencies": { - "@ethereumjs/common": "^2.6.1", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "ethereumjs-util": "^7.1.4", - "merkle-patricia-tree": "^4.2.3" + "merkle-patricia-tree": "^4.2.4" } }, "node_modules/@ethereumjs/blockchain": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.1.tgz", - "integrity": "sha512-JS2jeKxl3tlaa5oXrZ8mGoVBCz6YqsGG350XVNtHAtNZXKk7pU3rH4xzF2ru42fksMMqzFLzKh9l4EQzmNWDqA==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz", + "integrity": "sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig==", "dev": true, "dependencies": { - "@ethereumjs/block": "^3.6.0", - "@ethereumjs/common": "^2.6.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.3", "@ethereumjs/ethash": "^1.1.0", - "debug": "^2.2.0", - "ethereumjs-util": "^7.1.3", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", "semaphore-async-await": "^1.5.1" } }, - "node_modules/@ethereumjs/blockchain/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/@ethereumjs/blockchain/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/@ethereumjs/common": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.2.tgz", - "integrity": "sha512-vDwye5v0SVeuDky4MtKsu+ogkH2oFUV8pBKzH/eNBzT8oI91pKa8WyzDuYuxOQsgNgv5R34LfFDh2aaw3H4HbQ==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.3.tgz", + "integrity": "sha512-mQwPucDL7FDYIg9XQ8DL31CnIYZwGhU5hyOO5E+BMmT71G0+RHvIT5rIkLBirJEKxV6+Rcf9aEIY0kXInxUWpQ==", "dev": true, "dependencies": { "crc-32": "^1.2.0", @@ -357,39 +342,39 @@ } }, "node_modules/@ethereumjs/tx": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.0.tgz", - "integrity": "sha512-/+ZNbnJhQhXC83Xuvy6I9k4jT5sXiV0tMR9C+AzSSpcCV64+NB8dTE1m3x98RYMqb8+TLYWA+HML4F5lfXTlJw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.1.tgz", + "integrity": "sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA==", "dev": true, "dependencies": { - "@ethereumjs/common": "^2.6.1", + "@ethereumjs/common": "^2.6.3", "ethereumjs-util": "^7.1.4" } }, "node_modules/@ethereumjs/vm": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.7.1.tgz", - "integrity": "sha512-NiFm5FMaeDGZ9ojBL+Y9Y/xhW6S4Fgez+zPBM402T5kLsfeAR9mrRVckYhvkGVJ6FMwsY820CLjYP5OVwMjLTg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.8.0.tgz", + "integrity": "sha512-mn2G2SX79QY4ckVvZUfxlNUpzwT2AEIkvgJI8aHoQaNYEHhH8rmdVDIaVVgz6//PjK52BZsK23afz+WvSR0Qqw==", "dev": true, "dependencies": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/blockchain": "^5.5.1", - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^4.3.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.3", + "merkle-patricia-tree": "^4.2.4", "rustbn.js": "~0.2.0" } }, "node_modules/@ethersproject/abi": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", - "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", + "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", "dev": true, "funding": [ { @@ -402,21 +387,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "node_modules/@ethersproject/abstract-provider": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz", - "integrity": "sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz", + "integrity": "sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==", "dev": true, "funding": [ { @@ -429,19 +414,19 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/networks": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/web": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/web": "^5.6.0" } }, "node_modules/@ethersproject/abstract-signer": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz", - "integrity": "sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz", + "integrity": "sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==", "dev": true, "funding": [ { @@ -454,17 +439,17 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0" + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0" } }, "node_modules/@ethersproject/address": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz", - "integrity": "sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.0.tgz", + "integrity": "sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==", "dev": true, "funding": [ { @@ -477,17 +462,17 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/rlp": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.0" } }, "node_modules/@ethersproject/base64": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", - "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.0.tgz", + "integrity": "sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==", "dev": true, "funding": [ { @@ -500,13 +485,13 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0" + "@ethersproject/bytes": "^5.6.0" } }, "node_modules/@ethersproject/basex": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.5.0.tgz", - "integrity": "sha512-ZIodwhHpVJ0Y3hUCfUucmxKsWQA5TMnavp5j/UOuDdzZWzJlRmuOjcTMIGgHCYuZmHt36BfiSyQPSRskPxbfaQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.0.tgz", + "integrity": "sha512-qN4T+hQd/Md32MoJpc69rOwLYRUXwjTlhHDIeUkUmiN/JyWkkLLMoG0TqvSQKNqZOMgN5stbUYN6ILC+eD7MEQ==", "dev": true, "funding": [ { @@ -519,14 +504,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/properties": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/properties": "^5.6.0" } }, "node_modules/@ethersproject/bignumber": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", - "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", + "integrity": "sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==", "dev": true, "funding": [ { @@ -539,15 +524,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", "bn.js": "^4.11.9" } }, "node_modules/@ethersproject/bytes": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", - "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", "dev": true, "funding": [ { @@ -560,13 +545,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/constants": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", - "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.0.tgz", + "integrity": "sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==", "dev": true, "funding": [ { @@ -579,13 +564,13 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0" } }, "node_modules/@ethersproject/contracts": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.5.0.tgz", - "integrity": "sha512-2viY7NzyvJkh+Ug17v7g3/IJC8HqZBDcOjYARZLdzRxrfGlRgmYgl6xPRKVbEzy1dWKw/iv7chDcS83pg6cLxg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.0.tgz", + "integrity": "sha512-74Ge7iqTDom0NX+mux8KbRUeJgu1eHZ3iv6utv++sLJG80FVuU9HnHeKVPfjd9s3woFhaFoQGf3B3iH/FrQmgw==", "dev": true, "funding": [ { @@ -598,22 +583,22 @@ } ], "dependencies": { - "@ethersproject/abi": "^5.5.0", - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/transactions": "^5.5.0" + "@ethersproject/abi": "^5.6.0", + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.0" } }, "node_modules/@ethersproject/hash": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz", - "integrity": "sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", + "integrity": "sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==", "dev": true, "funding": [ { @@ -626,20 +611,20 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "node_modules/@ethersproject/hdnode": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.5.0.tgz", - "integrity": "sha512-mcSOo9zeUg1L0CoJH7zmxwUG5ggQHU1UrRf8jyTYy6HxdZV+r0PBoL1bxr+JHIPXRzS6u/UW4mEn43y0tmyF8Q==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.0.tgz", + "integrity": "sha512-61g3Jp3nwDqJcL/p4nugSyLrpl/+ChXIOtCEM8UDmWeB3JCAt5FoLdOMXQc3WWkc0oM2C0aAn6GFqqMcS/mHTw==", "dev": true, "funding": [ { @@ -652,24 +637,24 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/basex": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/pbkdf2": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/sha2": "^5.5.0", - "@ethersproject/signing-key": "^5.5.0", - "@ethersproject/strings": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/wordlists": "^5.5.0" + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/basex": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/wordlists": "^5.6.0" } }, "node_modules/@ethersproject/json-wallets": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz", - "integrity": "sha512-9lA21XQnCdcS72xlBn1jfQdj2A1VUxZzOzi9UkNdnokNKke/9Ya2xA9aIK1SC3PQyBDLt4C+dfps7ULpkvKikQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.0.tgz", + "integrity": "sha512-fmh86jViB9r0ibWXTQipxpAGMiuxoqUf78oqJDlCAJXgnJF024hOOX7qVgqsjtbeoxmcLwpPsXNU0WEe/16qPQ==", "dev": true, "funding": [ { @@ -682,17 +667,17 @@ } ], "dependencies": { - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/hdnode": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/pbkdf2": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/random": "^5.5.0", - "@ethersproject/strings": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hdnode": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", "aes-js": "3.0.0", "scrypt-js": "3.0.1" } @@ -704,9 +689,9 @@ "dev": true }, "node_modules/@ethersproject/keccak256": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz", - "integrity": "sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", + "integrity": "sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==", "dev": true, "funding": [ { @@ -719,14 +704,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", "js-sha3": "0.8.0" } }, "node_modules/@ethersproject/logger": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", - "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", "dev": true, "funding": [ { @@ -740,9 +725,9 @@ ] }, "node_modules/@ethersproject/networks": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.2.tgz", - "integrity": "sha512-NEqPxbGBfy6O3x4ZTISb90SjEDkWYDUbEeIFhJly0F7sZjoQMnj5KYzMSkMkLKZ+1fGpx00EDpHQCy6PrDupkQ==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.1.tgz", + "integrity": "sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==", "dev": true, "funding": [ { @@ -755,13 +740,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/pbkdf2": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz", - "integrity": "sha512-SaDvQFvXPnz1QGpzr6/HToLifftSXGoXrbpZ6BvoZhmx4bNLHrxDe8MZisuecyOziP1aVEwzC2Hasj+86TgWVg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.0.tgz", + "integrity": "sha512-Wu1AxTgJo3T3H6MIu/eejLFok9TYoSdgwRr5oGY1LTLfmGesDoSx05pemsbrPT2gG4cQME+baTSCp5sEo2erZQ==", "dev": true, "funding": [ { @@ -774,14 +759,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/sha2": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/sha2": "^5.6.0" } }, "node_modules/@ethersproject/properties": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", - "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", + "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", "dev": true, "funding": [ { @@ -794,13 +779,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/providers": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.5.3.tgz", - "integrity": "sha512-ZHXxXXXWHuwCQKrgdpIkbzMNJMvs+9YWemanwp1fA7XZEv7QlilseysPvQe0D7Q7DlkJX/w/bGA1MdgK2TbGvA==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.2.tgz", + "integrity": "sha512-6/EaFW/hNWz+224FXwl8+HdMRzVHt8DpPmu5MZaIQqx/K/ELnC9eY236SMV7mleCM3NnEArFwcAAxH5kUUgaRg==", "dev": true, "funding": [ { @@ -813,23 +798,23 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/basex": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/networks": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/random": "^5.5.0", - "@ethersproject/rlp": "^5.5.0", - "@ethersproject/sha2": "^5.5.0", - "@ethersproject/strings": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/web": "^5.5.0", + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/basex": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/rlp": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/web": "^5.6.0", "bech32": "1.1.4", "ws": "7.4.6" } @@ -856,9 +841,9 @@ } }, "node_modules/@ethersproject/random": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.5.1.tgz", - "integrity": "sha512-YaU2dQ7DuhL5Au7KbcQLHxcRHfgyNgvFV4sQOo0HrtW3Zkrc9ctWNz8wXQ4uCSfSDsqX2vcjhroxU5RQRV0nqA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.0.tgz", + "integrity": "sha512-si0PLcLjq+NG/XHSZz90asNf+YfKEqJGVdxoEkSukzbnBgC8rydbgbUgBbBGLeHN4kAJwUFEKsu3sCXT93YMsw==", "dev": true, "funding": [ { @@ -871,14 +856,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/rlp": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz", - "integrity": "sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", + "integrity": "sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==", "dev": true, "funding": [ { @@ -891,14 +876,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/sha2": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.5.0.tgz", - "integrity": "sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz", + "integrity": "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==", "dev": true, "funding": [ { @@ -911,15 +896,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/signing-key": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz", - "integrity": "sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.0.tgz", + "integrity": "sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==", "dev": true, "funding": [ { @@ -932,18 +917,18 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/solidity": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.5.0.tgz", - "integrity": "sha512-9NgZs9LhGMj6aCtHXhtmFQ4AN4sth5HuFXVvAQtzmm0jpSCNOTGtrHZJAeYTh7MBjRR8brylWZxBZR9zDStXbw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.6.0.tgz", + "integrity": "sha512-YwF52vTNd50kjDzqKaoNNbC/r9kMDPq3YzDWmsjFTRBcIF1y4JCQJ8gB30wsTfHbaxgxelI5BfxQSxD/PbJOww==", "dev": true, "funding": [ { @@ -956,18 +941,18 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/sha2": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "node_modules/@ethersproject/strings": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", - "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", + "integrity": "sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==", "dev": true, "funding": [ { @@ -980,15 +965,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/transactions": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz", - "integrity": "sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.0.tgz", + "integrity": "sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==", "dev": true, "funding": [ { @@ -1001,21 +986,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/rlp": "^5.5.0", - "@ethersproject/signing-key": "^5.5.0" + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/rlp": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0" } }, "node_modules/@ethersproject/units": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.5.0.tgz", - "integrity": "sha512-7+DpjiZk4v6wrikj+TCyWWa9dXLNU73tSTa7n0TSJDxkYbV3Yf1eRh9ToMLlZtuctNYu9RDNNy2USq3AdqSbag==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.0.tgz", + "integrity": "sha512-tig9x0Qmh8qbo1w8/6tmtyrm/QQRviBh389EQ+d8fP4wDsBrJBf08oZfoiz1/uenKK9M78yAP4PoR7SsVoTjsw==", "dev": true, "funding": [ { @@ -1028,15 +1013,15 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "node_modules/@ethersproject/wallet": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.5.0.tgz", - "integrity": "sha512-Mlu13hIctSYaZmUOo7r2PhNSd8eaMPVXe1wxrz4w4FCE4tDYBywDH+bAR1Xz2ADyXGwqYMwstzTrtUVIsKDO0Q==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.0.tgz", + "integrity": "sha512-qMlSdOSTyp0MBeE+r7SUhr1jjDlC1zAXB8VD84hCnpijPQiSNbxr6GdiLXxpUs8UKzkDiNYYC5DRI3MZr+n+tg==", "dev": true, "funding": [ { @@ -1049,27 +1034,27 @@ } ], "dependencies": { - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/hdnode": "^5.5.0", - "@ethersproject/json-wallets": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/random": "^5.5.0", - "@ethersproject/signing-key": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/wordlists": "^5.5.0" + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/hdnode": "^5.6.0", + "@ethersproject/json-wallets": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/wordlists": "^5.6.0" } }, "node_modules/@ethersproject/web": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", - "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", + "integrity": "sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==", "dev": true, "funding": [ { @@ -1082,17 +1067,17 @@ } ], "dependencies": { - "@ethersproject/base64": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/base64": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "node_modules/@ethersproject/wordlists": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.5.0.tgz", - "integrity": "sha512-bL0UTReWDiaQJJYOC9sh/XcRu/9i2jMrzf8VLRmPKx58ckSlOJiohODkECCO50dtLZHcGU6MLXQ4OOrgBwP77Q==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.0.tgz", + "integrity": "sha512-q0bxNBfIX3fUuAo9OmjlEYxP40IB8ABgb7HjEZCL5IKubzV3j30CWi2rqQbjTS2HfoyQbfINoKcTVWP4ejwR7Q==", "dev": true, "funding": [ { @@ -1105,11 +1090,11 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "node_modules/@humanwhocodes/config-array": { @@ -1172,6 +1157,24 @@ "rlp": "^2.2.3" } }, + "node_modules/@noble/hashes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.0.0.tgz", + "integrity": "sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==", + "dev": true + }, + "node_modules/@noble/secp256k1": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.5.5.tgz", + "integrity": "sha512-sZ1W6gQzYnu45wPrWx8D3kwI2/U29VYTx9OjbDAd7jwRItJ0cSTMPRL/C8AWZFn9kWFLQGqEXVEE86w4Z8LpIQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1365,6 +1368,21 @@ "node": ">=8" } }, + "node_modules/@oclif/errors/node_modules/clean-stack": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", + "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@oclif/errors/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -1817,6 +1835,51 @@ "semver": "bin/semver" } }, + "node_modules/@scure/base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.0.0.tgz", + "integrity": "sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@scure/bip32": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.0.1.tgz", + "integrity": "sha512-AU88KKTpQ+YpTLoicZ/qhFhRRIo96/tlb+8YmDDHR9yiKVjSsFZiefJO4wjS2PMTkz5/oIcw84uAq/8pleQURA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.0.0", + "@noble/secp256k1": "~1.5.2", + "@scure/base": "~1.0.0" + } + }, + "node_modules/@scure/bip39": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.0.0.tgz", + "integrity": "sha512-HrtcikLbd58PWOkl02k9V6nXWQyoa7A0+Ek9VF7z17DDk9XZAFUcIdqfh0jJXLypmizc5/8P6OxoUeKliiWv4w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.0.0", + "@scure/base": "~1.0.0" + } + }, "node_modules/@sentry/core": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", @@ -1986,13 +2049,13 @@ } }, "node_modules/@truffle/abi-utils": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.9.tgz", - "integrity": "sha512-Nv4MGsA2vdI7G34nI0DfR/eSd5pbAUu+5EafYNqzgrS46y0LWhbIrSZ1NcM7cbhIrkpUn6OfNk49AjNM67TkSg==", + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.11.tgz", + "integrity": "sha512-JYVD+9t6hSc7N34i6sHolwspVvcwcA/TNZNeQxXQObCe/pv6vt+i6xmp+yD87evjHrM0zG+ANlgR/QqJhTJ/qg==", "dev": true, "dependencies": { "change-case": "3.0.2", - "faker": "^5.3.1", + "faker": "5.5.3", "fast-check": "^2.12.1" } }, @@ -2077,9 +2140,9 @@ } }, "node_modules/@truffle/compile-common": { - "version": "0.7.28", - "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.28.tgz", - "integrity": "sha512-mZCEQ6fkOqbKYCJDT82q0vZCxOEsKRQ0zrPfKuSJEb0gF9DXIQcnMkyJpBSWzmyvien9/A7/jPiGQoC7PmNEUg==", + "version": "0.7.29", + "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.29.tgz", + "integrity": "sha512-Z5h0jQh/GXsjnTBt02boV2QiQ1QlGlWlupZWsIcLHpBxQaw/TXTa7EvicPLWf7JQ3my56iaY3N5rkrQLAlFf1Q==", "dev": true, "dependencies": { "@truffle/error": "^0.1.0", @@ -2093,17 +2156,17 @@ "dev": true }, "node_modules/@truffle/contract": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.4.10.tgz", - "integrity": "sha512-UsAZuVZ9V0oRNLR599VLuOQd5sPc5kjXRKRRGEYfB3mmnPfrJCnlSzfC5bzbGHanx6hmct3epD4Y/EFhoAit4A==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.5.3.tgz", + "integrity": "sha512-bJJj9kJ6rTEwiroWNozglakdIhXrHzsRdS2UxDPlBRWfN6D5rvGcBUZqC+8QnNqb3iWfcf8CmO7kWhj7OKqbAA==", "dev": true, "dependencies": { "@ensdomains/ensjs": "^2.0.1", - "@truffle/blockchain-utils": "^0.1.0", - "@truffle/contract-schema": "^3.4.5", - "@truffle/debug-utils": "^6.0.10", + "@truffle/blockchain-utils": "^0.1.1", + "@truffle/contract-schema": "^3.4.6", + "@truffle/debug-utils": "^6.0.15", "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.11", + "@truffle/interface-adapter": "^0.5.12", "bignumber.js": "^7.2.1", "debug": "^4.3.1", "ethers": "^4.0.32", @@ -2115,9 +2178,9 @@ } }, "node_modules/@truffle/contract-schema": { - "version": "3.4.5", - "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.5.tgz", - "integrity": "sha512-heaGV9QWqef259HaF+0is/tsmhlZIbUSWhqvj0iwKmxoN92fghKijWwdVYhPIbsmGlrQuwPTZHSCnaOlO+gsFg==", + "version": "3.4.6", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.6.tgz", + "integrity": "sha512-YzVAoPxEnM7pz7vLrQvtgtnpIwERrZcbYRjRTEJP8Y7rxudYDYaZ8PwjHD3j0SQxE6Y0WquDi3PtbfgZB9BwYQ==", "dev": true, "dependencies": { "ajv": "^6.10.0", @@ -2142,27 +2205,24 @@ } }, "node_modules/@truffle/contract/node_modules/@truffle/blockchain-utils": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.0.tgz", - "integrity": "sha512-9mzYXPQkjOc23rHQM1i630i3ackITWP1cxf3PvBObaAnGqwPCQuqtmZtNDPdvN+YpOLpBGpZIdYolI91xLdJNQ==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.1.tgz", + "integrity": "sha512-o7nBlaMuasuADCCL2WzhvOXA5GT5ewd/F35cY6ZU69U5OUASR3ZP4CZetVCc5MZePPa/3CL9pzJ4Rhtg1ChwVA==", "dev": true }, "node_modules/@truffle/contract/node_modules/@truffle/codec": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.0.tgz", - "integrity": "sha512-DE/26w5jtBPPqVBseLX1cL0i3b3IUnHaHtKmQvqkEatd6T+uZfPIaiI15ru8cynR7KrYNhuSfeq9k8/N+OFN1Q==", + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.5.tgz", + "integrity": "sha512-wkA6WIMVFhXkaSG6vNVaoYhHjubuek47YgsGFc2m24I7mgasOfcLQ9CVP1h/CBzOBxuy6vP/GX95DTPzsYxL9A==", "dev": true, "dependencies": { - "@truffle/abi-utils": "^0.2.9", - "@truffle/compile-common": "^0.7.28", - "big.js": "^5.2.2", + "@truffle/abi-utils": "^0.2.11", + "@truffle/compile-common": "^0.7.29", + "big.js": "^6.0.3", "bn.js": "^5.1.3", "cbor": "^5.1.0", "debug": "^4.3.1", - "lodash.clonedeep": "^4.5.0", - "lodash.escaperegexp": "^4.1.2", - "lodash.partition": "^4.6.0", - "lodash.sum": "^4.0.2", + "lodash": "^4.17.21", "semver": "^7.3.4", "utf8": "^3.0.0", "web3-utils": "1.5.3" @@ -2175,17 +2235,17 @@ "dev": true }, "node_modules/@truffle/contract/node_modules/@truffle/debug-utils": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.10.tgz", - "integrity": "sha512-ZK9gwhfqJLnrPBIWe4tUmdm01KnLcbzoJHze18/Z4/dJxp7xfLAW/iL6RiKSA3+LBy85g49gt508DCYtQkDs9w==", + "version": "6.0.15", + "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.15.tgz", + "integrity": "sha512-y+6u2+pPU4FQRAjGmL2zFCJ39evO/5CvR2Yh8kT7o+ZG02VODGr754e8lEFPt4WO2O5fDMlIyH/7ewIGhZVLGw==", "dev": true, "dependencies": { - "@truffle/codec": "^0.12.0", + "@truffle/codec": "^0.12.5", "@trufflesuite/chromafi": "^3.0.0", "bn.js": "^5.1.3", "chalk": "^2.4.2", "debug": "^4.3.1", - "highlightjs-solidity": "^2.0.4" + "highlightjs-solidity": "^2.0.5" } }, "node_modules/@truffle/contract/node_modules/@truffle/debug-utils/node_modules/bn.js": { @@ -2201,9 +2261,9 @@ "dev": true }, "node_modules/@truffle/contract/node_modules/@truffle/interface-adapter": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.11.tgz", - "integrity": "sha512-HXLm+r1KdT8nHzJht1iK6EnHBKIjSYHdDfebBMCqmRCsMoUXvUJ0KsIxvDG758MafB12pjx5gsNn4XzzfksSBQ==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.12.tgz", + "integrity": "sha512-Qrc5VARnvSILYqZNsAM0xsUHqGqphLXVdIvDnhUA1Xj1xyNz8iboTr8bXorMd+Uspw+PXmsW44BJ/Wioo/jL2A==", "dev": true, "dependencies": { "bn.js": "^5.1.3", @@ -2243,9 +2303,9 @@ } }, "node_modules/@truffle/contract/node_modules/@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "node_modules/@truffle/contract/node_modules/ansi-styles": { @@ -2260,6 +2320,19 @@ "node": ">=4" } }, + "node_modules/@truffle/contract/node_modules/big.js": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-6.1.1.tgz", + "integrity": "sha512-1vObw81a8ylZO5ePrtMay0n018TcftpTA5HFKDaSuiUDBo8biRBtjIobw60OpwuvrGk+FsxKamqN4cnmj/eXdg==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/bigjs" + } + }, "node_modules/@truffle/contract/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -2328,9 +2401,9 @@ } }, "node_modules/@truffle/contract/node_modules/highlightjs-solidity": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.4.tgz", - "integrity": "sha512-jsmfDXrjjxt4LxWfzp27j4CX6qYk6B8uK8sxzEDyGts8Ut1IuVlFCysAu6n5RrgHnuEKA+SCIcGPweO7qlPhCg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.5.tgz", + "integrity": "sha512-ReXxQSGQkODMUgHcWzVSnfDCDrL2HshOYgw3OlIYmfHeRzUPkfJTUIp95pK4CmbiNG2eMTOmNLpfCz9Zq7Cwmg==", "dev": true }, "node_modules/@truffle/contract/node_modules/supports-color": { @@ -2830,9 +2903,9 @@ } }, "node_modules/@truffle/interface-adapter/node_modules/@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "node_modules/@truffle/interface-adapter/node_modules/bignumber.js": { @@ -3244,13 +3317,13 @@ "dev": true }, "node_modules/@truffle/provider": { - "version": "0.2.47", - "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.47.tgz", - "integrity": "sha512-Y9VRLsdMcfEicZjxxcwA0y9pqnwJx0JX/UDeHDHZmymx3KIJwI3VpxRPighfHAmvDRksic6Yj4iL0CmiEDR5kg==", + "version": "0.2.50", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.50.tgz", + "integrity": "sha512-GCoyX8SncfgizXYJfordv5kiysQS7S1311D3ewciixaoQpTkbqC3s0wxwHlPxU7m5wJOCw2K8rQtL3oIFfeHwA==", "dev": true, "dependencies": { "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.11", + "@truffle/interface-adapter": "^0.5.12", "web3": "1.5.3" } }, @@ -3278,9 +3351,9 @@ "dev": true }, "node_modules/@truffle/provider/node_modules/@truffle/interface-adapter": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.11.tgz", - "integrity": "sha512-HXLm+r1KdT8nHzJht1iK6EnHBKIjSYHdDfebBMCqmRCsMoUXvUJ0KsIxvDG758MafB12pjx5gsNn4XzzfksSBQ==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.12.tgz", + "integrity": "sha512-Qrc5VARnvSILYqZNsAM0xsUHqGqphLXVdIvDnhUA1Xj1xyNz8iboTr8bXorMd+Uspw+PXmsW44BJ/Wioo/jL2A==", "dev": true, "dependencies": { "bn.js": "^5.1.3", @@ -3298,9 +3371,9 @@ } }, "node_modules/@truffle/provider/node_modules/@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "node_modules/@truffle/provider/node_modules/bignumber.js": { @@ -3891,9 +3964,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", - "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==", + "version": "17.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", + "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==", "dev": true }, "node_modules/@types/pbkdf2": { @@ -4043,15 +4116,6 @@ "node": ">=8" } }, - "node_modules/aggregate-error/node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -4199,9 +4263,9 @@ } }, "node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true, "engines": { "node": ">=4" @@ -4712,23 +4776,15 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, + "optional": true, "dependencies": { "file-uri-to-path": "1.0.0" } }, - "node_modules/bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, "node_modules/blakejs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", - "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", "dev": true }, "node_modules/bluebird": { @@ -4744,24 +4800,27 @@ "dev": true }, "node_modules/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", "dev": true, "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" } }, "node_modules/body-parser/node_modules/debug": { @@ -4773,59 +4832,19 @@ "ms": "2.0.0" } }, - "node_modules/body-parser/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/body-parser/node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/body-parser/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", - "dev": true, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/body-parser/node_modules/raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "node_modules/body-parser/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "dependencies": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "ee-first": "1.1.1" }, "engines": { "node": ">= 0.8" @@ -5341,16 +5360,16 @@ } }, "node_modules/cheerio-select": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz", - "integrity": "sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.6.0.tgz", + "integrity": "sha512-eq0GdBvxVFbqWgmCm7M3XGs1I8oLy/nExUnh6oLqmBditPO9AqQJrkslDpMun/hZ0yyTs8L0m85OHp4ho6Qm9g==", "dev": true, "dependencies": { - "css-select": "^4.1.3", - "css-what": "^5.0.1", + "css-select": "^4.3.0", + "css-what": "^6.0.1", "domelementtype": "^2.2.0", - "domhandler": "^4.2.0", - "domutils": "^2.7.0" + "domhandler": "^4.3.1", + "domutils": "^2.8.0" }, "funding": { "url": "https://github.com/sponsors/fb55" @@ -5456,18 +5475,12 @@ } }, "node_modules/clean-stack": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", - "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true, - "dependencies": { - "escape-string-regexp": "4.0.0" - }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, "node_modules/cli-cursor": { @@ -5874,14 +5887,10 @@ } }, "node_modules/crc-32": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.1.tgz", - "integrity": "sha512-Dn/xm/1vFFgs3nfrpEVScHoIslO9NZRITWGz/1E/St6u4xw99vfZzVkW0OSnzx2h9egej9xwMCEut6sqwokM/w==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", "dev": true, - "dependencies": { - "exit-on-epipe": "~1.0.1", - "printj": "~1.3.1" - }, "bin": { "crc32": "bin/crc32.njs" }, @@ -5993,14 +6002,14 @@ "dev": true }, "node_modules/css-select": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.2.1.tgz", - "integrity": "sha512-/aUslKhzkTNCQUB2qTX84lVmfia9NyjP3WpDGtj/WxhwBzWBYUV3DgUpurHTme8UTPcPlAD1DJ+b0nN/t50zDQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", "dev": true, "dependencies": { "boolbase": "^1.0.0", - "css-what": "^5.1.0", - "domhandler": "^4.3.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", "domutils": "^2.8.0", "nth-check": "^2.0.1" }, @@ -6009,9 +6018,9 @@ } }, "node_modules/css-what": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.1.0.tgz", - "integrity": "sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", "dev": true, "engines": { "node": ">= 6" @@ -6049,9 +6058,9 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -6066,12 +6075,15 @@ } }, "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/decode-uri-component": { @@ -6207,10 +6219,14 @@ } }, "node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } }, "node_modules/detect-indent": { "version": "5.0.0", @@ -6254,9 +6270,9 @@ "dev": true }, "node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, "engines": { "node": ">=0.3.1" @@ -6330,9 +6346,9 @@ ] }, "node_modules/domhandler": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.0.tgz", - "integrity": "sha512-fC0aXNQXqKSFTr2wDNZDhsEYjCiYsDWl3D01kwt25hm1YIPyDGHvvi3rw+PLqHAl/m71MaiF7d5zvBr0p5UB2g==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", + "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", "dev": true, "dependencies": { "domelementtype": "^2.2.0" @@ -6367,20 +6383,6 @@ "no-case": "^2.2.0" } }, - "node_modules/drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "dev": true, - "dependencies": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -6425,9 +6427,9 @@ } }, "node_modules/emoji-regex": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.0.0.tgz", - "integrity": "sha512-KmJa8l6uHi1HrBI34udwlzZY1jOEuID/ft4d8BSSEdRyap7PwBEt910453PJa5MuGvxkLqlt4Uvhu7tttFHViw==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.1.0.tgz", + "integrity": "sha512-xAEnNCT3w2Tg6MA7ly6QqYJvEoY1tm9iIjJ3yMKK9JPlWuRHAMoe5iETwQnx3M9TVbFMfsrBgWKR+IsmswwNjg==", "dev": true }, "node_modules/encodeurl": { @@ -6524,9 +6526,9 @@ } }, "node_modules/es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.2.tgz", + "integrity": "sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w==", "dev": true, "dependencies": { "call-bind": "^1.0.2", @@ -6535,15 +6537,15 @@ "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.2", + "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", + "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.1", "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -6575,14 +6577,18 @@ } }, "node_modules/es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "version": "0.10.59", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.59.tgz", + "integrity": "sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw==", "dev": true, + "hasInstallScript": true, "dependencies": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" } }, "node_modules/es6-iterator": { @@ -6939,9 +6945,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "dependencies": { "array-includes": "^3.1.4", @@ -6949,14 +6955,14 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "is-core-module": "^2.8.0", + "is-core-module": "^2.8.1", "is-glob": "^4.0.3", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "engines": { "node": ">=4" @@ -7281,16 +7287,16 @@ "dev": true }, "node_modules/eth-gas-reporter": { - "version": "0.2.24", - "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.24.tgz", - "integrity": "sha512-RbXLC2bnuPHzIMU/rnLXXlb6oiHEEKu7rq2UrAX/0mfo0Lzrr/kb9QTjWjfz8eNvc+uu6J8AuBwI++b+MLNI2w==", + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.25.tgz", + "integrity": "sha512-1fRgyE4xUB8SoqLgN3eDfpDfwEfRxh2Sz1b7wzFbyQA+9TekMmvSjjoRu9SKcSVyK+vLkLIsVbJDsTWjw195OQ==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.0.0-beta.146", "@solidity-parser/parser": "^0.14.0", "cli-table3": "^0.5.0", "colors": "1.4.0", - "ethereumjs-util": "6.2.0", + "ethereum-cryptography": "^1.0.3", "ethers": "^4.0.40", "fs-readdir-recursive": "^1.1.0", "lodash": "^4.17.14", @@ -7311,64 +7317,516 @@ } } }, - "node_modules/eth-gas-reporter/node_modules/@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==", + "node_modules/eth-gas-reporter/node_modules/ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", "dev": true, - "dependencies": { - "@types/node": "*" + "engines": { + "node": ">=6" } }, - "node_modules/eth-gas-reporter/node_modules/ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "node_modules/eth-gas-reporter/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true, - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" + "engines": { + "node": ">=6" } }, - "node_modules/eth-gas-reporter/node_modules/keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", + "node_modules/eth-gas-reporter/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "hasInstallScript": true, "dependencies": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" + "color-convert": "^1.9.0" }, "engines": { - "node": ">=5.12.0" + "node": ">=4" } }, - "node_modules/eth-gas-reporter/node_modules/secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "node_modules/eth-gas-reporter/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/eth-gas-reporter/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "hasInstallScript": true, "dependencies": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">=4.0.0" + "node": ">=4" + } + }, + "node_modules/eth-gas-reporter/node_modules/chalk/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eth-gas-reporter/node_modules/chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.1.1" + } + }, + "node_modules/eth-gas-reporter/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/eth-gas-reporter/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/eth-gas-reporter/node_modules/debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eth-gas-reporter/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/eth-gas-reporter/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/eth-gas-reporter/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/ethereum-cryptography": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.0.3.tgz", + "integrity": "sha512-NQLTW0x0CosoVb/n79x/TRHtfvS3hgNUPTUSCu0vM+9k6IIhHFFrAOJReneexjZsoZxMjJHnJn4lrE8EbnSyqQ==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.0.0", + "@noble/secp256k1": "1.5.5", + "@scure/bip32": "1.0.1", + "@scure/bip39": "1.0.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eth-gas-reporter/node_modules/flat": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", + "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", + "dev": true, + "dependencies": { + "is-buffer": "~2.0.3" + }, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/eth-gas-reporter/node_modules/fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "deprecated": "\"Please update to latest v2.3 or v2.2\"", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eth-gas-reporter/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eth-gas-reporter/node_modules/js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eth-gas-reporter/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eth-gas-reporter/node_modules/log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "dependencies": { + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eth-gas-reporter/node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eth-gas-reporter/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/eth-gas-reporter/node_modules/mocha": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", + "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "dev": true, + "dependencies": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "chokidar": "3.3.0", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.5", + "ms": "2.1.1", + "node-environment-flags": "1.0.6", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/eth-gas-reporter/node_modules/ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "node_modules/eth-gas-reporter/node_modules/object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eth-gas-reporter/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eth-gas-reporter/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eth-gas-reporter/node_modules/readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "dev": true, + "dependencies": { + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/eth-gas-reporter/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eth-gas-reporter/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eth-gas-reporter/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eth-gas-reporter/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/eth-gas-reporter/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eth-gas-reporter/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/eth-gas-reporter/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "node_modules/eth-gas-reporter/node_modules/yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "dependencies": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/eth-lib": { @@ -7755,15 +8213,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/exit-on-epipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz", - "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -7838,6 +8287,27 @@ "node": ">= 0.10.0" } }, + "node_modules/express/node_modules/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -7856,6 +8326,28 @@ "node": ">= 0.6" } }, + "node_modules/express/node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "node_modules/express/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -7874,6 +8366,51 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/express/node_modules/raw-body": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", + "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/send": { + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", + "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "dev": true, + "dependencies": { + "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.8.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/express/node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/ext": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", @@ -8006,12 +8543,12 @@ "dev": true }, "node_modules/fast-check": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.22.0.tgz", - "integrity": "sha512-Yrx1E8fZk6tfSqYaNkwnxj/lOk+vj2KTbbpHDtYoK9MrrL/D204N/rCtcaVSz5bE29g6gW4xj0byresjlFyybg==", + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.24.0.tgz", + "integrity": "sha512-iNXbN90lbabaCUfnW5jyXYPwMJLFYl09eJDkXA9ZoidFlBK63gNRvcKxv+8D1OJ1kIYjwBef4bO/K3qesUeWLQ==", "dev": true, "dependencies": { - "pure-rand": "^5.0.0" + "pure-rand": "^5.0.1" }, "engines": { "node": ">=8.0.0" @@ -8119,7 +8656,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true + "dev": true, + "optional": true }, "node_modules/fill-range": { "version": "7.0.1", @@ -8180,13 +8718,10 @@ } }, "node_modules/flat": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", - "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, - "dependencies": { - "is-buffer": "~2.0.3" - }, "bin": { "flat": "cli.js" } @@ -8623,9 +9158,9 @@ } }, "node_modules/globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -8688,9 +9223,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, "node_modules/graphlib": { @@ -8765,9 +9300,9 @@ } }, "node_modules/hardhat": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.1.tgz", - "integrity": "sha512-q0AkYXV7R26RzyAkHGQRhhQjk508pseVvH3wSwZwwPUbvA+tjl0vMIrD4aFQDonRXkrnXX4+5KglozzjSd0//Q==", + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.3.tgz", + "integrity": "sha512-7Vw99RbYbMZ15UzegOR/nqIYIqddZXvLwJGaX5sX4G5bydILnbjmDU6g3jMKJSiArEixS3vHAEaOs5CW1JQ3hg==", "dev": true, "dependencies": { "@ethereumjs/block": "^3.6.0", @@ -8840,24 +9375,6 @@ "hardhat": "^2.0.2" } }, - "node_modules/hardhat/node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/hardhat/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/hardhat/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -8870,24 +9387,6 @@ "node": ">=4" } }, - "node_modules/hardhat/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/hardhat/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/hardhat/node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -8923,33 +9422,6 @@ "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, - "node_modules/hardhat/node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hardhat/node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/hardhat/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "node_modules/hardhat/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -8971,15 +9443,6 @@ "node": ">=4" } }, - "node_modules/hardhat/node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "bin": { - "flat": "cli.js" - } - }, "node_modules/hardhat/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -8989,36 +9452,6 @@ "node": ">=4" } }, - "node_modules/hardhat/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/hardhat/node_modules/jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", @@ -9041,259 +9474,6 @@ "node": ">=4" } }, - "node_modules/hardhat/node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hardhat/node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/hardhat/node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/hardhat/node_modules/log-symbols/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/hardhat/node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/hardhat/node_modules/log-symbols/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat/node_modules/log-symbols/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/hardhat/node_modules/mocha": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz", - "integrity": "sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==", - "dev": true, - "dependencies": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "3.0.4", - "ms": "2.1.3", - "nanoid": "3.2.0", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/hardhat/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/hardhat/node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -9423,32 +9603,6 @@ "semver": "bin/semver" } }, - "node_modules/hardhat/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/hardhat/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -9461,48 +9615,6 @@ "node": ">=4" } }, - "node_modules/hardhat/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/hardhat/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/hardhat/node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -9543,9 +9655,9 @@ } }, "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, "engines": { "node": ">= 0.4" @@ -9824,9 +9936,9 @@ "dev": true }, "node_modules/http-parser-js": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.5.tgz", - "integrity": "sha512-x+JVEkO2PoM8qqpbPbOL3cqHPwerep7OwzK7Ay+sMQjKzaKCqWvjoXm5tqMP9tXWWTnTzAjIhXg+J99XYuPhPA==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.6.tgz", + "integrity": "sha512-vDlkRPDJn93swjcjqMSaGSPABbIarsr1TLAui/gLDXzV5VsJNdXNzMYDyNBLQkjWQCJ1uizu8T2oDMhmGt0PRA==", "dev": true }, "node_modules/http-response-object": { @@ -10027,9 +10139,9 @@ } }, "node_modules/inquirer/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true, "engines": { "node": ">=6" @@ -10500,9 +10612,9 @@ } }, "node_modules/is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" @@ -10524,12 +10636,12 @@ } }, "node_modules/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=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/is-plain-object": { @@ -10579,10 +10691,13 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10834,13 +10949,10 @@ } }, "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -11589,86 +11701,35 @@ "dev": true }, "node_modules/log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "chalk": "^2.4.2" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" + "node": ">=10" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-symbols/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/log-symbols/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" + "node": ">=10" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/loupe": { @@ -11851,9 +11912,9 @@ } }, "node_modules/merkle-patricia-tree": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.3.tgz", - "integrity": "sha512-S4xevdXl5KvdBGgUxhQcxoep0onqXiIhzfwZp4M78kIuJH3Pu9o9IUgqhzSFOR2ykLO6t265026Xb6PY0q2UFQ==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz", + "integrity": "sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w==", "dev": true, "dependencies": { "@types/levelup": "^4.3.0", @@ -11865,9 +11926,9 @@ } }, "node_modules/merkletreejs": { - "version": "0.2.30", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.30.tgz", - "integrity": "sha512-gBKGRAx8CUjAneaE48U92ObjTp2lD6iYk61ub12NI1YjpNgJ12ROGN+PlZ4G5RyKcs81ArGHRDOt08wkojMGgg==", + "version": "0.2.31", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.31.tgz", + "integrity": "sha512-dnK2sE43OebmMe5Qnq1wXvvMIjZjm1u6CcB2KeW6cghlN4p21OpCUr2p56KTVf20KJItNChVsGnimcscp9f+yw==", "dev": true, "dependencies": { "bignumber.js": "^9.0.1", @@ -11899,13 +11960,13 @@ } }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -11937,21 +11998,21 @@ } }, "node_modules/mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "dependencies": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -12018,9 +12079,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/minipass": { @@ -12068,12 +12129,12 @@ } }, "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "dependencies": { - "minimist": "^1.2.5" + "minimist": "^1.2.6" }, "bin": { "mkdirp": "bin/cmd.js" @@ -12102,42 +12163,42 @@ } }, "node_modules/mocha": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", - "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "dependencies": { - "ansi-colors": "3.2.3", + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", "mocha": "bin/mocha" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 12.0.0" }, "funding": { "type": "opencollective", @@ -12145,347 +12206,215 @@ } }, "node_modules/mocha/node_modules/ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, "engines": { "node": ">=6" } }, "node_modules/mocha/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/mocha/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mocha/node_modules/chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.1.1" - } - }, - "node_modules/mocha/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/mocha/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/mocha/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "node_modules/mocha/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "node_modules/mocha/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/mocha/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/mocha/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } + "node_modules/mocha/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/mocha/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "deprecated": "\"Please update to latest v2.3 or v2.2\"", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/mocha/node_modules/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "node": ">=10" }, - "engines": { - "node": "*" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mocha/node_modules/has-flag": { + "node_modules/mocha/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/mocha/node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "node_modules/mocha/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/mocha/node_modules/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==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/mocha/node_modules/object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "node_modules/mocha/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "p-limit": "^2.0.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/mocha/node_modules/readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", - "dev": true, - "dependencies": { - "picomatch": "^2.0.4" + "node": ">=10" }, - "engines": { - "node": ">= 8" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/mocha/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/mocha/node_modules/supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" + "node": ">=10" }, - "bin": { - "which": "bin/which" + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/mocha/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/mocha/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, "node_modules/mocha/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" } }, "node_modules/mock-fs": { @@ -12584,7 +12513,8 @@ "version": "2.15.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", - "dev": true + "dev": true, + "optional": true }, "node_modules/nano-base32": { "version": "1.0.1", @@ -12599,9 +12529,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -12730,9 +12660,9 @@ "dev": true }, "node_modules/next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, "node_modules/nice-try": { @@ -12785,9 +12715,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", "dev": true, "bin": { "node-gyp-build": "bin.js", @@ -13276,9 +13206,9 @@ "dev": true }, "node_modules/parse-headers": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.4.tgz", - "integrity": "sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", + "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==", "dev": true }, "node_modules/parse-json": { @@ -13516,15 +13446,18 @@ } }, "node_modules/prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true, "bin": { "prettier": "bin-prettier.js" }, "engines": { "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-plugin-solidity": { @@ -13597,18 +13530,6 @@ "node": ">=8" } }, - "node_modules/printj": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/printj/-/printj-1.3.1.tgz", - "integrity": "sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg==", - "dev": true, - "bin": { - "printj": "bin/printj.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -13710,9 +13631,9 @@ } }, "node_modules/pure-rand": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-5.0.0.tgz", - "integrity": "sha512-lD2/y78q+7HqBx2SaT6OT4UcwtvXNRfEpzYEzl0EQ+9gZq2Qi3fa0HDnYPeqQwhlHJFBUhT7AO3mLU3+8bynHA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-5.0.1.tgz", + "integrity": "sha512-ksWccjmXOHU2gJBnH0cK1lSYdvSZ0zLoCMSz/nTGh6hDvCSgcRxDyIcOBD6KNxFz3xhMPm/T267Tbe2JRymKEQ==", "dev": true, "funding": { "type": "opencollective", @@ -14555,24 +14476,24 @@ "dev": true }, "node_modules/send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dev": true, "dependencies": { "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", + "depd": "2.0.0", + "destroy": "1.2.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "mime": "1.6.0", "ms": "2.1.3", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "statuses": "2.0.1" }, "engines": { "node": ">= 0.8.0" @@ -14593,37 +14514,33 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "node_modules/send/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/send/node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node_modules/send/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/sentence-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-2.1.1.tgz", @@ -14727,6 +14644,82 @@ "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-static/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/serve-static/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-static/node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "node_modules/serve-static/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-static/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/serve-static/node_modules/send": { + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", + "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "dev": true, + "dependencies": { + "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.8.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/servify": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", @@ -15150,6 +15143,15 @@ "wrap-ansi": "^2.0.0" } }, + "node_modules/solc/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/solc/node_modules/fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", @@ -15341,9 +15343,9 @@ } }, "node_modules/solhint/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true, "engines": { "node": ">=6" @@ -15815,9 +15817,9 @@ } }, "node_modules/solidity-ast": { - "version": "0.4.30", - "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.30.tgz", - "integrity": "sha512-3xsQIbZEPx6w7+sQokuOvk1RkMb5GIpuK0GblQDIH6IAkU4+uyJQVJIRNP+8KwhzkViwRKq0hS4zLqQNLKpxOA==", + "version": "0.4.31", + "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.31.tgz", + "integrity": "sha512-kX6o4XE4ihaqENuRRTMJfwQNHoqWusPENZUlX4oVb19gQdfi7IswFWnThONHSW/61umgfWdKtCBgW45iuOTryQ==", "dev": true }, "node_modules/solidity-comments-extractor": { @@ -16520,6 +16522,15 @@ "node": ">=4" } }, + "node_modules/swarm-js/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/swarm-js/node_modules/p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", @@ -16590,9 +16601,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -16955,14 +16966,14 @@ "dev": true }, "node_modules/tsconfig-paths": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", - "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.1", - "minimist": "^1.2.0", + "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, @@ -17082,9 +17093,9 @@ } }, "node_modules/uglify-js": { - "version": "3.15.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.2.tgz", - "integrity": "sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==", + "version": "3.15.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.3.tgz", + "integrity": "sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg==", "dev": true, "optional": true, "bin": { @@ -17122,9 +17133,9 @@ "dev": true }, "node_modules/undici": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-4.15.1.tgz", - "integrity": "sha512-h8LJybhMKD09IyQZoQadNtIR/GmugVhTOVREunJrpV6RStriKBFdSVoFzEzTihwXi/27DIBO+Z0OGF+Mzfi0lA==", + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-4.16.0.tgz", + "integrity": "sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==", "dev": true, "engines": { "node": ">=12.18" @@ -17295,9 +17306,9 @@ } }, "node_modules/utf-8-validate": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.8.tgz", - "integrity": "sha512-k4dW/Qja1BYDl2qD4tOMB9PFVha/UJtxTc1cXYOe3WwA/2m0Yn4qB7wLMpJyLJ/7DR0XnTut3HsCSzDT4ZvKgA==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -17397,28 +17408,28 @@ } }, "node_modules/web3": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.7.0.tgz", - "integrity": "sha512-n39O7QQNkpsjhiHMJ/6JY6TaLbdX+2FT5iGs8tb3HbIWOhPm4+a7UDbr5Lkm+gLa9aRKWesZs5D5hWyEvg4aJA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.7.1.tgz", + "integrity": "sha512-RKVdyZ5FuVEykj62C1o2tc0teJciSOh61jpVB9yb344dBHO3ZV4XPPP24s/PPqIMXmVFN00g2GD9M/v1SoHO/A==", "dev": true, "hasInstallScript": true, "dependencies": { - "web3-bzz": "1.7.0", - "web3-core": "1.7.0", - "web3-eth": "1.7.0", - "web3-eth-personal": "1.7.0", - "web3-net": "1.7.0", - "web3-shh": "1.7.0", - "web3-utils": "1.7.0" + "web3-bzz": "1.7.1", + "web3-core": "1.7.1", + "web3-eth": "1.7.1", + "web3-eth-personal": "1.7.1", + "web3-net": "1.7.1", + "web3-shh": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-bzz": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.7.0.tgz", - "integrity": "sha512-XPhTWUnZa8gnARfiqaag3jJ9+6+a66Li8OikgBUJoMUqPuQTCJPncTbGYqOJIfRFGavEAdlMnfYXx9lvgv2ZPw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.7.1.tgz", + "integrity": "sha512-sVeUSINx4a4pfdnT+3ahdRdpDPvZDf4ZT/eBF5XtqGWq1mhGTl8XaQAk15zafKVm6Onq28vN8abgB/l+TrG8kA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -17431,62 +17442,62 @@ } }, "node_modules/web3-bzz/node_modules/@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "node_modules/web3-core": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.7.0.tgz", - "integrity": "sha512-U/CRL53h3T5KHl8L3njzCBT7fCaHkbE6BGJe3McazvFldRbfTDEHXkUJCyM30ZD0RoLi3aDfTVeFIusmEyCctA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.7.1.tgz", + "integrity": "sha512-HOyDPj+4cNyeNPwgSeUkhtS0F+Pxc2obcm4oRYPW5ku6jnTO34pjaij0us+zoY3QEusR8FfAKVK1kFPZnS7Dzw==", "dev": true, "dependencies": { "@types/bn.js": "^4.11.5", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-core-requestmanager": "1.7.0", - "web3-utils": "1.7.0" + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-core-requestmanager": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-helpers": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.7.0.tgz", - "integrity": "sha512-kFiqsZFHJliKF8VKZNjt2JvKu3gu7h3N1/ke3EPhdp9Li/rLmiyzFVr6ApryZ1FSjbSx6vyOkibG3m6xQ5EHJA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.7.1.tgz", + "integrity": "sha512-xn7Sx+s4CyukOJdlW8bBBDnUCWndr+OCJAlUe/dN2wXiyaGRiCWRhuQZrFjbxLeBt1fYFH7uWyYHhYU6muOHgw==", "dev": true, "dependencies": { - "web3-eth-iban": "1.7.0", - "web3-utils": "1.7.0" + "web3-eth-iban": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-method": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.7.0.tgz", - "integrity": "sha512-43Om+kZX8wU5u1pJ28TltF9e9pSTRph6b8wrOb6wgXAfPHqMulq6UTBJWjXXIRVN46Eiqv0nflw35hp9bbgnbA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.7.1.tgz", + "integrity": "sha512-383wu5FMcEphBFl5jCjk502JnEg3ugHj7MQrsX7DY76pg5N5/dEzxeEMIJFCN6kr5Iq32NINOG3VuJIyjxpsEg==", "dev": true, "dependencies": { "@ethersproject/transactions": "^5.0.0-beta.135", - "web3-core-helpers": "1.7.0", - "web3-core-promievent": "1.7.0", - "web3-core-subscriptions": "1.7.0", - "web3-utils": "1.7.0" + "web3-core-helpers": "1.7.1", + "web3-core-promievent": "1.7.1", + "web3-core-subscriptions": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-promievent": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.7.0.tgz", - "integrity": "sha512-xPH66XeC0K0k29GoRd0vyPQ07yxERPRd4yVPrbMzGAz/e9E4M3XN//XK6+PdfGvGw3fx8VojS+tNIMiw+PujbQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.7.1.tgz", + "integrity": "sha512-Vd+CVnpPejrnevIdxhCkzMEywqgVbhHk/AmXXceYpmwA6sX41c5a65TqXv1i3FWRJAz/dW7oKz9NAzRIBAO/kA==", "dev": true, "dependencies": { "eventemitter3": "4.0.4" @@ -17496,29 +17507,29 @@ } }, "node_modules/web3-core-requestmanager": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.7.0.tgz", - "integrity": "sha512-rA3dBTBPrt+eIfTAQ2/oYNTN/2wbZaYNR3pFZGqG8+2oCK03+7oQyz4sWISKy/nYQhURh4GK01rs9sN4o/Tq9w==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.7.1.tgz", + "integrity": "sha512-/EHVTiMShpZKiq0Jka0Vgguxi3vxq1DAHKxg42miqHdUsz4/cDWay2wGALDR2x3ofDB9kqp7pb66HsvQImQeag==", "dev": true, "dependencies": { "util": "^0.12.0", - "web3-core-helpers": "1.7.0", - "web3-providers-http": "1.7.0", - "web3-providers-ipc": "1.7.0", - "web3-providers-ws": "1.7.0" + "web3-core-helpers": "1.7.1", + "web3-providers-http": "1.7.1", + "web3-providers-ipc": "1.7.1", + "web3-providers-ws": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-subscriptions": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.7.0.tgz", - "integrity": "sha512-6giF8pyJrPmWrRpc2WLoVCvQdMMADp20ZpAusEW72axauZCNlW1XfTjs0i4QHQBfdd2lFp65qad9IuATPhuzrQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.7.1.tgz", + "integrity": "sha512-NZBsvSe4J+Wt16xCf4KEtBbxA9TOwSVr8KWfUQ0tC2KMdDYdzNswl0Q9P58xaVuNlJ3/BH+uDFZJJ5E61BSA1Q==", "dev": true, "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.7.0" + "web3-core-helpers": "1.7.1" }, "engines": { "node": ">=8.0.0" @@ -17534,9 +17545,9 @@ } }, "node_modules/web3-core/node_modules/@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "node_modules/web3-core/node_modules/bignumber.js": { @@ -17549,36 +17560,36 @@ } }, "node_modules/web3-eth": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.7.0.tgz", - "integrity": "sha512-3uYwjMjn/MZjKIzXCt4YL9ja/k9X5shfa4lKparZhZE6uesmu+xmSmrEFXA/e9qcveF50jkV7frjkT8H+cLYtw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.7.1.tgz", + "integrity": "sha512-Uz3gO4CjTJ+hMyJZAd2eiv2Ur1uurpN7sTMATWKXYR/SgG+SZgncnk/9d8t23hyu4lyi2GiVL1AqVqptpRElxg==", "dev": true, "dependencies": { - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-core-subscriptions": "1.7.0", - "web3-eth-abi": "1.7.0", - "web3-eth-accounts": "1.7.0", - "web3-eth-contract": "1.7.0", - "web3-eth-ens": "1.7.0", - "web3-eth-iban": "1.7.0", - "web3-eth-personal": "1.7.0", - "web3-net": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-core-subscriptions": "1.7.1", + "web3-eth-abi": "1.7.1", + "web3-eth-accounts": "1.7.1", + "web3-eth-contract": "1.7.1", + "web3-eth-ens": "1.7.1", + "web3-eth-iban": "1.7.1", + "web3-eth-personal": "1.7.1", + "web3-net": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-abi": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.0.tgz", - "integrity": "sha512-heqR0bWxgCJwjWIhq2sGyNj9bwun5+Xox/LdZKe+WMyTSy0cXDXEAgv3XKNkXC4JqdDt/ZlbTEx4TWak4TRMSg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.1.tgz", + "integrity": "sha512-8BVBOoFX1oheXk+t+uERBibDaVZ5dxdcefpbFTWcBs7cdm0tP8CD1ZTCLi5Xo+1bolVHNH2dMSf/nEAssq5pUA==", "dev": true, "dependencies": { "@ethersproject/abi": "5.0.7", - "web3-utils": "1.7.0" + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" @@ -17602,9 +17613,9 @@ } }, "node_modules/web3-eth-accounts": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.7.0.tgz", - "integrity": "sha512-Zwm7TlQXdXGRuS6+ib1YsR5fQwpfnFyL6UAZg1zERdrUrs3IkCZSL3yCP/8ZYbAjdTEwWljoott2iSqXNH09ug==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.7.1.tgz", + "integrity": "sha512-3xGQ2bkTQc7LFoqGWxp5cQDrKndlX05s7m0rAFVoyZZODMqrdSGjMPMqmWqHzJRUswNEMc+oelqSnGBubqhguQ==", "dev": true, "dependencies": { "@ethereumjs/common": "^2.5.0", @@ -17614,10 +17625,10 @@ "ethereumjs-util": "^7.0.10", "scrypt-js": "^3.0.1", "uuid": "3.3.2", - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" @@ -17645,19 +17656,19 @@ } }, "node_modules/web3-eth-contract": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.7.0.tgz", - "integrity": "sha512-2LY1Xwxu5rx468nqHuhvupQAIpytxIUj3mGL9uexszkhrQf05THVe3i4OnUCzkeN6B2cDztNOqLT3j9SSnVQDg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.7.1.tgz", + "integrity": "sha512-HpnbkPYkVK3lOyos2SaUjCleKfbF0SP3yjw7l551rAAi5sIz/vwlEzdPWd0IHL7ouxXbO0tDn7jzWBRcD3sTbA==", "dev": true, "dependencies": { "@types/bn.js": "^4.11.5", - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-core-promievent": "1.7.0", - "web3-core-subscriptions": "1.7.0", - "web3-eth-abi": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-core-promievent": "1.7.1", + "web3-core-subscriptions": "1.7.1", + "web3-eth-abi": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" @@ -17673,81 +17684,81 @@ } }, "node_modules/web3-eth-ens": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.7.0.tgz", - "integrity": "sha512-I1bikYJJWQ/FJZIAvwsGOvzAgcRIkosWG4s1L6veRoXaU8OEJFeh4s00KcfHDxg7GWZZGbUSbdbzKpwRbWnvkg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.7.1.tgz", + "integrity": "sha512-DVCF76i9wM93DrPQwLrYiCw/UzxFuofBsuxTVugrnbm0SzucajLLNftp3ITK0c4/lV3x9oo5ER/wD6RRMHQnvw==", "dev": true, "dependencies": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-promievent": "1.7.0", - "web3-eth-abi": "1.7.0", - "web3-eth-contract": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-promievent": "1.7.1", + "web3-eth-abi": "1.7.1", + "web3-eth-contract": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-iban": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.7.0.tgz", - "integrity": "sha512-1PFE/Og+sPZaug+M9TqVUtjOtq0HecE+SjDcsOOysXSzslNC2CItBGkcRwbvUcS+LbIkA7MFsuqYxOL0IV/gyA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.7.1.tgz", + "integrity": "sha512-XG4I3QXuKB/udRwZdNEhdYdGKjkhfb/uH477oFVMLBqNimU/Cw8yXUI5qwFKvBHM+hMQWfzPDuSDEDKC2uuiMg==", "dev": true, "dependencies": { "bn.js": "^4.11.9", - "web3-utils": "1.7.0" + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-personal": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.0.tgz", - "integrity": "sha512-Dr9RZTNOR80PhrPKGdktDUXpOgExEcCcosBj080lKCJFU1paSPj9Zfnth3u6BtIOXyKsVFTrpqekqUDyAwXnNw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.1.tgz", + "integrity": "sha512-02H6nFBNfNmFjMGZL6xcDi0r7tUhxrUP91FTFdoLyR94eIJDadPp4rpXfG7MVES873i1PReh4ep5pSCHbc3+Pg==", "dev": true, "dependencies": { "@types/node": "^12.12.6", - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-net": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-net": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-personal/node_modules/@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "node_modules/web3-net": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.7.0.tgz", - "integrity": "sha512-8pmfU1Se7DmG40Pu8nOCKlhuI12VsVzCtdFDnLAai0zGVAOUuuOCK71B2aKm6u9amWBJjtOlyrCwvsG+QEd6dw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.7.1.tgz", + "integrity": "sha512-8yPNp2gvjInWnU7DCoj4pIPNhxzUjrxKlODsyyXF8j0q3Z2VZuQp+c63gL++r2Prg4fS8t141/HcJw4aMu5sVA==", "dev": true, "dependencies": { - "web3-core": "1.7.0", - "web3-core-method": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-method": "1.7.1", + "web3-utils": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-http": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.7.0.tgz", - "integrity": "sha512-Y9reeEiApfvQKLUUtrU4Z0c+H6b7BMWcsxjgoXndI1C5NB297mIUfltXxfXsh5C/jk5qn4Q3sJp3SwQTyVjH7Q==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.7.1.tgz", + "integrity": "sha512-dmiO6G4dgAa3yv+2VD5TduKNckgfR97VI9YKXVleWdcpBoKXe2jofhdvtafd42fpIoaKiYsErxQNcOC5gI/7Vg==", "dev": true, "dependencies": { - "web3-core-helpers": "1.7.0", + "web3-core-helpers": "1.7.1", "xhr2-cookies": "1.1.0" }, "engines": { @@ -17755,26 +17766,26 @@ } }, "node_modules/web3-providers-ipc": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.7.0.tgz", - "integrity": "sha512-U5YLXgu6fvAK4nnMYqo9eoml3WywgTym0dgCdVX/n1UegLIQ4nctTubBAuWQEJzmAzwh+a6ValGcE7ZApTRI7Q==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.7.1.tgz", + "integrity": "sha512-uNgLIFynwnd5M9ZC0lBvRQU5iLtU75hgaPpc7ZYYR+kjSk2jr2BkEAQhFVJ8dlqisrVmmqoAPXOEU0flYZZgNQ==", "dev": true, "dependencies": { "oboe": "2.1.5", - "web3-core-helpers": "1.7.0" + "web3-core-helpers": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-ws": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.7.0.tgz", - "integrity": "sha512-0a8+lVV3JBf+eYnGOsdzOpftK1kis5X7s35QAdoaG5SDapnEylXFlR4xDSSSU88ZwMwvse8hvng2xW6A7oeWxw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.7.1.tgz", + "integrity": "sha512-Uj0n5hdrh0ESkMnTQBsEUS2u6Unqdc7Pe4Zl+iZFb7Yn9cIGsPJBl7/YOP4137EtD5ueXAv+MKwzcelpVhFiFg==", "dev": true, "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.7.0", + "web3-core-helpers": "1.7.1", "websocket": "^1.0.32" }, "engines": { @@ -17782,25 +17793,25 @@ } }, "node_modules/web3-shh": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.7.0.tgz", - "integrity": "sha512-RZhxcevALIPK178VZCpwMBvQeW+IoWtRJ4EMdegpbnETeZaC3aRUcs6vKnrf0jXJjm4J/E2Dt438Y1Ord/1IMw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.7.1.tgz", + "integrity": "sha512-NO+jpEjo8kYX6c7GiaAm57Sx93PLYkWYUCWlZmUOW7URdUcux8VVluvTWklGPvdM9H1WfDrol91DjuSW+ykyqg==", "dev": true, "hasInstallScript": true, "dependencies": { - "web3-core": "1.7.0", - "web3-core-method": "1.7.0", - "web3-core-subscriptions": "1.7.0", - "web3-net": "1.7.0" + "web3-core": "1.7.1", + "web3-core-method": "1.7.1", + "web3-core-subscriptions": "1.7.1", + "web3-net": "1.7.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-utils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.0.tgz", - "integrity": "sha512-O8Tl4Ky40Sp6pe89Olk2FsaUkgHyb5QAXuaKo38ms3CxZZ4d3rPGfjP9DNKGm5+IUgAZBNpF1VmlSmNCqfDI1w==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.1.tgz", + "integrity": "sha512-fef0EsqMGJUgiHPdX+KN9okVWshbIumyJPmR+btnD1HgvoXijKEkuKBv0OmUqjbeqmLKP2/N9EiXKJel5+E1Dw==", "dev": true, "dependencies": { "bn.js": "^4.11.9", @@ -18225,9 +18236,9 @@ "dev": true }, "node_modules/yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.0.tgz", + "integrity": "sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA==", "dev": true, "dependencies": { "cliui": "^7.0.2", @@ -18243,199 +18254,39 @@ } }, "node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/yargs-parser/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "dependencies": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/yargs-unparser/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" + "node": ">=10" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/yargs-unparser/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/yargs-unparser/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/yargs-unparser/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/yargs-unparser/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yargs/node_modules/ansi-regex": { @@ -18596,9 +18447,9 @@ } }, "@babel/runtime": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.2.tgz", - "integrity": "sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", + "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -18649,41 +18500,41 @@ }, "dependencies": { "ethers": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.5.4.tgz", - "integrity": "sha512-N9IAXsF8iKhgHIC6pquzRgPBJEzc9auw3JoRkaKe+y4Wl/LFBtDDunNe7YmdomontECAcC5APaAgWZBiu1kirw==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.2.tgz", + "integrity": "sha512-EzGCbns24/Yluu7+ToWnMca3SXJ1Jk1BvWB7CCmVNxyOeM4LLvw2OLuIHhlkhQk1dtOcj9UMsdkxUh8RiG1dxQ==", "dev": true, "requires": { - "@ethersproject/abi": "5.5.0", - "@ethersproject/abstract-provider": "5.5.1", - "@ethersproject/abstract-signer": "5.5.0", - "@ethersproject/address": "5.5.0", - "@ethersproject/base64": "5.5.0", - "@ethersproject/basex": "5.5.0", - "@ethersproject/bignumber": "5.5.0", - "@ethersproject/bytes": "5.5.0", - "@ethersproject/constants": "5.5.0", - "@ethersproject/contracts": "5.5.0", - "@ethersproject/hash": "5.5.0", - "@ethersproject/hdnode": "5.5.0", - "@ethersproject/json-wallets": "5.5.0", - "@ethersproject/keccak256": "5.5.0", - "@ethersproject/logger": "5.5.0", - "@ethersproject/networks": "5.5.2", - "@ethersproject/pbkdf2": "5.5.0", - "@ethersproject/properties": "5.5.0", - "@ethersproject/providers": "5.5.3", - "@ethersproject/random": "5.5.1", - "@ethersproject/rlp": "5.5.0", - "@ethersproject/sha2": "5.5.0", - "@ethersproject/signing-key": "5.5.0", - "@ethersproject/solidity": "5.5.0", - "@ethersproject/strings": "5.5.0", - "@ethersproject/transactions": "5.5.0", - "@ethersproject/units": "5.5.0", - "@ethersproject/wallet": "5.5.0", - "@ethersproject/web": "5.5.1", - "@ethersproject/wordlists": "5.5.0" + "@ethersproject/abi": "5.6.0", + "@ethersproject/abstract-provider": "5.6.0", + "@ethersproject/abstract-signer": "5.6.0", + "@ethersproject/address": "5.6.0", + "@ethersproject/base64": "5.6.0", + "@ethersproject/basex": "5.6.0", + "@ethersproject/bignumber": "5.6.0", + "@ethersproject/bytes": "5.6.1", + "@ethersproject/constants": "5.6.0", + "@ethersproject/contracts": "5.6.0", + "@ethersproject/hash": "5.6.0", + "@ethersproject/hdnode": "5.6.0", + "@ethersproject/json-wallets": "5.6.0", + "@ethersproject/keccak256": "5.6.0", + "@ethersproject/logger": "5.6.0", + "@ethersproject/networks": "5.6.1", + "@ethersproject/pbkdf2": "5.6.0", + "@ethersproject/properties": "5.6.0", + "@ethersproject/providers": "5.6.2", + "@ethersproject/random": "5.6.0", + "@ethersproject/rlp": "5.6.0", + "@ethersproject/sha2": "5.6.0", + "@ethersproject/signing-key": "5.6.0", + "@ethersproject/solidity": "5.6.0", + "@ethersproject/strings": "5.6.0", + "@ethersproject/transactions": "5.6.0", + "@ethersproject/units": "5.6.0", + "@ethersproject/wallet": "5.6.0", + "@ethersproject/web": "5.6.0", + "@ethersproject/wordlists": "5.6.0" } } } @@ -18712,54 +18563,37 @@ } }, "@ethereumjs/block": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.1.tgz", - "integrity": "sha512-o5d/zpGl4SdVfdTfrsq9ZgYMXddc0ucKMiFW5OphBCX+ep4xzYnSjboFcZXT2V/tcSBr84VrKWWp21CGVb3DGw==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.2.tgz", + "integrity": "sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw==", "dev": true, "requires": { - "@ethereumjs/common": "^2.6.1", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "ethereumjs-util": "^7.1.4", - "merkle-patricia-tree": "^4.2.3" + "merkle-patricia-tree": "^4.2.4" } }, "@ethereumjs/blockchain": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.1.tgz", - "integrity": "sha512-JS2jeKxl3tlaa5oXrZ8mGoVBCz6YqsGG350XVNtHAtNZXKk7pU3rH4xzF2ru42fksMMqzFLzKh9l4EQzmNWDqA==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz", + "integrity": "sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig==", "dev": true, "requires": { - "@ethereumjs/block": "^3.6.0", - "@ethereumjs/common": "^2.6.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.3", "@ethereumjs/ethash": "^1.1.0", - "debug": "^2.2.0", - "ethereumjs-util": "^7.1.3", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", "semaphore-async-await": "^1.5.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } } }, "@ethereumjs/common": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.2.tgz", - "integrity": "sha512-vDwye5v0SVeuDky4MtKsu+ogkH2oFUV8pBKzH/eNBzT8oI91pKa8WyzDuYuxOQsgNgv5R34LfFDh2aaw3H4HbQ==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.3.tgz", + "integrity": "sha512-mQwPucDL7FDYIg9XQ8DL31CnIYZwGhU5hyOO5E+BMmT71G0+RHvIT5rIkLBirJEKxV6+Rcf9aEIY0kXInxUWpQ==", "dev": true, "requires": { "crc-32": "^1.2.0", @@ -18791,212 +18625,212 @@ } }, "@ethereumjs/tx": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.0.tgz", - "integrity": "sha512-/+ZNbnJhQhXC83Xuvy6I9k4jT5sXiV0tMR9C+AzSSpcCV64+NB8dTE1m3x98RYMqb8+TLYWA+HML4F5lfXTlJw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.1.tgz", + "integrity": "sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA==", "dev": true, "requires": { - "@ethereumjs/common": "^2.6.1", + "@ethereumjs/common": "^2.6.3", "ethereumjs-util": "^7.1.4" } }, "@ethereumjs/vm": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.7.1.tgz", - "integrity": "sha512-NiFm5FMaeDGZ9ojBL+Y9Y/xhW6S4Fgez+zPBM402T5kLsfeAR9mrRVckYhvkGVJ6FMwsY820CLjYP5OVwMjLTg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.8.0.tgz", + "integrity": "sha512-mn2G2SX79QY4ckVvZUfxlNUpzwT2AEIkvgJI8aHoQaNYEHhH8rmdVDIaVVgz6//PjK52BZsK23afz+WvSR0Qqw==", "dev": true, "requires": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/blockchain": "^5.5.1", - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^4.3.3", "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.3", + "merkle-patricia-tree": "^4.2.4", "rustbn.js": "~0.2.0" } }, "@ethersproject/abi": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", - "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", + "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", "dev": true, "requires": { - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "@ethersproject/abstract-provider": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz", - "integrity": "sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz", + "integrity": "sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/networks": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/web": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/web": "^5.6.0" } }, "@ethersproject/abstract-signer": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz", - "integrity": "sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz", + "integrity": "sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==", "dev": true, "requires": { - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0" + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0" } }, "@ethersproject/address": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz", - "integrity": "sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.0.tgz", + "integrity": "sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/rlp": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.0" } }, "@ethersproject/base64": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", - "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.0.tgz", + "integrity": "sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0" + "@ethersproject/bytes": "^5.6.0" } }, "@ethersproject/basex": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.5.0.tgz", - "integrity": "sha512-ZIodwhHpVJ0Y3hUCfUucmxKsWQA5TMnavp5j/UOuDdzZWzJlRmuOjcTMIGgHCYuZmHt36BfiSyQPSRskPxbfaQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.0.tgz", + "integrity": "sha512-qN4T+hQd/Md32MoJpc69rOwLYRUXwjTlhHDIeUkUmiN/JyWkkLLMoG0TqvSQKNqZOMgN5stbUYN6ILC+eD7MEQ==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/properties": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/properties": "^5.6.0" } }, "@ethersproject/bignumber": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", - "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", + "integrity": "sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", "bn.js": "^4.11.9" } }, "@ethersproject/bytes": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", - "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", "dev": true, "requires": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/constants": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", - "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.0.tgz", + "integrity": "sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0" } }, "@ethersproject/contracts": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.5.0.tgz", - "integrity": "sha512-2viY7NzyvJkh+Ug17v7g3/IJC8HqZBDcOjYARZLdzRxrfGlRgmYgl6xPRKVbEzy1dWKw/iv7chDcS83pg6cLxg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.0.tgz", + "integrity": "sha512-74Ge7iqTDom0NX+mux8KbRUeJgu1eHZ3iv6utv++sLJG80FVuU9HnHeKVPfjd9s3woFhaFoQGf3B3iH/FrQmgw==", "dev": true, "requires": { - "@ethersproject/abi": "^5.5.0", - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/transactions": "^5.5.0" + "@ethersproject/abi": "^5.6.0", + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.0" } }, "@ethersproject/hash": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz", - "integrity": "sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", + "integrity": "sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==", "dev": true, "requires": { - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "@ethersproject/hdnode": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.5.0.tgz", - "integrity": "sha512-mcSOo9zeUg1L0CoJH7zmxwUG5ggQHU1UrRf8jyTYy6HxdZV+r0PBoL1bxr+JHIPXRzS6u/UW4mEn43y0tmyF8Q==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.0.tgz", + "integrity": "sha512-61g3Jp3nwDqJcL/p4nugSyLrpl/+ChXIOtCEM8UDmWeB3JCAt5FoLdOMXQc3WWkc0oM2C0aAn6GFqqMcS/mHTw==", "dev": true, "requires": { - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/basex": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/pbkdf2": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/sha2": "^5.5.0", - "@ethersproject/signing-key": "^5.5.0", - "@ethersproject/strings": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/wordlists": "^5.5.0" + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/basex": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/wordlists": "^5.6.0" } }, "@ethersproject/json-wallets": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz", - "integrity": "sha512-9lA21XQnCdcS72xlBn1jfQdj2A1VUxZzOzi9UkNdnokNKke/9Ya2xA9aIK1SC3PQyBDLt4C+dfps7ULpkvKikQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.0.tgz", + "integrity": "sha512-fmh86jViB9r0ibWXTQipxpAGMiuxoqUf78oqJDlCAJXgnJF024hOOX7qVgqsjtbeoxmcLwpPsXNU0WEe/16qPQ==", "dev": true, "requires": { - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/hdnode": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/pbkdf2": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/random": "^5.5.0", - "@ethersproject/strings": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hdnode": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", "aes-js": "3.0.0", "scrypt-js": "3.0.1" }, @@ -19010,72 +18844,72 @@ } }, "@ethersproject/keccak256": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz", - "integrity": "sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", + "integrity": "sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", "js-sha3": "0.8.0" } }, "@ethersproject/logger": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", - "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", "dev": true }, "@ethersproject/networks": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.2.tgz", - "integrity": "sha512-NEqPxbGBfy6O3x4ZTISb90SjEDkWYDUbEeIFhJly0F7sZjoQMnj5KYzMSkMkLKZ+1fGpx00EDpHQCy6PrDupkQ==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.1.tgz", + "integrity": "sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==", "dev": true, "requires": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/pbkdf2": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz", - "integrity": "sha512-SaDvQFvXPnz1QGpzr6/HToLifftSXGoXrbpZ6BvoZhmx4bNLHrxDe8MZisuecyOziP1aVEwzC2Hasj+86TgWVg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.0.tgz", + "integrity": "sha512-Wu1AxTgJo3T3H6MIu/eejLFok9TYoSdgwRr5oGY1LTLfmGesDoSx05pemsbrPT2gG4cQME+baTSCp5sEo2erZQ==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/sha2": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/sha2": "^5.6.0" } }, "@ethersproject/properties": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", - "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", + "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", "dev": true, "requires": { - "@ethersproject/logger": "^5.5.0" + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/providers": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.5.3.tgz", - "integrity": "sha512-ZHXxXXXWHuwCQKrgdpIkbzMNJMvs+9YWemanwp1fA7XZEv7QlilseysPvQe0D7Q7DlkJX/w/bGA1MdgK2TbGvA==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.2.tgz", + "integrity": "sha512-6/EaFW/hNWz+224FXwl8+HdMRzVHt8DpPmu5MZaIQqx/K/ELnC9eY236SMV7mleCM3NnEArFwcAAxH5kUUgaRg==", "dev": true, "requires": { - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/basex": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/networks": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/random": "^5.5.0", - "@ethersproject/rlp": "^5.5.0", - "@ethersproject/sha2": "^5.5.0", - "@ethersproject/strings": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/web": "^5.5.0", + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/basex": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/rlp": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/web": "^5.6.0", "bech32": "1.1.4", "ws": "7.4.6" }, @@ -19090,150 +18924,150 @@ } }, "@ethersproject/random": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.5.1.tgz", - "integrity": "sha512-YaU2dQ7DuhL5Au7KbcQLHxcRHfgyNgvFV4sQOo0HrtW3Zkrc9ctWNz8wXQ4uCSfSDsqX2vcjhroxU5RQRV0nqA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.0.tgz", + "integrity": "sha512-si0PLcLjq+NG/XHSZz90asNf+YfKEqJGVdxoEkSukzbnBgC8rydbgbUgBbBGLeHN4kAJwUFEKsu3sCXT93YMsw==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/rlp": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz", - "integrity": "sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", + "integrity": "sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/sha2": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.5.0.tgz", - "integrity": "sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz", + "integrity": "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", "hash.js": "1.1.7" } }, "@ethersproject/signing-key": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz", - "integrity": "sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.0.tgz", + "integrity": "sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" } }, "@ethersproject/solidity": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.5.0.tgz", - "integrity": "sha512-9NgZs9LhGMj6aCtHXhtmFQ4AN4sth5HuFXVvAQtzmm0jpSCNOTGtrHZJAeYTh7MBjRR8brylWZxBZR9zDStXbw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.6.0.tgz", + "integrity": "sha512-YwF52vTNd50kjDzqKaoNNbC/r9kMDPq3YzDWmsjFTRBcIF1y4JCQJ8gB30wsTfHbaxgxelI5BfxQSxD/PbJOww==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/sha2": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "@ethersproject/strings": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", - "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", + "integrity": "sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/transactions": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz", - "integrity": "sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.0.tgz", + "integrity": "sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==", "dev": true, "requires": { - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/rlp": "^5.5.0", - "@ethersproject/signing-key": "^5.5.0" + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/rlp": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0" } }, "@ethersproject/units": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.5.0.tgz", - "integrity": "sha512-7+DpjiZk4v6wrikj+TCyWWa9dXLNU73tSTa7n0TSJDxkYbV3Yf1eRh9ToMLlZtuctNYu9RDNNy2USq3AdqSbag==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.0.tgz", + "integrity": "sha512-tig9x0Qmh8qbo1w8/6tmtyrm/QQRviBh389EQ+d8fP4wDsBrJBf08oZfoiz1/uenKK9M78yAP4PoR7SsVoTjsw==", "dev": true, "requires": { - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/constants": "^5.5.0", - "@ethersproject/logger": "^5.5.0" + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0" } }, "@ethersproject/wallet": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.5.0.tgz", - "integrity": "sha512-Mlu13hIctSYaZmUOo7r2PhNSd8eaMPVXe1wxrz4w4FCE4tDYBywDH+bAR1Xz2ADyXGwqYMwstzTrtUVIsKDO0Q==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.0.tgz", + "integrity": "sha512-qMlSdOSTyp0MBeE+r7SUhr1jjDlC1zAXB8VD84hCnpijPQiSNbxr6GdiLXxpUs8UKzkDiNYYC5DRI3MZr+n+tg==", "dev": true, "requires": { - "@ethersproject/abstract-provider": "^5.5.0", - "@ethersproject/abstract-signer": "^5.5.0", - "@ethersproject/address": "^5.5.0", - "@ethersproject/bignumber": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/hdnode": "^5.5.0", - "@ethersproject/json-wallets": "^5.5.0", - "@ethersproject/keccak256": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/random": "^5.5.0", - "@ethersproject/signing-key": "^5.5.0", - "@ethersproject/transactions": "^5.5.0", - "@ethersproject/wordlists": "^5.5.0" + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/hdnode": "^5.6.0", + "@ethersproject/json-wallets": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/wordlists": "^5.6.0" } }, "@ethersproject/web": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", - "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", + "integrity": "sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==", "dev": true, "requires": { - "@ethersproject/base64": "^5.5.0", - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/base64": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "@ethersproject/wordlists": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.5.0.tgz", - "integrity": "sha512-bL0UTReWDiaQJJYOC9sh/XcRu/9i2jMrzf8VLRmPKx58ckSlOJiohODkECCO50dtLZHcGU6MLXQ4OOrgBwP77Q==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.0.tgz", + "integrity": "sha512-q0bxNBfIX3fUuAo9OmjlEYxP40IB8ABgb7HjEZCL5IKubzV3j30CWi2rqQbjTS2HfoyQbfINoKcTVWP4ejwR7Q==", "dev": true, "requires": { - "@ethersproject/bytes": "^5.5.0", - "@ethersproject/hash": "^5.5.0", - "@ethersproject/logger": "^5.5.0", - "@ethersproject/properties": "^5.5.0", - "@ethersproject/strings": "^5.5.0" + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" } }, "@humanwhocodes/config-array": { @@ -19292,6 +19126,18 @@ } } }, + "@noble/hashes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.0.0.tgz", + "integrity": "sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==", + "dev": true + }, + "@noble/secp256k1": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.5.5.tgz", + "integrity": "sha512-sZ1W6gQzYnu45wPrWx8D3kwI2/U29VYTx9OjbDAd7jwRItJ0cSTMPRL/C8AWZFn9kWFLQGqEXVEE86w4Z8LpIQ==", + "dev": true + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -19435,6 +19281,15 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, + "clean-stack": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", + "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", + "dev": true, + "requires": { + "escape-string-regexp": "4.0.0" + } + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -19797,6 +19652,33 @@ } } }, + "@scure/base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.0.0.tgz", + "integrity": "sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA==", + "dev": true + }, + "@scure/bip32": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.0.1.tgz", + "integrity": "sha512-AU88KKTpQ+YpTLoicZ/qhFhRRIo96/tlb+8YmDDHR9yiKVjSsFZiefJO4wjS2PMTkz5/oIcw84uAq/8pleQURA==", + "dev": true, + "requires": { + "@noble/hashes": "~1.0.0", + "@noble/secp256k1": "~1.5.2", + "@scure/base": "~1.0.0" + } + }, + "@scure/bip39": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.0.0.tgz", + "integrity": "sha512-HrtcikLbd58PWOkl02k9V6nXWQyoa7A0+Ek9VF7z17DDk9XZAFUcIdqfh0jJXLypmizc5/8P6OxoUeKliiWv4w==", + "dev": true, + "requires": { + "@noble/hashes": "~1.0.0", + "@scure/base": "~1.0.0" + } + }, "@sentry/core": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", @@ -19951,13 +19833,13 @@ } }, "@truffle/abi-utils": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.9.tgz", - "integrity": "sha512-Nv4MGsA2vdI7G34nI0DfR/eSd5pbAUu+5EafYNqzgrS46y0LWhbIrSZ1NcM7cbhIrkpUn6OfNk49AjNM67TkSg==", + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.11.tgz", + "integrity": "sha512-JYVD+9t6hSc7N34i6sHolwspVvcwcA/TNZNeQxXQObCe/pv6vt+i6xmp+yD87evjHrM0zG+ANlgR/QqJhTJ/qg==", "dev": true, "requires": { "change-case": "3.0.2", - "faker": "^5.3.1", + "faker": "5.5.3", "fast-check": "^2.12.1" } }, @@ -20038,9 +19920,9 @@ } }, "@truffle/compile-common": { - "version": "0.7.28", - "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.28.tgz", - "integrity": "sha512-mZCEQ6fkOqbKYCJDT82q0vZCxOEsKRQ0zrPfKuSJEb0gF9DXIQcnMkyJpBSWzmyvien9/A7/jPiGQoC7PmNEUg==", + "version": "0.7.29", + "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.29.tgz", + "integrity": "sha512-Z5h0jQh/GXsjnTBt02boV2QiQ1QlGlWlupZWsIcLHpBxQaw/TXTa7EvicPLWf7JQ3my56iaY3N5rkrQLAlFf1Q==", "dev": true, "requires": { "@truffle/error": "^0.1.0", @@ -20056,17 +19938,17 @@ } }, "@truffle/contract": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.4.10.tgz", - "integrity": "sha512-UsAZuVZ9V0oRNLR599VLuOQd5sPc5kjXRKRRGEYfB3mmnPfrJCnlSzfC5bzbGHanx6hmct3epD4Y/EFhoAit4A==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.5.3.tgz", + "integrity": "sha512-bJJj9kJ6rTEwiroWNozglakdIhXrHzsRdS2UxDPlBRWfN6D5rvGcBUZqC+8QnNqb3iWfcf8CmO7kWhj7OKqbAA==", "dev": true, "requires": { "@ensdomains/ensjs": "^2.0.1", - "@truffle/blockchain-utils": "^0.1.0", - "@truffle/contract-schema": "^3.4.5", - "@truffle/debug-utils": "^6.0.10", + "@truffle/blockchain-utils": "^0.1.1", + "@truffle/contract-schema": "^3.4.6", + "@truffle/debug-utils": "^6.0.15", "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.11", + "@truffle/interface-adapter": "^0.5.12", "bignumber.js": "^7.2.1", "debug": "^4.3.1", "ethers": "^4.0.32", @@ -20095,27 +19977,24 @@ } }, "@truffle/blockchain-utils": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.0.tgz", - "integrity": "sha512-9mzYXPQkjOc23rHQM1i630i3ackITWP1cxf3PvBObaAnGqwPCQuqtmZtNDPdvN+YpOLpBGpZIdYolI91xLdJNQ==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.1.tgz", + "integrity": "sha512-o7nBlaMuasuADCCL2WzhvOXA5GT5ewd/F35cY6ZU69U5OUASR3ZP4CZetVCc5MZePPa/3CL9pzJ4Rhtg1ChwVA==", "dev": true }, "@truffle/codec": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.0.tgz", - "integrity": "sha512-DE/26w5jtBPPqVBseLX1cL0i3b3IUnHaHtKmQvqkEatd6T+uZfPIaiI15ru8cynR7KrYNhuSfeq9k8/N+OFN1Q==", + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.5.tgz", + "integrity": "sha512-wkA6WIMVFhXkaSG6vNVaoYhHjubuek47YgsGFc2m24I7mgasOfcLQ9CVP1h/CBzOBxuy6vP/GX95DTPzsYxL9A==", "dev": true, "requires": { - "@truffle/abi-utils": "^0.2.9", - "@truffle/compile-common": "^0.7.28", - "big.js": "^5.2.2", + "@truffle/abi-utils": "^0.2.11", + "@truffle/compile-common": "^0.7.29", + "big.js": "^6.0.3", "bn.js": "^5.1.3", "cbor": "^5.1.0", "debug": "^4.3.1", - "lodash.clonedeep": "^4.5.0", - "lodash.escaperegexp": "^4.1.2", - "lodash.partition": "^4.6.0", - "lodash.sum": "^4.0.2", + "lodash": "^4.17.21", "semver": "^7.3.4", "utf8": "^3.0.0", "web3-utils": "1.5.3" @@ -20130,17 +20009,17 @@ } }, "@truffle/debug-utils": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.10.tgz", - "integrity": "sha512-ZK9gwhfqJLnrPBIWe4tUmdm01KnLcbzoJHze18/Z4/dJxp7xfLAW/iL6RiKSA3+LBy85g49gt508DCYtQkDs9w==", + "version": "6.0.15", + "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.15.tgz", + "integrity": "sha512-y+6u2+pPU4FQRAjGmL2zFCJ39evO/5CvR2Yh8kT7o+ZG02VODGr754e8lEFPt4WO2O5fDMlIyH/7ewIGhZVLGw==", "dev": true, "requires": { - "@truffle/codec": "^0.12.0", + "@truffle/codec": "^0.12.5", "@trufflesuite/chromafi": "^3.0.0", "bn.js": "^5.1.3", "chalk": "^2.4.2", "debug": "^4.3.1", - "highlightjs-solidity": "^2.0.4" + "highlightjs-solidity": "^2.0.5" }, "dependencies": { "bn.js": { @@ -20158,9 +20037,9 @@ "dev": true }, "@truffle/interface-adapter": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.11.tgz", - "integrity": "sha512-HXLm+r1KdT8nHzJht1iK6EnHBKIjSYHdDfebBMCqmRCsMoUXvUJ0KsIxvDG758MafB12pjx5gsNn4XzzfksSBQ==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.12.tgz", + "integrity": "sha512-Qrc5VARnvSILYqZNsAM0xsUHqGqphLXVdIvDnhUA1Xj1xyNz8iboTr8bXorMd+Uspw+PXmsW44BJ/Wioo/jL2A==", "dev": true, "requires": { "bn.js": "^5.1.3", @@ -20202,9 +20081,9 @@ } }, "@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "ansi-styles": { @@ -20216,6 +20095,12 @@ "color-convert": "^1.9.0" } }, + "big.js": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-6.1.1.tgz", + "integrity": "sha512-1vObw81a8ylZO5ePrtMay0n018TcftpTA5HFKDaSuiUDBo8biRBtjIobw60OpwuvrGk+FsxKamqN4cnmj/eXdg==", + "dev": true + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -20272,9 +20157,9 @@ "dev": true }, "highlightjs-solidity": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.4.tgz", - "integrity": "sha512-jsmfDXrjjxt4LxWfzp27j4CX6qYk6B8uK8sxzEDyGts8Ut1IuVlFCysAu6n5RrgHnuEKA+SCIcGPweO7qlPhCg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/highlightjs-solidity/-/highlightjs-solidity-2.0.5.tgz", + "integrity": "sha512-ReXxQSGQkODMUgHcWzVSnfDCDrL2HshOYgw3OlIYmfHeRzUPkfJTUIp95pK4CmbiNG2eMTOmNLpfCz9Zq7Cwmg==", "dev": true }, "supports-color": { @@ -20574,9 +20459,9 @@ } }, "@truffle/contract-schema": { - "version": "3.4.5", - "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.5.tgz", - "integrity": "sha512-heaGV9QWqef259HaF+0is/tsmhlZIbUSWhqvj0iwKmxoN92fghKijWwdVYhPIbsmGlrQuwPTZHSCnaOlO+gsFg==", + "version": "3.4.6", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.6.tgz", + "integrity": "sha512-YzVAoPxEnM7pz7vLrQvtgtnpIwERrZcbYRjRTEJP8Y7rxudYDYaZ8PwjHD3j0SQxE6Y0WquDi3PtbfgZB9BwYQ==", "dev": true, "requires": { "ajv": "^6.10.0", @@ -20699,9 +20584,9 @@ } }, "@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "bignumber.js": { @@ -21048,13 +20933,13 @@ } }, "@truffle/provider": { - "version": "0.2.47", - "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.47.tgz", - "integrity": "sha512-Y9VRLsdMcfEicZjxxcwA0y9pqnwJx0JX/UDeHDHZmymx3KIJwI3VpxRPighfHAmvDRksic6Yj4iL0CmiEDR5kg==", + "version": "0.2.50", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.50.tgz", + "integrity": "sha512-GCoyX8SncfgizXYJfordv5kiysQS7S1311D3ewciixaoQpTkbqC3s0wxwHlPxU7m5wJOCw2K8rQtL3oIFfeHwA==", "dev": true, "requires": { "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.11", + "@truffle/interface-adapter": "^0.5.12", "web3": "1.5.3" }, "dependencies": { @@ -21082,9 +20967,9 @@ "dev": true }, "@truffle/interface-adapter": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.11.tgz", - "integrity": "sha512-HXLm+r1KdT8nHzJht1iK6EnHBKIjSYHdDfebBMCqmRCsMoUXvUJ0KsIxvDG758MafB12pjx5gsNn4XzzfksSBQ==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.12.tgz", + "integrity": "sha512-Qrc5VARnvSILYqZNsAM0xsUHqGqphLXVdIvDnhUA1Xj1xyNz8iboTr8bXorMd+Uspw+PXmsW44BJ/Wioo/jL2A==", "dev": true, "requires": { "bn.js": "^5.1.3", @@ -21102,9 +20987,9 @@ } }, "@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "bignumber.js": { @@ -21613,9 +21498,9 @@ "dev": true }, "@types/node": { - "version": "17.0.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", - "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==", + "version": "17.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", + "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==", "dev": true }, "@types/pbkdf2": { @@ -21734,14 +21619,6 @@ "requires": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" - }, - "dependencies": { - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - } } }, "ajv": { @@ -21858,9 +21735,9 @@ } }, "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true }, "ansi-styles": { @@ -22258,23 +22135,15 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, + "optional": true, "requires": { "file-uri-to-path": "1.0.0" } }, - "bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, "blakejs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", - "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", "dev": true }, "bluebird": { @@ -22290,21 +22159,23 @@ "dev": true }, "body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", "dev": true, "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" }, "dependencies": { "debug": { @@ -22316,47 +22187,19 @@ "ms": "2.0.0" } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", - "dev": true - }, - "raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "requires": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "ee-first": "1.1.1" } } } @@ -22793,16 +22636,16 @@ } }, "cheerio-select": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz", - "integrity": "sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.6.0.tgz", + "integrity": "sha512-eq0GdBvxVFbqWgmCm7M3XGs1I8oLy/nExUnh6oLqmBditPO9AqQJrkslDpMun/hZ0yyTs8L0m85OHp4ho6Qm9g==", "dev": true, "requires": { - "css-select": "^4.1.3", - "css-what": "^5.0.1", + "css-select": "^4.3.0", + "css-what": "^6.0.1", "domelementtype": "^2.2.0", - "domhandler": "^4.2.0", - "domutils": "^2.7.0" + "domhandler": "^4.3.1", + "domutils": "^2.8.0" } }, "chokidar": { @@ -22887,13 +22730,10 @@ } }, "clean-stack": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", - "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", - "dev": true, - "requires": { - "escape-string-regexp": "4.0.0" - } + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true }, "cli-cursor": { "version": "2.1.0", @@ -23237,14 +23077,10 @@ } }, "crc-32": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.1.tgz", - "integrity": "sha512-Dn/xm/1vFFgs3nfrpEVScHoIslO9NZRITWGz/1E/St6u4xw99vfZzVkW0OSnzx2h9egej9xwMCEut6sqwokM/w==", - "dev": true, - "requires": { - "exit-on-epipe": "~1.0.1", - "printj": "~1.3.1" - } + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true }, "create-ecdh": { "version": "4.0.4", @@ -23341,22 +23177,22 @@ "dev": true }, "css-select": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.2.1.tgz", - "integrity": "sha512-/aUslKhzkTNCQUB2qTX84lVmfia9NyjP3WpDGtj/WxhwBzWBYUV3DgUpurHTme8UTPcPlAD1DJ+b0nN/t50zDQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", "dev": true, "requires": { "boolbase": "^1.0.0", - "css-what": "^5.1.0", - "domhandler": "^4.3.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", "domutils": "^2.8.0", "nth-check": "^2.0.1" } }, "css-what": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.1.0.tgz", - "integrity": "sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", "dev": true }, "d": { @@ -23385,18 +23221,18 @@ "dev": true }, "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" } }, "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true }, "decode-uri-component": { @@ -23507,9 +23343,9 @@ } }, "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true }, "detect-indent": { @@ -23546,9 +23382,9 @@ } }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, "diffie-hellman": { @@ -23604,9 +23440,9 @@ "dev": true }, "domhandler": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.0.tgz", - "integrity": "sha512-fC0aXNQXqKSFTr2wDNZDhsEYjCiYsDWl3D01kwt25hm1YIPyDGHvvi3rw+PLqHAl/m71MaiF7d5zvBr0p5UB2g==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", + "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", "dev": true, "requires": { "domelementtype": "^2.2.0" @@ -23632,17 +23468,6 @@ "no-case": "^2.2.0" } }, - "drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "dev": true, - "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - } - }, "duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -23687,9 +23512,9 @@ } }, "emoji-regex": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.0.0.tgz", - "integrity": "sha512-KmJa8l6uHi1HrBI34udwlzZY1jOEuID/ft4d8BSSEdRyap7PwBEt910453PJa5MuGvxkLqlt4Uvhu7tttFHViw==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.1.0.tgz", + "integrity": "sha512-xAEnNCT3w2Tg6MA7ly6QqYJvEoY1tm9iIjJ3yMKK9JPlWuRHAMoe5iETwQnx3M9TVbFMfsrBgWKR+IsmswwNjg==", "dev": true }, "encodeurl": { @@ -23767,9 +23592,9 @@ } }, "es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.2.tgz", + "integrity": "sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -23778,15 +23603,15 @@ "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.2", + "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", + "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.1", "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -23806,14 +23631,14 @@ } }, "es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "version": "0.10.59", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.59.tgz", + "integrity": "sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw==", "dev": true, "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" } }, "es6-iterator": { @@ -24105,9 +23930,9 @@ } }, "eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "requires": { "array-includes": "^3.1.4", @@ -24115,14 +23940,14 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "is-core-module": "^2.8.0", + "is-core-module": "^2.8.1", "is-glob": "^4.0.3", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "dependencies": { "debug": { @@ -24336,16 +24161,16 @@ } }, "eth-gas-reporter": { - "version": "0.2.24", - "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.24.tgz", - "integrity": "sha512-RbXLC2bnuPHzIMU/rnLXXlb6oiHEEKu7rq2UrAX/0mfo0Lzrr/kb9QTjWjfz8eNvc+uu6J8AuBwI++b+MLNI2w==", + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.25.tgz", + "integrity": "sha512-1fRgyE4xUB8SoqLgN3eDfpDfwEfRxh2Sz1b7wzFbyQA+9TekMmvSjjoRu9SKcSVyK+vLkLIsVbJDsTWjw195OQ==", "dev": true, "requires": { "@ethersproject/abi": "^5.0.0-beta.146", "@solidity-parser/parser": "^0.14.0", "cli-table3": "^0.5.0", "colors": "1.4.0", - "ethereumjs-util": "6.2.0", + "ethereum-cryptography": "^1.0.3", "ethers": "^4.0.40", "fs-readdir-recursive": "^1.1.0", "lodash": "^4.17.14", @@ -24358,56 +24183,406 @@ "sync-request": "^6.0.0" }, "dependencies": { - "@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, + "ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "@types/node": "*" + "color-convert": "^1.9.0" } }, - "ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, - "keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", + "chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", "dev": true, "requires": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" } }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "ethereum-cryptography": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.0.3.tgz", + "integrity": "sha512-NQLTW0x0CosoVb/n79x/TRHtfvS3hgNUPTUSCu0vM+9k6IIhHFFrAOJReneexjZsoZxMjJHnJn4lrE8EbnSyqQ==", + "dev": true, + "requires": { + "@noble/hashes": "1.0.0", + "@noble/secp256k1": "1.5.5", + "@scure/bip32": "1.0.1", + "@scure/bip39": "1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "flat": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", + "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mocha": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", + "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "dev": true, + "requires": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "chokidar": "3.3.0", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.5", + "ms": "2.1.1", + "node-environment-flags": "1.0.6", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" } } } @@ -24792,12 +24967,6 @@ "safe-buffer": "^5.1.1" } }, - "exit-on-epipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz", - "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==", - "dev": true - }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -24868,6 +25037,24 @@ "vary": "~1.1.2" }, "dependencies": { + "body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -24883,6 +25070,25 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -24894,6 +25100,47 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", "dev": true + }, + "raw-body": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", + "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "send": { + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", + "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "1.8.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } } } }, @@ -25009,12 +25256,12 @@ "dev": true }, "fast-check": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.22.0.tgz", - "integrity": "sha512-Yrx1E8fZk6tfSqYaNkwnxj/lOk+vj2KTbbpHDtYoK9MrrL/D204N/rCtcaVSz5bE29g6gW4xj0byresjlFyybg==", + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.24.0.tgz", + "integrity": "sha512-iNXbN90lbabaCUfnW5jyXYPwMJLFYl09eJDkXA9ZoidFlBK63gNRvcKxv+8D1OJ1kIYjwBef4bO/K3qesUeWLQ==", "dev": true, "requires": { - "pure-rand": "^5.0.0" + "pure-rand": "^5.0.1" } }, "fast-deep-equal": { @@ -25102,7 +25349,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true + "dev": true, + "optional": true }, "fill-range": { "version": "7.0.1", @@ -25156,13 +25404,10 @@ } }, "flat": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", - "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - } + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true }, "flat-cache": { "version": "3.0.4", @@ -25495,9 +25740,9 @@ } }, "globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -25547,9 +25792,9 @@ } }, "graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, "graphlib": { @@ -25605,9 +25850,9 @@ } }, "hardhat": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.1.tgz", - "integrity": "sha512-q0AkYXV7R26RzyAkHGQRhhQjk508pseVvH3wSwZwwPUbvA+tjl0vMIrD4aFQDonRXkrnXX4+5KglozzjSd0//Q==", + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.3.tgz", + "integrity": "sha512-7Vw99RbYbMZ15UzegOR/nqIYIqddZXvLwJGaX5sX4G5bydILnbjmDU6g3jMKJSiArEixS3vHAEaOs5CW1JQ3hg==", "dev": true, "requires": { "@ethereumjs/block": "^3.6.0", @@ -25660,18 +25905,6 @@ "ws": "^7.4.6" }, "dependencies": { - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -25681,18 +25914,6 @@ "color-convert": "^1.9.0" } }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -25725,24 +25946,6 @@ "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, - "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true - }, - "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -25758,39 +25961,12 @@ "locate-path": "^2.0.0" } }, - "flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, "jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", @@ -25810,180 +25986,6 @@ "path-exists": "^3.0.0" } }, - "log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "mocha": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz", - "integrity": "sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==", - "dev": true, - "requires": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "3.0.4", - "ms": "2.1.3", - "nanoid": "3.2.0", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -26082,26 +26084,6 @@ } } }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -26110,39 +26092,6 @@ "requires": { "has-flag": "^3.0.0" } - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true - }, - "yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "requires": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - } } } }, @@ -26185,9 +26134,9 @@ "dev": true }, "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true }, "has-to-string-tag-x": { @@ -26410,9 +26359,9 @@ "dev": true }, "http-parser-js": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.5.tgz", - "integrity": "sha512-x+JVEkO2PoM8qqpbPbOL3cqHPwerep7OwzK7Ay+sMQjKzaKCqWvjoXm5tqMP9tXWWTnTzAjIhXg+J99XYuPhPA==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.6.tgz", + "integrity": "sha512-vDlkRPDJn93swjcjqMSaGSPABbIarsr1TLAui/gLDXzV5VsJNdXNzMYDyNBLQkjWQCJ1uizu8T2oDMhmGt0PRA==", "dev": true }, "http-response-object": { @@ -26567,9 +26516,9 @@ "dev": true }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true }, "ansi-styles": { @@ -26904,9 +26853,9 @@ "dev": true }, "is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "requires": { "has-tostringtag": "^1.0.0" @@ -26919,9 +26868,9 @@ "dev": true }, "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, "is-plain-object": { @@ -26956,10 +26905,13 @@ "dev": true }, "is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", - "dev": true + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } }, "is-stream": { "version": "1.1.0", @@ -27160,13 +27112,10 @@ } }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true }, "jsonfile": { "version": "4.0.0", @@ -27780,68 +27729,23 @@ "dev": true }, "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { - "chalk": "^2.4.2" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } } } @@ -28001,9 +27905,9 @@ "dev": true }, "merkle-patricia-tree": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.3.tgz", - "integrity": "sha512-S4xevdXl5KvdBGgUxhQcxoep0onqXiIhzfwZp4M78kIuJH3Pu9o9IUgqhzSFOR2ykLO6t265026Xb6PY0q2UFQ==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz", + "integrity": "sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w==", "dev": true, "requires": { "@types/levelup": "^4.3.0", @@ -28015,9 +27919,9 @@ } }, "merkletreejs": { - "version": "0.2.30", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.30.tgz", - "integrity": "sha512-gBKGRAx8CUjAneaE48U92ObjTp2lD6iYk61ub12NI1YjpNgJ12ROGN+PlZ4G5RyKcs81ArGHRDOt08wkojMGgg==", + "version": "0.2.31", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.31.tgz", + "integrity": "sha512-dnK2sE43OebmMe5Qnq1wXvvMIjZjm1u6CcB2KeW6cghlN4p21OpCUr2p56KTVf20KJItNChVsGnimcscp9f+yw==", "dev": true, "requires": { "bignumber.js": "^9.0.1", @@ -28042,13 +27946,13 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, "miller-rabin": { @@ -28068,18 +27972,18 @@ "dev": true }, "mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true }, "mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "requires": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" } }, "mimic-fn": { @@ -28131,9 +28035,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "minipass": { @@ -28177,12 +28081,12 @@ } }, "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.6" } }, "mkdirp-promise": { @@ -28204,305 +28108,187 @@ } }, "mocha": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", - "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "requires": { - "ansi-colors": "3.2.3", + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "dependencies": { "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.1", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" } }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { + "is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "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==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", - "dev": true, - "requires": { - "picomatch": "^2.0.4" + "p-limit": "^3.0.2" } }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.1" } }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" } } } @@ -28601,7 +28387,8 @@ "version": "2.15.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", - "dev": true + "dev": true, + "optional": true }, "nano-base32": { "version": "1.0.1", @@ -28616,9 +28403,9 @@ "dev": true }, "nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, "nanomatch": { @@ -28719,9 +28506,9 @@ "dev": true }, "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, "nice-try": { @@ -28773,9 +28560,9 @@ } }, "node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", "dev": true }, "nofilter": { @@ -29146,9 +28933,9 @@ "dev": true }, "parse-headers": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.4.tgz", - "integrity": "sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", + "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==", "dev": true }, "parse-json": { @@ -29335,9 +29122,9 @@ "dev": true }, "prettier": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", - "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true }, "prettier-plugin-solidity": { @@ -29396,12 +29183,6 @@ } } }, - "printj": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/printj/-/printj-1.3.1.tgz", - "integrity": "sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg==", - "dev": true - }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -29488,9 +29269,9 @@ "dev": true }, "pure-rand": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-5.0.0.tgz", - "integrity": "sha512-lD2/y78q+7HqBx2SaT6OT4UcwtvXNRfEpzYEzl0EQ+9gZq2Qi3fa0HDnYPeqQwhlHJFBUhT7AO3mLU3+8bynHA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-5.0.1.tgz", + "integrity": "sha512-ksWccjmXOHU2gJBnH0cK1lSYdvSZ0zLoCMSz/nTGh6hDvCSgcRxDyIcOBD6KNxFz3xhMPm/T267Tbe2JRymKEQ==", "dev": true }, "qs": { @@ -30123,24 +29904,24 @@ } }, "send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dev": true, "requires": { "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", + "depd": "2.0.0", + "destroy": "1.2.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "mime": "1.6.0", "ms": "2.1.3", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "statuses": "2.0.1" }, "dependencies": { "debug": { @@ -30160,30 +29941,26 @@ } } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - } - }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true } } }, @@ -30278,6 +30055,77 @@ "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "0.17.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "send": { + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", + "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "1.8.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + } + } } }, "servify": { @@ -30610,6 +30458,12 @@ "wrap-ansi": "^2.0.0" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", @@ -30774,9 +30628,9 @@ "dev": true }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true }, "ansi-styles": { @@ -31145,9 +30999,9 @@ } }, "solidity-ast": { - "version": "0.4.30", - "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.30.tgz", - "integrity": "sha512-3xsQIbZEPx6w7+sQokuOvk1RkMb5GIpuK0GblQDIH6IAkU4+uyJQVJIRNP+8KwhzkViwRKq0hS4zLqQNLKpxOA==", + "version": "0.4.31", + "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.31.tgz", + "integrity": "sha512-kX6o4XE4ihaqENuRRTMJfwQNHoqWusPENZUlX4oVb19gQdfi7IswFWnThONHSW/61umgfWdKtCBgW45iuOTryQ==", "dev": true }, "solidity-comments-extractor": { @@ -31727,6 +31581,12 @@ "url-to-options": "^1.0.1" } }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, "p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", @@ -31784,9 +31644,9 @@ }, "dependencies": { "ajv": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -32082,14 +31942,14 @@ "dev": true }, "tsconfig-paths": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz", - "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "requires": { "@types/json5": "^0.0.29", "json5": "^1.0.1", - "minimist": "^1.2.0", + "minimist": "^1.2.6", "strip-bom": "^3.0.0" }, "dependencies": { @@ -32190,9 +32050,9 @@ } }, "uglify-js": { - "version": "3.15.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.2.tgz", - "integrity": "sha512-peeoTk3hSwYdoc9nrdiEJk+gx1ALCtTjdYuKSXMTDqq7n1W7dHPqWDdSi+BPL0ni2YMeHD7hKUSdbj3TZauY2A==", + "version": "3.15.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.3.tgz", + "integrity": "sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg==", "dev": true, "optional": true }, @@ -32221,9 +32081,9 @@ "dev": true }, "undici": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-4.15.1.tgz", - "integrity": "sha512-h8LJybhMKD09IyQZoQadNtIR/GmugVhTOVREunJrpV6RStriKBFdSVoFzEzTihwXi/27DIBO+Z0OGF+Mzfi0lA==", + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-4.16.0.tgz", + "integrity": "sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==", "dev": true }, "union-value": { @@ -32360,9 +32220,9 @@ "dev": true }, "utf-8-validate": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.8.tgz", - "integrity": "sha512-k4dW/Qja1BYDl2qD4tOMB9PFVha/UJtxTc1cXYOe3WwA/2m0Yn4qB7wLMpJyLJ/7DR0XnTut3HsCSzDT4ZvKgA==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", + "integrity": "sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q==", "dev": true, "requires": { "node-gyp-build": "^4.3.0" @@ -32446,24 +32306,24 @@ } }, "web3": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.7.0.tgz", - "integrity": "sha512-n39O7QQNkpsjhiHMJ/6JY6TaLbdX+2FT5iGs8tb3HbIWOhPm4+a7UDbr5Lkm+gLa9aRKWesZs5D5hWyEvg4aJA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.7.1.tgz", + "integrity": "sha512-RKVdyZ5FuVEykj62C1o2tc0teJciSOh61jpVB9yb344dBHO3ZV4XPPP24s/PPqIMXmVFN00g2GD9M/v1SoHO/A==", "dev": true, "requires": { - "web3-bzz": "1.7.0", - "web3-core": "1.7.0", - "web3-eth": "1.7.0", - "web3-eth-personal": "1.7.0", - "web3-net": "1.7.0", - "web3-shh": "1.7.0", - "web3-utils": "1.7.0" + "web3-bzz": "1.7.1", + "web3-core": "1.7.1", + "web3-eth": "1.7.1", + "web3-eth-personal": "1.7.1", + "web3-net": "1.7.1", + "web3-shh": "1.7.1", + "web3-utils": "1.7.1" } }, "web3-bzz": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.7.0.tgz", - "integrity": "sha512-XPhTWUnZa8gnARfiqaag3jJ9+6+a66Li8OikgBUJoMUqPuQTCJPncTbGYqOJIfRFGavEAdlMnfYXx9lvgv2ZPw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.7.1.tgz", + "integrity": "sha512-sVeUSINx4a4pfdnT+3ahdRdpDPvZDf4ZT/eBF5XtqGWq1mhGTl8XaQAk15zafKVm6Onq28vN8abgB/l+TrG8kA==", "dev": true, "requires": { "@types/node": "^12.12.6", @@ -32472,26 +32332,26 @@ }, "dependencies": { "@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true } } }, "web3-core": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.7.0.tgz", - "integrity": "sha512-U/CRL53h3T5KHl8L3njzCBT7fCaHkbE6BGJe3McazvFldRbfTDEHXkUJCyM30ZD0RoLi3aDfTVeFIusmEyCctA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.7.1.tgz", + "integrity": "sha512-HOyDPj+4cNyeNPwgSeUkhtS0F+Pxc2obcm4oRYPW5ku6jnTO34pjaij0us+zoY3QEusR8FfAKVK1kFPZnS7Dzw==", "dev": true, "requires": { "@types/bn.js": "^4.11.5", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-core-requestmanager": "1.7.0", - "web3-utils": "1.7.0" + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-core-requestmanager": "1.7.1", + "web3-utils": "1.7.1" }, "dependencies": { "@types/bn.js": { @@ -32504,9 +32364,9 @@ } }, "@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true }, "bignumber.js": { @@ -32518,88 +32378,88 @@ } }, "web3-core-helpers": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.7.0.tgz", - "integrity": "sha512-kFiqsZFHJliKF8VKZNjt2JvKu3gu7h3N1/ke3EPhdp9Li/rLmiyzFVr6ApryZ1FSjbSx6vyOkibG3m6xQ5EHJA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.7.1.tgz", + "integrity": "sha512-xn7Sx+s4CyukOJdlW8bBBDnUCWndr+OCJAlUe/dN2wXiyaGRiCWRhuQZrFjbxLeBt1fYFH7uWyYHhYU6muOHgw==", "dev": true, "requires": { - "web3-eth-iban": "1.7.0", - "web3-utils": "1.7.0" + "web3-eth-iban": "1.7.1", + "web3-utils": "1.7.1" } }, "web3-core-method": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.7.0.tgz", - "integrity": "sha512-43Om+kZX8wU5u1pJ28TltF9e9pSTRph6b8wrOb6wgXAfPHqMulq6UTBJWjXXIRVN46Eiqv0nflw35hp9bbgnbA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.7.1.tgz", + "integrity": "sha512-383wu5FMcEphBFl5jCjk502JnEg3ugHj7MQrsX7DY76pg5N5/dEzxeEMIJFCN6kr5Iq32NINOG3VuJIyjxpsEg==", "dev": true, "requires": { "@ethersproject/transactions": "^5.0.0-beta.135", - "web3-core-helpers": "1.7.0", - "web3-core-promievent": "1.7.0", - "web3-core-subscriptions": "1.7.0", - "web3-utils": "1.7.0" + "web3-core-helpers": "1.7.1", + "web3-core-promievent": "1.7.1", + "web3-core-subscriptions": "1.7.1", + "web3-utils": "1.7.1" } }, "web3-core-promievent": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.7.0.tgz", - "integrity": "sha512-xPH66XeC0K0k29GoRd0vyPQ07yxERPRd4yVPrbMzGAz/e9E4M3XN//XK6+PdfGvGw3fx8VojS+tNIMiw+PujbQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.7.1.tgz", + "integrity": "sha512-Vd+CVnpPejrnevIdxhCkzMEywqgVbhHk/AmXXceYpmwA6sX41c5a65TqXv1i3FWRJAz/dW7oKz9NAzRIBAO/kA==", "dev": true, "requires": { "eventemitter3": "4.0.4" } }, "web3-core-requestmanager": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.7.0.tgz", - "integrity": "sha512-rA3dBTBPrt+eIfTAQ2/oYNTN/2wbZaYNR3pFZGqG8+2oCK03+7oQyz4sWISKy/nYQhURh4GK01rs9sN4o/Tq9w==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.7.1.tgz", + "integrity": "sha512-/EHVTiMShpZKiq0Jka0Vgguxi3vxq1DAHKxg42miqHdUsz4/cDWay2wGALDR2x3ofDB9kqp7pb66HsvQImQeag==", "dev": true, "requires": { "util": "^0.12.0", - "web3-core-helpers": "1.7.0", - "web3-providers-http": "1.7.0", - "web3-providers-ipc": "1.7.0", - "web3-providers-ws": "1.7.0" + "web3-core-helpers": "1.7.1", + "web3-providers-http": "1.7.1", + "web3-providers-ipc": "1.7.1", + "web3-providers-ws": "1.7.1" } }, "web3-core-subscriptions": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.7.0.tgz", - "integrity": "sha512-6giF8pyJrPmWrRpc2WLoVCvQdMMADp20ZpAusEW72axauZCNlW1XfTjs0i4QHQBfdd2lFp65qad9IuATPhuzrQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.7.1.tgz", + "integrity": "sha512-NZBsvSe4J+Wt16xCf4KEtBbxA9TOwSVr8KWfUQ0tC2KMdDYdzNswl0Q9P58xaVuNlJ3/BH+uDFZJJ5E61BSA1Q==", "dev": true, "requires": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.7.0" + "web3-core-helpers": "1.7.1" } }, "web3-eth": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.7.0.tgz", - "integrity": "sha512-3uYwjMjn/MZjKIzXCt4YL9ja/k9X5shfa4lKparZhZE6uesmu+xmSmrEFXA/e9qcveF50jkV7frjkT8H+cLYtw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.7.1.tgz", + "integrity": "sha512-Uz3gO4CjTJ+hMyJZAd2eiv2Ur1uurpN7sTMATWKXYR/SgG+SZgncnk/9d8t23hyu4lyi2GiVL1AqVqptpRElxg==", "dev": true, "requires": { - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-core-subscriptions": "1.7.0", - "web3-eth-abi": "1.7.0", - "web3-eth-accounts": "1.7.0", - "web3-eth-contract": "1.7.0", - "web3-eth-ens": "1.7.0", - "web3-eth-iban": "1.7.0", - "web3-eth-personal": "1.7.0", - "web3-net": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-core-subscriptions": "1.7.1", + "web3-eth-abi": "1.7.1", + "web3-eth-accounts": "1.7.1", + "web3-eth-contract": "1.7.1", + "web3-eth-ens": "1.7.1", + "web3-eth-iban": "1.7.1", + "web3-eth-personal": "1.7.1", + "web3-net": "1.7.1", + "web3-utils": "1.7.1" } }, "web3-eth-abi": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.0.tgz", - "integrity": "sha512-heqR0bWxgCJwjWIhq2sGyNj9bwun5+Xox/LdZKe+WMyTSy0cXDXEAgv3XKNkXC4JqdDt/ZlbTEx4TWak4TRMSg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.1.tgz", + "integrity": "sha512-8BVBOoFX1oheXk+t+uERBibDaVZ5dxdcefpbFTWcBs7cdm0tP8CD1ZTCLi5Xo+1bolVHNH2dMSf/nEAssq5pUA==", "dev": true, "requires": { "@ethersproject/abi": "5.0.7", - "web3-utils": "1.7.0" + "web3-utils": "1.7.1" }, "dependencies": { "@ethersproject/abi": { @@ -32622,9 +32482,9 @@ } }, "web3-eth-accounts": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.7.0.tgz", - "integrity": "sha512-Zwm7TlQXdXGRuS6+ib1YsR5fQwpfnFyL6UAZg1zERdrUrs3IkCZSL3yCP/8ZYbAjdTEwWljoott2iSqXNH09ug==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.7.1.tgz", + "integrity": "sha512-3xGQ2bkTQc7LFoqGWxp5cQDrKndlX05s7m0rAFVoyZZODMqrdSGjMPMqmWqHzJRUswNEMc+oelqSnGBubqhguQ==", "dev": true, "requires": { "@ethereumjs/common": "^2.5.0", @@ -32634,10 +32494,10 @@ "ethereumjs-util": "^7.0.10", "scrypt-js": "^3.0.1", "uuid": "3.3.2", - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-utils": "1.7.1" }, "dependencies": { "eth-lib": { @@ -32660,19 +32520,19 @@ } }, "web3-eth-contract": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.7.0.tgz", - "integrity": "sha512-2LY1Xwxu5rx468nqHuhvupQAIpytxIUj3mGL9uexszkhrQf05THVe3i4OnUCzkeN6B2cDztNOqLT3j9SSnVQDg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.7.1.tgz", + "integrity": "sha512-HpnbkPYkVK3lOyos2SaUjCleKfbF0SP3yjw7l551rAAi5sIz/vwlEzdPWd0IHL7ouxXbO0tDn7jzWBRcD3sTbA==", "dev": true, "requires": { "@types/bn.js": "^4.11.5", - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-core-promievent": "1.7.0", - "web3-core-subscriptions": "1.7.0", - "web3-eth-abi": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-core-promievent": "1.7.1", + "web3-core-subscriptions": "1.7.1", + "web3-eth-abi": "1.7.1", + "web3-utils": "1.7.1" }, "dependencies": { "@types/bn.js": { @@ -32687,111 +32547,111 @@ } }, "web3-eth-ens": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.7.0.tgz", - "integrity": "sha512-I1bikYJJWQ/FJZIAvwsGOvzAgcRIkosWG4s1L6veRoXaU8OEJFeh4s00KcfHDxg7GWZZGbUSbdbzKpwRbWnvkg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.7.1.tgz", + "integrity": "sha512-DVCF76i9wM93DrPQwLrYiCw/UzxFuofBsuxTVugrnbm0SzucajLLNftp3ITK0c4/lV3x9oo5ER/wD6RRMHQnvw==", "dev": true, "requires": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-promievent": "1.7.0", - "web3-eth-abi": "1.7.0", - "web3-eth-contract": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-promievent": "1.7.1", + "web3-eth-abi": "1.7.1", + "web3-eth-contract": "1.7.1", + "web3-utils": "1.7.1" } }, "web3-eth-iban": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.7.0.tgz", - "integrity": "sha512-1PFE/Og+sPZaug+M9TqVUtjOtq0HecE+SjDcsOOysXSzslNC2CItBGkcRwbvUcS+LbIkA7MFsuqYxOL0IV/gyA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.7.1.tgz", + "integrity": "sha512-XG4I3QXuKB/udRwZdNEhdYdGKjkhfb/uH477oFVMLBqNimU/Cw8yXUI5qwFKvBHM+hMQWfzPDuSDEDKC2uuiMg==", "dev": true, "requires": { "bn.js": "^4.11.9", - "web3-utils": "1.7.0" + "web3-utils": "1.7.1" } }, "web3-eth-personal": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.0.tgz", - "integrity": "sha512-Dr9RZTNOR80PhrPKGdktDUXpOgExEcCcosBj080lKCJFU1paSPj9Zfnth3u6BtIOXyKsVFTrpqekqUDyAwXnNw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.1.tgz", + "integrity": "sha512-02H6nFBNfNmFjMGZL6xcDi0r7tUhxrUP91FTFdoLyR94eIJDadPp4rpXfG7MVES873i1PReh4ep5pSCHbc3+Pg==", "dev": true, "requires": { "@types/node": "^12.12.6", - "web3-core": "1.7.0", - "web3-core-helpers": "1.7.0", - "web3-core-method": "1.7.0", - "web3-net": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-helpers": "1.7.1", + "web3-core-method": "1.7.1", + "web3-net": "1.7.1", + "web3-utils": "1.7.1" }, "dependencies": { "@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", + "version": "12.20.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", + "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", "dev": true } } }, "web3-net": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.7.0.tgz", - "integrity": "sha512-8pmfU1Se7DmG40Pu8nOCKlhuI12VsVzCtdFDnLAai0zGVAOUuuOCK71B2aKm6u9amWBJjtOlyrCwvsG+QEd6dw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.7.1.tgz", + "integrity": "sha512-8yPNp2gvjInWnU7DCoj4pIPNhxzUjrxKlODsyyXF8j0q3Z2VZuQp+c63gL++r2Prg4fS8t141/HcJw4aMu5sVA==", "dev": true, "requires": { - "web3-core": "1.7.0", - "web3-core-method": "1.7.0", - "web3-utils": "1.7.0" + "web3-core": "1.7.1", + "web3-core-method": "1.7.1", + "web3-utils": "1.7.1" } }, "web3-providers-http": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.7.0.tgz", - "integrity": "sha512-Y9reeEiApfvQKLUUtrU4Z0c+H6b7BMWcsxjgoXndI1C5NB297mIUfltXxfXsh5C/jk5qn4Q3sJp3SwQTyVjH7Q==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.7.1.tgz", + "integrity": "sha512-dmiO6G4dgAa3yv+2VD5TduKNckgfR97VI9YKXVleWdcpBoKXe2jofhdvtafd42fpIoaKiYsErxQNcOC5gI/7Vg==", "dev": true, "requires": { - "web3-core-helpers": "1.7.0", + "web3-core-helpers": "1.7.1", "xhr2-cookies": "1.1.0" } }, "web3-providers-ipc": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.7.0.tgz", - "integrity": "sha512-U5YLXgu6fvAK4nnMYqo9eoml3WywgTym0dgCdVX/n1UegLIQ4nctTubBAuWQEJzmAzwh+a6ValGcE7ZApTRI7Q==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.7.1.tgz", + "integrity": "sha512-uNgLIFynwnd5M9ZC0lBvRQU5iLtU75hgaPpc7ZYYR+kjSk2jr2BkEAQhFVJ8dlqisrVmmqoAPXOEU0flYZZgNQ==", "dev": true, "requires": { "oboe": "2.1.5", - "web3-core-helpers": "1.7.0" + "web3-core-helpers": "1.7.1" } }, "web3-providers-ws": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.7.0.tgz", - "integrity": "sha512-0a8+lVV3JBf+eYnGOsdzOpftK1kis5X7s35QAdoaG5SDapnEylXFlR4xDSSSU88ZwMwvse8hvng2xW6A7oeWxw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.7.1.tgz", + "integrity": "sha512-Uj0n5hdrh0ESkMnTQBsEUS2u6Unqdc7Pe4Zl+iZFb7Yn9cIGsPJBl7/YOP4137EtD5ueXAv+MKwzcelpVhFiFg==", "dev": true, "requires": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.7.0", + "web3-core-helpers": "1.7.1", "websocket": "^1.0.32" } }, "web3-shh": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.7.0.tgz", - "integrity": "sha512-RZhxcevALIPK178VZCpwMBvQeW+IoWtRJ4EMdegpbnETeZaC3aRUcs6vKnrf0jXJjm4J/E2Dt438Y1Ord/1IMw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.7.1.tgz", + "integrity": "sha512-NO+jpEjo8kYX6c7GiaAm57Sx93PLYkWYUCWlZmUOW7URdUcux8VVluvTWklGPvdM9H1WfDrol91DjuSW+ykyqg==", "dev": true, "requires": { - "web3-core": "1.7.0", - "web3-core-method": "1.7.0", - "web3-core-subscriptions": "1.7.0", - "web3-net": "1.7.0" + "web3-core": "1.7.1", + "web3-core-method": "1.7.1", + "web3-core-subscriptions": "1.7.1", + "web3-net": "1.7.1" } }, "web3-utils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.0.tgz", - "integrity": "sha512-O8Tl4Ky40Sp6pe89Olk2FsaUkgHyb5QAXuaKo38ms3CxZZ4d3rPGfjP9DNKGm5+IUgAZBNpF1VmlSmNCqfDI1w==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.1.tgz", + "integrity": "sha512-fef0EsqMGJUgiHPdX+KN9okVWshbIumyJPmR+btnD1HgvoXijKEkuKBv0OmUqjbeqmLKP2/N9EiXKJel5+E1Dw==", "dev": true, "requires": { "bn.js": "^4.11.9", @@ -33124,9 +32984,9 @@ "dev": true }, "yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.0.tgz", + "integrity": "sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA==", "dev": true, "requires": { "cliui": "^7.0.2", @@ -33185,172 +33045,31 @@ } }, "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" }, "dependencies": { "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true } } }, - "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", - "dev": true, - "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - } - } - }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", From d4d8d2ed9798cc3383912a23b5e8d5cb602f7d4b Mon Sep 17 00:00:00 2001 From: dmfxyz <100147743+dmfxyz@users.noreply.github.com> Date: Tue, 5 Apr 2022 15:44:20 -0700 Subject: [PATCH 42/81] Fix burn documentation (#3246) Co-authored-by: xombxomb --- contracts/token/ERC721/extensions/ERC721Burnable.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/ERC721/extensions/ERC721Burnable.sol b/contracts/token/ERC721/extensions/ERC721Burnable.sol index 063997ddf..f8e15f609 100644 --- a/contracts/token/ERC721/extensions/ERC721Burnable.sol +++ b/contracts/token/ERC721/extensions/ERC721Burnable.sol @@ -8,7 +8,7 @@ import "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token - * @dev ERC721 Token that can be irreversibly burned (destroyed). + * @dev ERC721 Token that can be burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** From 731e199038dae40428afd2fb1056bafbdf54ea06 Mon Sep 17 00:00:00 2001 From: mcIovin <60447858+mcIovin@users.noreply.github.com> Date: Thu, 7 Apr 2022 18:28:18 -0500 Subject: [PATCH 43/81] Improve docs for ERC721URIStorage._burn (#3324) --- .../token/ERC721/extensions/ERC721URIStorage.sol | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/contracts/token/ERC721/extensions/ERC721URIStorage.sol b/contracts/token/ERC721/extensions/ERC721URIStorage.sol index bc0e07e7f..f55fdb54c 100644 --- a/contracts/token/ERC721/extensions/ERC721URIStorage.sol +++ b/contracts/token/ERC721/extensions/ERC721URIStorage.sol @@ -48,14 +48,9 @@ abstract contract ERC721URIStorage is ERC721 { } /** - * @dev Destroys `tokenId`. - * The approval is cleared when the token is burned. - * - * Requirements: - * - * - `tokenId` must exist. - * - * Emits a {Transfer} event. + * @dev See {ERC721-_burn}. This override additionally checks to see if a + * token-specific URI was set for the token, and if so, it deletes the token URI from + * the storage mapping. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); From dd018894345a99e5058578cd0dc15bbb31b631b3 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 7 Apr 2022 20:34:04 -0300 Subject: [PATCH 44/81] Remove outdated documentation in ERC2981._setTokenRoyalty --- contracts/token/common/ERC2981.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index cee7cb09f..b8b0b6333 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -88,7 +88,6 @@ abstract contract ERC2981 is IERC2981, ERC165 { * * Requirements: * - * - `tokenId` must be already minted. * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ From bc810db3203066308fccf482713b77564349fa98 Mon Sep 17 00:00:00 2001 From: Joey <31974730+Joeysantoro@users.noreply.github.com> Date: Fri, 8 Apr 2022 13:05:57 -0700 Subject: [PATCH 45/81] Use a customizable _execute function in TimelockController (#3317) Co-authored-by: Hadrien Croubois Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + contracts/governance/TimelockController.sol | 46 +++++++++++---------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3394576a..ae7826d50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) + * `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317)) ## Unreleased diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index 376023fe3..cef21d6cd 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -6,6 +6,7 @@ pragma solidity ^0.8.0; import "../access/AccessControl.sol"; import "../token/ERC721/IERC721Receiver.sol"; import "../token/ERC1155/IERC1155Receiver.sol"; +import "../utils/Address.sol"; /** * @dev Contract module which acts as a timelocked controller. When set as the @@ -288,13 +289,15 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver function execute( address target, uint256 value, - bytes calldata data, + bytes calldata payload, bytes32 predecessor, bytes32 salt ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { - bytes32 id = hashOperation(target, value, data, predecessor, salt); + bytes32 id = hashOperation(target, value, payload, predecessor, salt); + _beforeCall(id, predecessor); - _call(id, 0, target, value, data); + _execute(target, value, payload); + emit CallExecuted(id, 0, target, value, payload); _afterCall(id); } @@ -318,13 +321,30 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver require(targets.length == payloads.length, "TimelockController: length mismatch"); bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt); + _beforeCall(id, predecessor); for (uint256 i = 0; i < targets.length; ++i) { - _call(id, i, targets[i], values[i], payloads[i]); + address target = targets[i]; + uint256 value = values[i]; + bytes calldata payload = payloads[i]; + _execute(target, value, payload); + emit CallExecuted(id, i, target, value, payload); } _afterCall(id); } + /** + * @dev Execute an operation's call. + */ + function _execute( + address target, + uint256 value, + bytes calldata data + ) internal virtual { + (bool success, ) = target.call{value: value}(data); + require(success, "TimelockController: underlying transaction reverted"); + } + /** * @dev Checks before execution of an operation's calls. */ @@ -341,24 +361,6 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver _timestamps[id] = _DONE_TIMESTAMP; } - /** - * @dev Execute an operation's call. - * - * Emits a {CallExecuted} event. - */ - function _call( - bytes32 id, - uint256 index, - address target, - uint256 value, - bytes calldata data - ) private { - (bool success, ) = target.call{value: value}(data); - require(success, "TimelockController: underlying transaction reverted"); - - emit CallExecuted(id, index, target, value, data); - } - /** * @dev Changes the minimum timelock duration for future operations. * From 28dd490726f045f7137fa1903b7a6b8a52d6ffcb Mon Sep 17 00:00:00 2001 From: Philippe Dumonet Date: Sat, 9 Apr 2022 00:27:11 +0200 Subject: [PATCH 46/81] Optimize ERC1167 proxy creation code by 1 opcode (#3329) --- CHANGELOG.md | 1 + contracts/proxy/Clones.sol | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae7826d50..b483f71fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) + * `Clones`: optimize clone creation ([#3329](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3329)) * `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317)) ## Unreleased diff --git a/contracts/proxy/Clones.sol b/contracts/proxy/Clones.sol index 31ece8f81..81c956c80 100644 --- a/contracts/proxy/Clones.sol +++ b/contracts/proxy/Clones.sol @@ -25,10 +25,10 @@ library Clones { function clone(address implementation) internal returns (address instance) { assembly { let ptr := mload(0x40) - mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) - mstore(add(ptr, 0x14), shl(0x60, implementation)) - mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) - instance := create(0, ptr, 0x37) + mstore(ptr, 0x602d8060093d393df3363d3d373d3d3d363d7300000000000000000000000000) + mstore(add(ptr, 0x13), shl(0x60, implementation)) + mstore(add(ptr, 0x27), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) + instance := create(0, ptr, 0x36) } require(instance != address(0), "ERC1167: create failed"); } @@ -43,10 +43,10 @@ library Clones { function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { assembly { let ptr := mload(0x40) - mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) - mstore(add(ptr, 0x14), shl(0x60, implementation)) - mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) - instance := create2(0, ptr, 0x37, salt) + mstore(ptr, 0x602d8060093d393df3363d3d373d3d3d363d7300000000000000000000000000) + mstore(add(ptr, 0x13), shl(0x60, implementation)) + mstore(add(ptr, 0x27), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) + instance := create2(0, ptr, 0x36, salt) } require(instance != address(0), "ERC1167: create2 failed"); } @@ -61,13 +61,13 @@ library Clones { ) internal pure returns (address predicted) { assembly { let ptr := mload(0x40) - mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) - mstore(add(ptr, 0x14), shl(0x60, implementation)) - mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) - mstore(add(ptr, 0x38), shl(0x60, deployer)) - mstore(add(ptr, 0x4c), salt) - mstore(add(ptr, 0x6c), keccak256(ptr, 0x37)) - predicted := keccak256(add(ptr, 0x37), 0x55) + mstore(ptr, 0x602d8060093d393df3363d3d373d3d3d363d7300000000000000000000000000) + mstore(add(ptr, 0x13), shl(0x60, implementation)) + mstore(add(ptr, 0x27), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) + mstore(add(ptr, 0x37), shl(0x60, deployer)) + mstore(add(ptr, 0x4b), salt) + mstore(add(ptr, 0x6b), keccak256(ptr, 0x36)) + predicted := keccak256(add(ptr, 0x36), 0x55) } } From 7392d8373873bed5da9ac9a97811d709f8c5ffbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 10:05:45 -0300 Subject: [PATCH 47/81] Bump minimist from 1.2.5 to 1.2.6 (#3303) Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From cb14ea3c5c72151f254ec79866793ddf65f4c727 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 13 Apr 2022 19:21:52 -0300 Subject: [PATCH 48/81] Bump minimum Solidity version for Initializable.sol to 0.8.2 (#3328) --- contracts/proxy/utils/Initializable.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/proxy/utils/Initializable.sol b/contracts/proxy/utils/Initializable.sol index 3ec66bb6e..302653960 100644 --- a/contracts/proxy/utils/Initializable.sol +++ b/contracts/proxy/utils/Initializable.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) -pragma solidity ^0.8.0; +pragma solidity ^0.8.2; import "../../utils/Address.sol"; From 5a75065659a65e65bb04890192e3a4bcb7917fff Mon Sep 17 00:00:00 2001 From: GitHubPang <61439577+GitHubPang@users.noreply.github.com> Date: Thu, 14 Apr 2022 13:08:36 +0800 Subject: [PATCH 49/81] Fix typo in CHANGELOG (#3341) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b483f71fd..571d361c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog ## Unreleased - * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) + * `ERC2981`: make `royaltyInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) * `Clones`: optimize clone creation ([#3329](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3329)) * `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317)) From d4e6236b2b5cb9f7286a3c83ddfe592d2709680d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Petti?= Date: Sat, 23 Apr 2022 15:20:55 +0200 Subject: [PATCH 50/81] Fix deprecated expectEvent.inLogs #3332 (#3333) --- test/finance/PaymentSplitter.test.js | 12 ++-- test/governance/utils/Votes.behavior.js | 4 +- test/security/Pausable.test.js | 8 +-- test/token/ERC1155/ERC1155.behavior.js | 28 ++++----- test/token/ERC1155/ERC1155.test.js | 16 ++--- .../extensions/ERC20Burnable.behavior.js | 9 ++- .../ERC20/extensions/ERC20Snapshot.test.js | 32 +++++----- .../token/ERC20/extensions/ERC20Votes.test.js | 4 +- .../ERC20/extensions/ERC20VotesComp.test.js | 4 +- test/token/ERC721/ERC721.behavior.js | 60 +++++++++---------- .../ERC721/extensions/ERC721Burnable.test.js | 10 ++-- test/token/ERC777/ERC777.behavior.js | 30 +++++----- test/token/ERC777/ERC777.test.js | 28 ++++----- test/utils/Context.behavior.js | 8 +-- test/utils/escrow/Escrow.behavior.js | 8 +-- test/utils/escrow/RefundEscrow.test.js | 8 +-- 16 files changed, 133 insertions(+), 136 deletions(-) diff --git a/test/finance/PaymentSplitter.test.js b/test/finance/PaymentSplitter.test.js index 6df0c4cb9..fdb81f610 100644 --- a/test/finance/PaymentSplitter.test.js +++ b/test/finance/PaymentSplitter.test.js @@ -130,22 +130,22 @@ contract('PaymentSplitter', function (accounts) { // distribute to payees const tracker1 = await balance.tracker(payee1); - const { logs: logs1 } = await this.contract.release(payee1); + const receipt1 = await this.contract.release(payee1); const profit1 = await tracker1.delta(); expect(profit1).to.be.bignumber.equal(ether('0.20')); - expectEvent.inLogs(logs1, 'PaymentReleased', { to: payee1, amount: profit1 }); + expectEvent(receipt1, 'PaymentReleased', { to: payee1, amount: profit1 }); const tracker2 = await balance.tracker(payee2); - const { logs: logs2 } = await this.contract.release(payee2); + const receipt2 = await this.contract.release(payee2); const profit2 = await tracker2.delta(); expect(profit2).to.be.bignumber.equal(ether('0.10')); - expectEvent.inLogs(logs2, 'PaymentReleased', { to: payee2, amount: profit2 }); + expectEvent(receipt2, 'PaymentReleased', { to: payee2, amount: profit2 }); const tracker3 = await balance.tracker(payee3); - const { logs: logs3 } = await this.contract.release(payee3); + const receipt3 = await this.contract.release(payee3); const profit3 = await tracker3.delta(); expect(profit3).to.be.bignumber.equal(ether('0.70')); - expectEvent.inLogs(logs3, 'PaymentReleased', { to: payee3, amount: profit3 }); + expectEvent(receipt3, 'PaymentReleased', { to: payee3, amount: profit3 }); // end balance should be zero expect(await balance.current(this.contract.address)).to.be.bignumber.equal('0'); diff --git a/test/governance/utils/Votes.behavior.js b/test/governance/utils/Votes.behavior.js index 17b49eaa9..aee227bdb 100644 --- a/test/governance/utils/Votes.behavior.js +++ b/test/governance/utils/Votes.behavior.js @@ -108,8 +108,8 @@ function shouldBehaveLikeVotes () { }), )); - const { logs } = await this.votes.delegateBySig(this.account1Delegatee, nonce, MAX_UINT256, v, r, s); - const { args } = logs.find(({ event }) => event === 'DelegateChanged'); + const receipt = await this.votes.delegateBySig(this.account1Delegatee, nonce, MAX_UINT256, v, r, s); + const { args } = receipt.logs.find(({ event }) => event === 'DelegateChanged'); expect(args.delegator).to.not.be.equal(delegatorAddress); expect(args.fromDelegate).to.be.equal(ZERO_ADDRESS); expect(args.toDelegate).to.be.equal(this.account1Delegatee); diff --git a/test/security/Pausable.test.js b/test/security/Pausable.test.js index 146815949..86701bcfd 100644 --- a/test/security/Pausable.test.js +++ b/test/security/Pausable.test.js @@ -32,11 +32,11 @@ contract('Pausable', function (accounts) { context('when paused', function () { beforeEach(async function () { - ({ logs: this.logs } = await this.pausable.pause({ from: pauser })); + (this.receipt = await this.pausable.pause({ from: pauser })); }); it('emits a Paused event', function () { - expectEvent.inLogs(this.logs, 'Paused', { account: pauser }); + expectEvent(this.receipt, 'Paused', { account: pauser }); }); it('cannot perform normal process in pause', async function () { @@ -60,11 +60,11 @@ contract('Pausable', function (accounts) { context('when unpaused', function () { beforeEach(async function () { - ({ logs: this.logs } = await this.pausable.unpause({ from: pauser })); + (this.receipt = await this.pausable.unpause({ from: pauser })); }); it('emits an Unpaused event', function () { - expectEvent.inLogs(this.logs, 'Unpaused', { account: pauser }); + expectEvent(this.receipt, 'Unpaused', { account: pauser }); }); it('should resume allowing normal process', async function () { diff --git a/test/token/ERC1155/ERC1155.behavior.js b/test/token/ERC1155/ERC1155.behavior.js index 0e87f5af1..4cdcfe1e7 100644 --- a/test/token/ERC1155/ERC1155.behavior.js +++ b/test/token/ERC1155/ERC1155.behavior.js @@ -165,9 +165,9 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, }); describe('setApprovalForAll', function () { - let logs; + let receipt; beforeEach(async function () { - ({ logs } = await this.token.setApprovalForAll(proxy, true, { from: multiTokenHolder })); + (receipt = await this.token.setApprovalForAll(proxy, true, { from: multiTokenHolder })); }); it('sets approval status which can be queried via isApprovedForAll', async function () { @@ -175,7 +175,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, }); it('emits an ApprovalForAll log', function () { - expectEvent.inLogs(logs, 'ApprovalForAll', { account: multiTokenHolder, operator: proxy, approved: true }); + expectEvent(receipt, 'ApprovalForAll', { account: multiTokenHolder, operator: proxy, approved: true }); }); it('can unset approval for an operator', async function () { @@ -247,7 +247,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, }); it('emits a TransferSingle log', function () { - expectEvent.inLogs(this.transferLogs, 'TransferSingle', { + expectEvent(this.transferLogs, 'TransferSingle', { operator, from, to: this.toWhom, @@ -260,7 +260,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, context('when called by the multiTokenHolder', async function () { beforeEach(async function () { this.toWhom = recipient; - ({ logs: this.transferLogs } = + (this.transferLogs = await this.token.safeTransferFrom(multiTokenHolder, recipient, firstTokenId, firstAmount, '0x', { from: multiTokenHolder, })); @@ -302,7 +302,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, beforeEach(async function () { this.toWhom = recipient; await this.token.setApprovalForAll(proxy, true, { from: multiTokenHolder }); - ({ logs: this.transferLogs } = + (this.transferLogs = await this.token.safeTransferFrom(multiTokenHolder, recipient, firstTokenId, firstAmount, '0x', { from: proxy, })); @@ -344,7 +344,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, '0x', { from: multiTokenHolder }, ); - ({ logs: this.transferLogs } = this.transferReceipt); + (this.transferLogs = this.transferReceipt); }); transferWasSuccessful.call(this, { @@ -377,7 +377,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, data, { from: multiTokenHolder }, ); - ({ logs: this.transferLogs } = this.transferReceipt); + (this.transferLogs = this.transferReceipt); }); transferWasSuccessful.call(this, { @@ -525,7 +525,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, }); it('emits a TransferBatch log', function () { - expectEvent.inLogs(this.transferLogs, 'TransferBatch', { + expectEvent(this.transferLogs, 'TransferBatch', { operator, from, to: this.toWhom, @@ -538,7 +538,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, context('when called by the multiTokenHolder', async function () { beforeEach(async function () { this.toWhom = recipient; - ({ logs: this.transferLogs } = + (this.transferLogs = await this.token.safeBatchTransferFrom( multiTokenHolder, recipient, [firstTokenId, secondTokenId], @@ -578,7 +578,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, beforeEach(async function () { this.toWhom = recipient; await this.token.setApprovalForAll(proxy, true, { from: multiTokenHolder }); - ({ logs: this.transferLogs } = + (this.transferLogs = await this.token.safeBatchTransferFrom( multiTokenHolder, recipient, [firstTokenId, secondTokenId], @@ -620,7 +620,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, [firstAmount, secondAmount], '0x', { from: multiTokenHolder }, ); - ({ logs: this.transferLogs } = this.transferReceipt); + (this.transferLogs = this.transferReceipt); }); batchTransferWasSuccessful.call(this, { @@ -651,7 +651,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, [firstAmount, secondAmount], data, { from: multiTokenHolder }, ); - ({ logs: this.transferLogs } = this.transferReceipt); + (this.transferLogs = this.transferReceipt); }); batchTransferWasSuccessful.call(this, { @@ -729,7 +729,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder, [firstAmount, secondAmount], '0x', { from: multiTokenHolder }, ); - ({ logs: this.transferLogs } = this.transferReceipt); + (this.transferLogs = this.transferReceipt); }); batchTransferWasSuccessful.call(this, { diff --git a/test/token/ERC1155/ERC1155.test.js b/test/token/ERC1155/ERC1155.test.js index dffe054b6..a0a8cf3ff 100644 --- a/test/token/ERC1155/ERC1155.test.js +++ b/test/token/ERC1155/ERC1155.test.js @@ -38,11 +38,11 @@ contract('ERC1155', function (accounts) { context('with minted tokens', function () { beforeEach(async function () { - ({ logs: this.logs } = await this.token.mint(tokenHolder, tokenId, mintAmount, data, { from: operator })); + (this.receipt = await this.token.mint(tokenHolder, tokenId, mintAmount, data, { from: operator })); }); it('emits a TransferSingle event', function () { - expectEvent.inLogs(this.logs, 'TransferSingle', { + expectEvent(this.receipt, 'TransferSingle', { operator, from: ZERO_ADDRESS, to: tokenHolder, @@ -79,7 +79,7 @@ contract('ERC1155', function (accounts) { context('with minted batch of tokens', function () { beforeEach(async function () { - ({ logs: this.logs } = await this.token.mintBatch( + (this.receipt = await this.token.mintBatch( tokenBatchHolder, tokenBatchIds, mintAmounts, @@ -89,7 +89,7 @@ contract('ERC1155', function (accounts) { }); it('emits a TransferBatch event', function () { - expectEvent.inLogs(this.logs, 'TransferBatch', { + expectEvent(this.receipt, 'TransferBatch', { operator, from: ZERO_ADDRESS, to: tokenBatchHolder, @@ -142,7 +142,7 @@ contract('ERC1155', function (accounts) { context('with minted-then-burnt tokens', function () { beforeEach(async function () { await this.token.mint(tokenHolder, tokenId, mintAmount, data); - ({ logs: this.logs } = await this.token.burn( + (this.receipt = await this.token.burn( tokenHolder, tokenId, burnAmount, @@ -151,7 +151,7 @@ contract('ERC1155', function (accounts) { }); it('emits a TransferSingle event', function () { - expectEvent.inLogs(this.logs, 'TransferSingle', { + expectEvent(this.receipt, 'TransferSingle', { operator, from: tokenHolder, to: ZERO_ADDRESS, @@ -199,7 +199,7 @@ contract('ERC1155', function (accounts) { context('with minted-then-burnt tokens', function () { beforeEach(async function () { await this.token.mintBatch(tokenBatchHolder, tokenBatchIds, mintAmounts, data); - ({ logs: this.logs } = await this.token.burnBatch( + (this.receipt = await this.token.burnBatch( tokenBatchHolder, tokenBatchIds, burnAmounts, @@ -208,7 +208,7 @@ contract('ERC1155', function (accounts) { }); it('emits a TransferBatch event', function () { - expectEvent.inLogs(this.logs, 'TransferBatch', { + expectEvent(this.receipt, 'TransferBatch', { operator, from: tokenBatchHolder, to: ZERO_ADDRESS, diff --git a/test/token/ERC20/extensions/ERC20Burnable.behavior.js b/test/token/ERC20/extensions/ERC20Burnable.behavior.js index 3ba2fc9d9..a931bf60d 100644 --- a/test/token/ERC20/extensions/ERC20Burnable.behavior.js +++ b/test/token/ERC20/extensions/ERC20Burnable.behavior.js @@ -16,7 +16,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) { function shouldBurn (amount) { beforeEach(async function () { - ({ logs: this.logs } = await this.token.burn(amount, { from: owner })); + (this.receipt = await this.token.burn(amount, { from: owner })); }); it('burns the requested amount', async function () { @@ -24,7 +24,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) { }); it('emits a transfer event', async function () { - expectEvent.inLogs(this.logs, 'Transfer', { + expectEvent(this.receipt, 'Transfer', { from: owner, to: ZERO_ADDRESS, value: amount, @@ -59,8 +59,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) { beforeEach(async function () { await this.token.approve(burner, originalAllowance, { from: owner }); - const { logs } = await this.token.burnFrom(owner, amount, { from: burner }); - this.logs = logs; + this.receipt = await this.token.burnFrom(owner, amount, { from: burner }); }); it('burns the requested amount', async function () { @@ -72,7 +71,7 @@ function shouldBehaveLikeERC20Burnable (owner, initialBalance, [burner]) { }); it('emits a transfer event', async function () { - expectEvent.inLogs(this.logs, 'Transfer', { + expectEvent(this.receipt, 'Transfer', { from: owner, to: ZERO_ADDRESS, value: amount, diff --git a/test/token/ERC20/extensions/ERC20Snapshot.test.js b/test/token/ERC20/extensions/ERC20Snapshot.test.js index b05ca2b99..64d922706 100644 --- a/test/token/ERC20/extensions/ERC20Snapshot.test.js +++ b/test/token/ERC20/extensions/ERC20Snapshot.test.js @@ -17,14 +17,14 @@ contract('ERC20Snapshot', function (accounts) { describe('snapshot', function () { it('emits a snapshot event', async function () { - const { logs } = await this.token.snapshot(); - expectEvent.inLogs(logs, 'Snapshot'); + const receipt = await this.token.snapshot(); + expectEvent(receipt, 'Snapshot'); }); it('creates increasing snapshots ids, starting from 1', async function () { for (const id of ['1', '2', '3', '4', '5']) { - const { logs } = await this.token.snapshot(); - expectEvent.inLogs(logs, 'Snapshot', { id }); + const receipt = await this.token.snapshot(); + expectEvent(receipt, 'Snapshot', { id }); } }); }); @@ -42,8 +42,8 @@ contract('ERC20Snapshot', function (accounts) { beforeEach(async function () { this.initialSnapshotId = new BN('1'); - const { logs } = await this.token.snapshot(); - expectEvent.inLogs(logs, 'Snapshot', { id: this.initialSnapshotId }); + const receipt = await this.token.snapshot(); + expectEvent(receipt, 'Snapshot', { id: this.initialSnapshotId }); }); context('with no supply changes after the snapshot', function () { @@ -66,8 +66,8 @@ contract('ERC20Snapshot', function (accounts) { beforeEach(async function () { this.secondSnapshotId = new BN('2'); - const { logs } = await this.token.snapshot(); - expectEvent.inLogs(logs, 'Snapshot', { id: this.secondSnapshotId }); + const receipt = await this.token.snapshot(); + expectEvent(receipt, 'Snapshot', { id: this.secondSnapshotId }); }); it('snapshots return the supply before and after the changes', async function () { @@ -84,8 +84,8 @@ contract('ERC20Snapshot', function (accounts) { this.secondSnapshotIds = ['2', '3', '4']; for (const id of this.secondSnapshotIds) { - const { logs } = await this.token.snapshot(); - expectEvent.inLogs(logs, 'Snapshot', { id }); + const receipt = await this.token.snapshot(); + expectEvent(receipt, 'Snapshot', { id }); } }); @@ -116,8 +116,8 @@ contract('ERC20Snapshot', function (accounts) { beforeEach(async function () { this.initialSnapshotId = new BN('1'); - const { logs } = await this.token.snapshot(); - expectEvent.inLogs(logs, 'Snapshot', { id: this.initialSnapshotId }); + const receipt = await this.token.snapshot(); + expectEvent(receipt, 'Snapshot', { id: this.initialSnapshotId }); }); context('with no balance changes after the snapshot', function () { @@ -147,8 +147,8 @@ contract('ERC20Snapshot', function (accounts) { beforeEach(async function () { this.secondSnapshotId = new BN('2'); - const { logs } = await this.token.snapshot(); - expectEvent.inLogs(logs, 'Snapshot', { id: this.secondSnapshotId }); + const receipt = await this.token.snapshot(); + expectEvent(receipt, 'Snapshot', { id: this.secondSnapshotId }); }); it('snapshots return the balances before and after the changes', async function () { @@ -174,8 +174,8 @@ contract('ERC20Snapshot', function (accounts) { this.secondSnapshotIds = ['2', '3', '4']; for (const id of this.secondSnapshotIds) { - const { logs } = await this.token.snapshot(); - expectEvent.inLogs(logs, 'Snapshot', { id }); + const receipt = await this.token.snapshot(); + expectEvent(receipt, 'Snapshot', { id }); } }); diff --git a/test/token/ERC20/extensions/ERC20Votes.test.js b/test/token/ERC20/extensions/ERC20Votes.test.js index a0ab60abe..325f26726 100644 --- a/test/token/ERC20/extensions/ERC20Votes.test.js +++ b/test/token/ERC20/extensions/ERC20Votes.test.js @@ -206,8 +206,8 @@ contract('ERC20Votes', function (accounts) { }), )); - const { logs } = await this.token.delegateBySig(holderDelegatee, nonce, MAX_UINT256, v, r, s); - const { args } = logs.find(({ event }) => event == 'DelegateChanged'); + const receipt = await this.token.delegateBySig(holderDelegatee, nonce, MAX_UINT256, v, r, s); + const { args } = receipt.logs.find(({ event }) => event == 'DelegateChanged'); expect(args.delegator).to.not.be.equal(delegatorAddress); expect(args.fromDelegate).to.be.equal(ZERO_ADDRESS); expect(args.toDelegate).to.be.equal(holderDelegatee); diff --git a/test/token/ERC20/extensions/ERC20VotesComp.test.js b/test/token/ERC20/extensions/ERC20VotesComp.test.js index 0f0c25ebf..a91ff1230 100644 --- a/test/token/ERC20/extensions/ERC20VotesComp.test.js +++ b/test/token/ERC20/extensions/ERC20VotesComp.test.js @@ -206,8 +206,8 @@ contract('ERC20VotesComp', function (accounts) { }), )); - const { logs } = await this.token.delegateBySig(holderDelegatee, nonce, MAX_UINT256, v, r, s); - const { args } = logs.find(({ event }) => event == 'DelegateChanged'); + const receipt = await this.token.delegateBySig(holderDelegatee, nonce, MAX_UINT256, v, r, s); + const { args } = receipt.logs.find(({ event }) => event == 'DelegateChanged'); expect(args.delegator).to.not.be.equal(delegatorAddress); expect(args.fromDelegate).to.be.equal(ZERO_ADDRESS); expect(args.toDelegate).to.be.equal(holderDelegatee); diff --git a/test/token/ERC721/ERC721.behavior.js b/test/token/ERC721/ERC721.behavior.js index 75944be70..603057776 100644 --- a/test/token/ERC721/ERC721.behavior.js +++ b/test/token/ERC721/ERC721.behavior.js @@ -76,7 +76,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another const tokenId = firstTokenId; const data = '0x42'; - let logs = null; + let receipt = null; beforeEach(async function () { await this.token.approve(approved, tokenId, { from: owner }); @@ -89,7 +89,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another }); it('emits a Transfer event', async function () { - expectEvent.inLogs(logs, 'Transfer', { from: owner, to: this.toWhom, tokenId: tokenId }); + expectEvent(receipt, 'Transfer', { from: owner, to: this.toWhom, tokenId: tokenId }); }); it('clears the approval for the token ID', async function () { @@ -97,7 +97,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another }); it('emits an Approval event', async function () { - expectEvent.inLogs(logs, 'Approval', { owner, approved: ZERO_ADDRESS, tokenId: tokenId }); + expectEvent(receipt, 'Approval', { owner, approved: ZERO_ADDRESS, tokenId: tokenId }); }); it('adjusts owners balances', async function () { @@ -116,21 +116,21 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another const shouldTransferTokensByUsers = function (transferFunction) { context('when called by the owner', function () { beforeEach(async function () { - ({ logs } = await transferFunction.call(this, owner, this.toWhom, tokenId, { from: owner })); + (receipt = await transferFunction.call(this, owner, this.toWhom, tokenId, { from: owner })); }); transferWasSuccessful({ owner, tokenId, approved }); }); context('when called by the approved individual', function () { beforeEach(async function () { - ({ logs } = await transferFunction.call(this, owner, this.toWhom, tokenId, { from: approved })); + (receipt = await transferFunction.call(this, owner, this.toWhom, tokenId, { from: approved })); }); transferWasSuccessful({ owner, tokenId, approved }); }); context('when called by the operator', function () { beforeEach(async function () { - ({ logs } = await transferFunction.call(this, owner, this.toWhom, tokenId, { from: operator })); + (receipt = await transferFunction.call(this, owner, this.toWhom, tokenId, { from: operator })); }); transferWasSuccessful({ owner, tokenId, approved }); }); @@ -138,14 +138,14 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('when called by the owner without an approved user', function () { beforeEach(async function () { await this.token.approve(ZERO_ADDRESS, tokenId, { from: owner }); - ({ logs } = await transferFunction.call(this, owner, this.toWhom, tokenId, { from: operator })); + (receipt = await transferFunction.call(this, owner, this.toWhom, tokenId, { from: operator })); }); transferWasSuccessful({ owner, tokenId, approved: null }); }); context('when sent to the owner', function () { beforeEach(async function () { - ({ logs } = await transferFunction.call(this, owner, owner, tokenId, { from: owner })); + (receipt = await transferFunction.call(this, owner, owner, tokenId, { from: owner })); }); it('keeps ownership of the token', async function () { @@ -157,7 +157,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another }); it('emits only a transfer event', async function () { - expectEvent.inLogs(logs, 'Transfer', { + expectEvent(receipt, 'Transfer', { from: owner, to: owner, tokenId: tokenId, @@ -422,7 +422,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another describe('approve', function () { const tokenId = firstTokenId; - let logs = null; + let receipt = null; const itClearsApproval = function () { it('clears approval for the token', async function () { @@ -438,7 +438,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another const itEmitsApprovalEvent = function (address) { it('emits an approval event', async function () { - expectEvent.inLogs(logs, 'Approval', { + expectEvent(receipt, 'Approval', { owner: owner, approved: address, tokenId: tokenId, @@ -449,7 +449,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('when clearing approval', function () { context('when there was no prior approval', function () { beforeEach(async function () { - ({ logs } = await this.token.approve(ZERO_ADDRESS, tokenId, { from: owner })); + (receipt = await this.token.approve(ZERO_ADDRESS, tokenId, { from: owner })); }); itClearsApproval(); @@ -459,7 +459,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('when there was a prior approval', function () { beforeEach(async function () { await this.token.approve(approved, tokenId, { from: owner }); - ({ logs } = await this.token.approve(ZERO_ADDRESS, tokenId, { from: owner })); + (receipt = await this.token.approve(ZERO_ADDRESS, tokenId, { from: owner })); }); itClearsApproval(); @@ -470,7 +470,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('when approving a non-zero address', function () { context('when there was no prior approval', function () { beforeEach(async function () { - ({ logs } = await this.token.approve(approved, tokenId, { from: owner })); + (receipt = await this.token.approve(approved, tokenId, { from: owner })); }); itApproves(approved); @@ -480,7 +480,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('when there was a prior approval to the same address', function () { beforeEach(async function () { await this.token.approve(approved, tokenId, { from: owner }); - ({ logs } = await this.token.approve(approved, tokenId, { from: owner })); + (receipt = await this.token.approve(approved, tokenId, { from: owner })); }); itApproves(approved); @@ -490,7 +490,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('when there was a prior approval to a different address', function () { beforeEach(async function () { await this.token.approve(anotherApproved, tokenId, { from: owner }); - ({ logs } = await this.token.approve(anotherApproved, tokenId, { from: owner })); + (receipt = await this.token.approve(anotherApproved, tokenId, { from: owner })); }); itApproves(anotherApproved); @@ -524,7 +524,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('when the sender is an operator', function () { beforeEach(async function () { await this.token.setApprovalForAll(operator, true, { from: owner }); - ({ logs } = await this.token.approve(approved, tokenId, { from: operator })); + (receipt = await this.token.approve(approved, tokenId, { from: operator })); }); itApproves(approved); @@ -549,9 +549,9 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another }); it('emits an approval event', async function () { - const { logs } = await this.token.setApprovalForAll(operator, true, { from: owner }); + const receipt = await this.token.setApprovalForAll(operator, true, { from: owner }); - expectEvent.inLogs(logs, 'ApprovalForAll', { + expectEvent(receipt, 'ApprovalForAll', { owner: owner, operator: operator, approved: true, @@ -571,9 +571,9 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another }); it('emits an approval event', async function () { - const { logs } = await this.token.setApprovalForAll(operator, true, { from: owner }); + const receipt = await this.token.setApprovalForAll(operator, true, { from: owner }); - expectEvent.inLogs(logs, 'ApprovalForAll', { + expectEvent(receipt, 'ApprovalForAll', { owner: owner, operator: operator, approved: true, @@ -599,9 +599,9 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another }); it('emits an approval event', async function () { - const { logs } = await this.token.setApprovalForAll(operator, true, { from: owner }); + const receipt = await this.token.setApprovalForAll(operator, true, { from: owner }); - expectEvent.inLogs(logs, 'ApprovalForAll', { + expectEvent(receipt, 'ApprovalForAll', { owner: owner, operator: operator, approved: true, @@ -657,11 +657,11 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('with minted token', async function () { beforeEach(async function () { - ({ logs: this.logs } = await this.token.mint(owner, firstTokenId)); + (this.receipt = await this.token.mint(owner, firstTokenId)); }); it('emits a Transfer event', function () { - expectEvent.inLogs(this.logs, 'Transfer', { from: ZERO_ADDRESS, to: owner, tokenId: firstTokenId }); + expectEvent(this.receipt, 'Transfer', { from: ZERO_ADDRESS, to: owner, tokenId: firstTokenId }); }); it('creates the token', async function () { @@ -690,15 +690,15 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another context('with burnt token', function () { beforeEach(async function () { - ({ logs: this.logs } = await this.token.burn(firstTokenId)); + (this.receipt = await this.token.burn(firstTokenId)); }); it('emits a Transfer event', function () { - expectEvent.inLogs(this.logs, 'Transfer', { from: owner, to: ZERO_ADDRESS, tokenId: firstTokenId }); + expectEvent(this.receipt, 'Transfer', { from: owner, to: ZERO_ADDRESS, tokenId: firstTokenId }); }); it('emits an Approval event', function () { - expectEvent.inLogs(this.logs, 'Approval', { owner, approved: ZERO_ADDRESS, tokenId: firstTokenId }); + expectEvent(this.receipt, 'Approval', { owner, approved: ZERO_ADDRESS, tokenId: firstTokenId }); }); it('deletes the token', async function () { @@ -830,7 +830,7 @@ function shouldBehaveLikeERC721Enumerable (errorPrefix, owner, newOwner, approve context('with minted token', async function () { beforeEach(async function () { - ({ logs: this.logs } = await this.token.mint(owner, firstTokenId)); + (this.receipt = await this.token.mint(owner, firstTokenId)); }); it('adjusts owner tokens by index', async function () { @@ -858,7 +858,7 @@ function shouldBehaveLikeERC721Enumerable (errorPrefix, owner, newOwner, approve context('with burnt token', function () { beforeEach(async function () { - ({ logs: this.logs } = await this.token.burn(firstTokenId)); + (this.receipt = await this.token.burn(firstTokenId)); }); it('removes that token from the token list of the owner', async function () { diff --git a/test/token/ERC721/extensions/ERC721Burnable.test.js b/test/token/ERC721/extensions/ERC721Burnable.test.js index 3ffca104c..bbf56e6a7 100644 --- a/test/token/ERC721/extensions/ERC721Burnable.test.js +++ b/test/token/ERC721/extensions/ERC721Burnable.test.js @@ -27,12 +27,11 @@ contract('ERC721Burnable', function (accounts) { describe('burn', function () { const tokenId = firstTokenId; - let logs = null; + let receipt = null; describe('when successful', function () { beforeEach(async function () { - const result = await this.token.burn(tokenId, { from: owner }); - logs = result.logs; + receipt = await this.token.burn(tokenId, { from: owner }); }); it('burns the given token ID and adjusts the balance of the owner', async function () { @@ -44,7 +43,7 @@ contract('ERC721Burnable', function (accounts) { }); it('emits a burn event', async function () { - expectEvent.inLogs(logs, 'Transfer', { + expectEvent(receipt, 'Transfer', { from: owner, to: ZERO_ADDRESS, tokenId: tokenId, @@ -55,8 +54,7 @@ contract('ERC721Burnable', function (accounts) { describe('when there is a previous approval burned', function () { beforeEach(async function () { await this.token.approve(approved, tokenId, { from: owner }); - const result = await this.token.burn(tokenId, { from: owner }); - logs = result.logs; + receipt = await this.token.burn(tokenId, { from: owner }); }); context('getApproved', function () { diff --git a/test/token/ERC777/ERC777.behavior.js b/test/token/ERC777/ERC777.behavior.js index 9c96d0e6b..f6af94227 100644 --- a/test/token/ERC777/ERC777.behavior.js +++ b/test/token/ERC777/ERC777.behavior.js @@ -186,10 +186,10 @@ function shouldSendTokens (from, operator, to, amount, data, operatorData) { const initialFromBalance = await this.token.balanceOf(from); const initialToBalance = await this.token.balanceOf(to); - let logs; + let receipt; if (!operatorCall) { - ({ logs } = await this.token.send(to, amount, data, { from })); - expectEvent.inLogs(logs, 'Sent', { + (receipt = await this.token.send(to, amount, data, { from })); + expectEvent(receipt, 'Sent', { operator: from, from, to, @@ -198,8 +198,8 @@ function shouldSendTokens (from, operator, to, amount, data, operatorData) { operatorData: null, }); } else { - ({ logs } = await this.token.operatorSend(from, to, amount, data, operatorData, { from: operator })); - expectEvent.inLogs(logs, 'Sent', { + (receipt = await this.token.operatorSend(from, to, amount, data, operatorData, { from: operator })); + expectEvent(receipt, 'Sent', { operator, from, to, @@ -209,7 +209,7 @@ function shouldSendTokens (from, operator, to, amount, data, operatorData) { }); } - expectEvent.inLogs(logs, 'Transfer', { + expectEvent(receipt, 'Transfer', { from, to, value: amount, @@ -240,10 +240,10 @@ function shouldBurnTokens (from, operator, amount, data, operatorData) { const initialTotalSupply = await this.token.totalSupply(); const initialFromBalance = await this.token.balanceOf(from); - let logs; + let receipt; if (!operatorCall) { - ({ logs } = await this.token.burn(amount, data, { from })); - expectEvent.inLogs(logs, 'Burned', { + (receipt = await this.token.burn(amount, data, { from })); + expectEvent(receipt, 'Burned', { operator: from, from, amount, @@ -251,8 +251,8 @@ function shouldBurnTokens (from, operator, amount, data, operatorData) { operatorData: null, }); } else { - ({ logs } = await this.token.operatorBurn(from, amount, data, operatorData, { from: operator })); - expectEvent.inLogs(logs, 'Burned', { + (receipt = await this.token.operatorBurn(from, amount, data, operatorData, { from: operator })); + expectEvent(receipt, 'Burned', { operator, from, amount, @@ -261,7 +261,7 @@ function shouldBurnTokens (from, operator, amount, data, operatorData) { }); } - expectEvent.inLogs(logs, 'Transfer', { + expectEvent(receipt, 'Transfer', { from, to: ZERO_ADDRESS, value: amount, @@ -291,9 +291,9 @@ function shouldInternalMintTokens (operator, to, amount, data, operatorData) { const initialTotalSupply = await this.token.totalSupply(); const initialToBalance = await this.token.balanceOf(to); - const { logs } = await this.token.mintInternal(to, amount, data, operatorData, { from: operator }); + const receipt = await this.token.mintInternal(to, amount, data, operatorData, { from: operator }); - expectEvent.inLogs(logs, 'Minted', { + expectEvent(receipt, 'Minted', { operator, to, amount, @@ -301,7 +301,7 @@ function shouldInternalMintTokens (operator, to, amount, data, operatorData) { operatorData, }); - expectEvent.inLogs(logs, 'Transfer', { + expectEvent(receipt, 'Transfer', { from: ZERO_ADDRESS, to, value: amount, diff --git a/test/token/ERC777/ERC777.test.js b/test/token/ERC777/ERC777.test.js index 40b840c7d..51da130d4 100644 --- a/test/token/ERC777/ERC777.test.js +++ b/test/token/ERC777/ERC777.test.js @@ -320,8 +320,8 @@ contract('ERC777', function (accounts) { it('non-operators can be revoked', async function () { expect(await this.token.isOperatorFor(newOperator, holder)).to.equal(false); - const { logs } = await this.token.revokeOperator(newOperator, { from: holder }); - expectEvent.inLogs(logs, 'RevokedOperator', { operator: newOperator, tokenHolder: holder }); + const receipt = await this.token.revokeOperator(newOperator, { from: holder }); + expectEvent(receipt, 'RevokedOperator', { operator: newOperator, tokenHolder: holder }); expect(await this.token.isOperatorFor(newOperator, holder)).to.equal(false); }); @@ -329,8 +329,8 @@ contract('ERC777', function (accounts) { it('non-operators can be authorized', async function () { expect(await this.token.isOperatorFor(newOperator, holder)).to.equal(false); - const { logs } = await this.token.authorizeOperator(newOperator, { from: holder }); - expectEvent.inLogs(logs, 'AuthorizedOperator', { operator: newOperator, tokenHolder: holder }); + const receipt = await this.token.authorizeOperator(newOperator, { from: holder }); + expectEvent(receipt, 'AuthorizedOperator', { operator: newOperator, tokenHolder: holder }); expect(await this.token.isOperatorFor(newOperator, holder)).to.equal(true); }); @@ -345,15 +345,15 @@ contract('ERC777', function (accounts) { }); it('can be re-authorized', async function () { - const { logs } = await this.token.authorizeOperator(newOperator, { from: holder }); - expectEvent.inLogs(logs, 'AuthorizedOperator', { operator: newOperator, tokenHolder: holder }); + const receipt = await this.token.authorizeOperator(newOperator, { from: holder }); + expectEvent(receipt, 'AuthorizedOperator', { operator: newOperator, tokenHolder: holder }); expect(await this.token.isOperatorFor(newOperator, holder)).to.equal(true); }); it('can be revoked', async function () { - const { logs } = await this.token.revokeOperator(newOperator, { from: holder }); - expectEvent.inLogs(logs, 'RevokedOperator', { operator: newOperator, tokenHolder: holder }); + const receipt = await this.token.revokeOperator(newOperator, { from: holder }); + expectEvent(receipt, 'RevokedOperator', { operator: newOperator, tokenHolder: holder }); expect(await this.token.isOperatorFor(newOperator, holder)).to.equal(false); }); @@ -361,15 +361,15 @@ contract('ERC777', function (accounts) { describe('default operators', function () { it('can be re-authorized', async function () { - const { logs } = await this.token.authorizeOperator(defaultOperatorA, { from: holder }); - expectEvent.inLogs(logs, 'AuthorizedOperator', { operator: defaultOperatorA, tokenHolder: holder }); + const receipt = await this.token.authorizeOperator(defaultOperatorA, { from: holder }); + expectEvent(receipt, 'AuthorizedOperator', { operator: defaultOperatorA, tokenHolder: holder }); expect(await this.token.isOperatorFor(defaultOperatorA, holder)).to.equal(true); }); it('can be revoked', async function () { - const { logs } = await this.token.revokeOperator(defaultOperatorA, { from: holder }); - expectEvent.inLogs(logs, 'RevokedOperator', { operator: defaultOperatorA, tokenHolder: holder }); + const receipt = await this.token.revokeOperator(defaultOperatorA, { from: holder }); + expectEvent(receipt, 'RevokedOperator', { operator: defaultOperatorA, tokenHolder: holder }); expect(await this.token.isOperatorFor(defaultOperatorA, holder)).to.equal(false); }); @@ -399,8 +399,8 @@ contract('ERC777', function (accounts) { }); it('revoked default operator can be re-authorized', async function () { - const { logs } = await this.token.authorizeOperator(defaultOperatorA, { from: holder }); - expectEvent.inLogs(logs, 'AuthorizedOperator', { operator: defaultOperatorA, tokenHolder: holder }); + const receipt = await this.token.authorizeOperator(defaultOperatorA, { from: holder }); + expectEvent(receipt, 'AuthorizedOperator', { operator: defaultOperatorA, tokenHolder: holder }); expect(await this.token.isOperatorFor(defaultOperatorA, holder)).to.equal(true); }); diff --git a/test/utils/Context.behavior.js b/test/utils/Context.behavior.js index 0f60945a1..8728e1021 100644 --- a/test/utils/Context.behavior.js +++ b/test/utils/Context.behavior.js @@ -5,8 +5,8 @@ const ContextMock = artifacts.require('ContextMock'); function shouldBehaveLikeRegularContext (sender) { describe('msgSender', function () { it('returns the transaction sender when called from an EOA', async function () { - const { logs } = await this.context.msgSender({ from: sender }); - expectEvent.inLogs(logs, 'Sender', { sender }); + const receipt = await this.context.msgSender({ from: sender }); + expectEvent(receipt, 'Sender', { sender }); }); it('returns the transaction sender when from another contract', async function () { @@ -26,8 +26,8 @@ function shouldBehaveLikeRegularContext (sender) { }); it('returns the transaction data when called from an EOA', async function () { - const { logs } = await this.context.msgData(integerValue, stringValue); - expectEvent.inLogs(logs, 'Data', { data: callData, integerValue, stringValue }); + const receipt = await this.context.msgData(integerValue, stringValue); + expectEvent(receipt, 'Data', { data: callData, integerValue, stringValue }); }); it('returns the transaction sender when from another contract', async function () { diff --git a/test/utils/escrow/Escrow.behavior.js b/test/utils/escrow/Escrow.behavior.js index b6d3a69c2..ab5905994 100644 --- a/test/utils/escrow/Escrow.behavior.js +++ b/test/utils/escrow/Escrow.behavior.js @@ -26,8 +26,8 @@ function shouldBehaveLikeEscrow (owner, [payee1, payee2]) { }); it('emits a deposited event', async function () { - const { logs } = await this.escrow.deposit(payee1, { from: owner, value: amount }); - expectEvent.inLogs(logs, 'Deposited', { + const receipt = await this.escrow.deposit(payee1, { from: owner, value: amount }); + expectEvent(receipt, 'Deposited', { payee: payee1, weiAmount: amount, }); @@ -79,8 +79,8 @@ function shouldBehaveLikeEscrow (owner, [payee1, payee2]) { it('emits a withdrawn event', async function () { await this.escrow.deposit(payee1, { from: owner, value: amount }); - const { logs } = await this.escrow.withdraw(payee1, { from: owner }); - expectEvent.inLogs(logs, 'Withdrawn', { + const receipt = await this.escrow.withdraw(payee1, { from: owner }); + expectEvent(receipt, 'Withdrawn', { payee: payee1, weiAmount: amount, }); diff --git a/test/utils/escrow/RefundEscrow.test.js b/test/utils/escrow/RefundEscrow.test.js index 3ef28c684..26c19b366 100644 --- a/test/utils/escrow/RefundEscrow.test.js +++ b/test/utils/escrow/RefundEscrow.test.js @@ -54,8 +54,8 @@ contract('RefundEscrow', function (accounts) { 'Ownable: caller is not the owner', ); - const { logs } = await this.escrow.close({ from: owner }); - expectEvent.inLogs(logs, 'RefundsClosed'); + const receipt = await this.escrow.close({ from: owner }); + expectEvent(receipt, 'RefundsClosed'); }); context('closed state', function () { @@ -101,8 +101,8 @@ contract('RefundEscrow', function (accounts) { 'Ownable: caller is not the owner', ); - const { logs } = await this.escrow.enableRefunds({ from: owner }); - expectEvent.inLogs(logs, 'RefundsEnabled'); + const receipt = await this.escrow.enableRefunds({ from: owner }); + expectEvent(receipt, 'RefundsEnabled'); }); context('refund state', function () { From c12076fb7e3dfe48ef1d9c3bb2a58bdd3ffc0cee Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Sat, 23 Apr 2022 10:35:04 -0400 Subject: [PATCH 51/81] Fix ERC777 link (#3351) --- contracts/token/ERC777/README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/ERC777/README.adoc b/contracts/token/ERC777/README.adoc index d8f25f060..5012a3110 100644 --- a/contracts/token/ERC777/README.adoc +++ b/contracts/token/ERC777/README.adoc @@ -3,7 +3,7 @@ [.readme-notice] NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/token/erc777 -This set of interfaces and contracts are all related to the [ERC777 token standard](https://eips.ethereum.org/EIPS/eip-777). +This set of interfaces and contracts are all related to the https://eips.ethereum.org/EIPS/eip-777[ERC777 token standard]. TIP: For an overview of ERC777 tokens and a walk through on how to create a token contract read our xref:ROOT:erc777.adoc[ERC777 guide]. From 85627ffa91606b58b8b5ac104d7f1e8ca7ba1d79 Mon Sep 17 00:00:00 2001 From: Igor Igamberdiev Date: Tue, 26 Apr 2022 12:34:51 +0300 Subject: [PATCH 52/81] Update links in docs (#3356) * Update links in Access Control section * Update Tally url * Update web3 url to the freshest version --- docs/modules/ROOT/pages/access-control.adoc | 2 +- docs/modules/ROOT/pages/governance.adoc | 2 +- docs/modules/ROOT/pages/utilities.adoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/access-control.adoc b/docs/modules/ROOT/pages/access-control.adoc index 822bb84b1..ea6eebc2a 100644 --- a/docs/modules/ROOT/pages/access-control.adoc +++ b/docs/modules/ROOT/pages/access-control.adoc @@ -37,7 +37,7 @@ Ownable also lets you: WARNING: Removing the owner altogether will mean that administrative tasks that are protected by `onlyOwner` will no longer be callable! -Note that *a contract can also be the owner of another one*! This opens the door to using, for example, a https://github.com/gnosis/MultiSigWallet[Gnosis Multisig] or https://safe.gnosis.io[Gnosis Safe], an https://aragon.org[Aragon DAO], an https://www.uport.me[ERC725/uPort] identity contract, or a totally custom contract that _you_ create. +Note that *a contract can also be the owner of another one*! This opens the door to using, for example, a https://gnosis-safe.io[Gnosis Safe], an https://aragon.org[Aragon DAO], or a totally custom contract that _you_ create. In this way you can use _composability_ to add additional layers of access control complexity to your contracts. Instead of having a single regular Ethereum account (Externally Owned Account, or EOA) as the owner, you could use a 2-of-3 multisig run by your project leads, for example. Prominent projects in the space, such as https://makerdao.com[MakerDAO], use systems similar to this one. diff --git a/docs/modules/ROOT/pages/governance.adoc b/docs/modules/ROOT/pages/governance.adoc index b87f91692..3dca902a1 100644 --- a/docs/modules/ROOT/pages/governance.adoc +++ b/docs/modules/ROOT/pages/governance.adoc @@ -28,7 +28,7 @@ When using a timelock with your Governor contract, you can use either OpenZeppel === Tally -https://www.withtally.com[Tally] is a full-fledged application for user owned on-chain governance. It comprises a voting dashboard, proposal creation wizard, real time research and analysis, and educational content. +https://www.tally.xyz[Tally] is a full-fledged application for user owned on-chain governance. It comprises a voting dashboard, proposal creation wizard, real time research and analysis, and educational content. For all of these options, the Governor will be compatible with Tally: users will be able to create proposals, visualize voting power and advocates, navigate proposals, and cast votes. For proposal creation in particular, projects can also use Defender Admin as an alternative interface. diff --git a/docs/modules/ROOT/pages/utilities.adoc b/docs/modules/ROOT/pages/utilities.adoc index 2f23ceb70..81839c16b 100644 --- a/docs/modules/ROOT/pages/utilities.adoc +++ b/docs/modules/ROOT/pages/utilities.adoc @@ -7,7 +7,7 @@ The OpenZeppelin Contracts provide a ton of useful utilities that you can use in === Checking Signatures On-Chain -xref:api:cryptography.adoc#ECDSA[`ECDSA`] provides functions for recovering and managing Ethereum account ECDSA signatures. These are often generated via https://web3js.readthedocs.io/en/v1.2.4/web3-eth.html#sign[`web3.eth.sign`], and are a 65 byte array (of type `bytes` in Solidity) arranged the following way: `[[v (1)], [r (32)], [s (32)]]`. +xref:api:cryptography.adoc#ECDSA[`ECDSA`] provides functions for recovering and managing Ethereum account ECDSA signatures. These are often generated via https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#sign[`web3.eth.sign`], and are a 65 byte array (of type `bytes` in Solidity) arranged the following way: `[[v (1)], [r (32)], [s (32)]]`. The data signer can be recovered with xref:api:cryptography.adoc#ECDSA-recover-bytes32-bytes-[`ECDSA.recover`], and its address compared to verify the signature. Most wallets will hash the data to sign and add the prefix '\x19Ethereum Signed Message:\n', so when attempting to recover the signer of an Ethereum signed message hash, you'll want to use xref:api:cryptography.adoc#ECDSA-toEthSignedMessageHash-bytes32-[`toEthSignedMessageHash`]. From 848fef5b6c39333a2f9f1fb352cca7c188c3754b Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 26 Apr 2022 18:48:34 +0200 Subject: [PATCH 53/81] Fix update-comment script to ignore invalid tags --- scripts/release/update-comment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/release/update-comment.js b/scripts/release/update-comment.js index b3dd9efe5..0767234a8 100755 --- a/scripts/release/update-comment.js +++ b/scripts/release/update-comment.js @@ -15,6 +15,7 @@ const { version } = require('../../package.json'); // Get latest tag according to semver. const [ tag ] = run('git', 'tag') .split(/\r?\n/) + .filter(semver.coerce) // check version can be processed .filter(v => semver.lt(semver.coerce(v), version)) // only consider older tags, ignore current prereleases .sort(semver.rcompare); From a035b235b4f2c9af4ba88edc4447f02e37f8d124 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 27 Apr 2022 09:34:09 +0200 Subject: [PATCH 54/81] Release v4.6 (#3358) * 4.6.0-rc.0 * Fix release script to only release @openzeppelin/contracts (cherry picked from commit 2bd75a44bb5f419d132bdca6f1bf483d1479f550) * make ERC2981:royaltyInfo public (#3305) (cherry picked from commit d2832ca7a9096afa77a7c5b669292c0ca5f3ddb7) Signed-off-by: Hadrien Croubois * add transpilation guards to the crosschain mocks (#3306) (cherry picked from commit 9af5af8fffe9964cd1d20a39f399fea173d18653) Signed-off-by: Hadrien Croubois * Fix tests on upgradeable contracts after transpilation (cherry picked from commit 0762479dd518a23821eeb17c622f1227461441d1) Signed-off-by: Hadrien Croubois * Remove unused constructor argument (cherry picked from commit 69c3781043b9671012c5b19fdea81784a70a5289) Signed-off-by: Hadrien Croubois * Bump minimum Solidity version for Initializable.sol to 0.8.2 (#3328) (cherry picked from commit cb14ea3c5c72151f254ec79866793ddf65f4c727) * Fix update-comment script to ignore invalid tags (cherry picked from commit 848fef5b6c39333a2f9f1fb352cca7c188c3754b) Signed-off-by: Hadrien Croubois * 4.6.0 Co-authored-by: Francisco Giordano --- CHANGELOG.md | 3 ++- contracts/access/AccessControl.sol | 2 +- contracts/access/AccessControlCrossChain.sol | 1 + contracts/crosschain/CrossChainEnabled.sol | 1 + contracts/crosschain/amb/CrossChainEnabledAMB.sol | 1 + contracts/crosschain/amb/LibAMB.sol | 1 + contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol | 1 + contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol | 1 + contracts/crosschain/arbitrum/LibArbitrumL1.sol | 1 + contracts/crosschain/arbitrum/LibArbitrumL2.sol | 1 + contracts/crosschain/errors.sol | 1 + contracts/crosschain/optimism/CrossChainEnabledOptimism.sol | 1 + contracts/crosschain/optimism/LibOptimism.sol | 1 + .../crosschain/polygon/CrossChainEnabledPolygonChild.sol | 1 + contracts/finance/VestingWallet.sol | 2 +- contracts/governance/Governor.sol | 2 +- contracts/governance/IGovernor.sol | 2 +- contracts/governance/TimelockController.sol | 2 +- .../governance/compatibility/GovernorCompatibilityBravo.sol | 2 +- contracts/governance/extensions/GovernorCountingSimple.sol | 2 +- contracts/governance/extensions/GovernorPreventLateQuorum.sol | 2 +- contracts/governance/extensions/GovernorTimelockCompound.sol | 2 +- contracts/governance/extensions/GovernorTimelockControl.sol | 2 +- contracts/governance/extensions/GovernorVotes.sol | 2 +- contracts/governance/extensions/GovernorVotesComp.sol | 2 +- contracts/governance/utils/Votes.sol | 2 +- contracts/interfaces/IERC2981.sol | 2 +- contracts/package.json | 2 +- contracts/proxy/Proxy.sol | 2 +- contracts/proxy/utils/Initializable.sol | 2 +- contracts/token/ERC1155/ERC1155.sol | 2 +- contracts/token/ERC1155/extensions/ERC1155Supply.sol | 2 +- contracts/token/ERC1155/extensions/ERC1155URIStorage.sol | 1 + contracts/token/ERC20/ERC20.sol | 2 +- contracts/token/ERC20/IERC20.sol | 2 +- contracts/token/ERC20/extensions/ERC20FlashMint.sol | 2 +- contracts/token/ERC20/extensions/ERC20Snapshot.sol | 2 +- contracts/token/ERC20/extensions/ERC20Wrapper.sol | 2 +- contracts/token/ERC20/extensions/draft-ERC20Permit.sol | 2 +- contracts/token/ERC721/ERC721.sol | 2 +- contracts/token/ERC721/IERC721.sol | 2 +- contracts/token/ERC721/IERC721Receiver.sol | 2 +- contracts/token/ERC721/extensions/draft-ERC721Votes.sol | 2 +- contracts/token/ERC777/ERC777.sol | 2 +- contracts/token/ERC777/IERC777.sol | 2 +- contracts/token/common/ERC2981.sol | 2 +- contracts/utils/cryptography/MerkleProof.sol | 2 +- contracts/utils/introspection/IERC1820Registry.sol | 2 +- contracts/utils/math/SafeMath.sol | 2 +- contracts/utils/structs/DoubleEndedQueue.sol | 1 + contracts/utils/structs/EnumerableMap.sol | 2 +- contracts/utils/structs/EnumerableSet.sol | 2 +- contracts/vendor/amb/IAMB.sol | 1 + contracts/vendor/arbitrum/IArbSys.sol | 1 + contracts/vendor/arbitrum/IBridge.sol | 1 + contracts/vendor/arbitrum/IInbox.sol | 1 + contracts/vendor/arbitrum/IMessageProvider.sol | 1 + contracts/vendor/arbitrum/IOutbox.sol | 1 + contracts/vendor/compound/ICompoundTimelock.sol | 1 + contracts/vendor/optimism/ICrossDomainMessenger.sol | 1 + contracts/vendor/polygon/IFxMessageProcessor.sol | 1 + package-lock.json | 4 ++-- package.json | 2 +- 63 files changed, 65 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 571d361c9..f026dea95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ * `Clones`: optimize clone creation ([#3329](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3329)) * `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317)) -## Unreleased +## 4.6.0 (2022-04-26) * `crosschain`: Add a new set of contracts for cross-chain applications. `CrossChainEnabled` is a base contract with instantiations for several chains and bridges, and `AccessControlCrossChain` is an extension of access control that allows cross-chain operation. ([#3183](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3183)) * `AccessControl`: add a virtual `_checkRole(bytes32)` function that can be overridden to alter the `onlyRole` modifier behavior. ([#3137](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3137)) @@ -26,6 +26,7 @@ * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) * `Initializable`: add a reinitializer modifier that enables the initialization of new modules, added to already initialized contracts through upgradeability. ([#3232](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3232)) * `Initializable`: add an Initialized event that tracks initialized version numbers. ([#3294](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3294)) + * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) ### Breaking changes diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 2ac203867..8274bb55c 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol) pragma solidity ^0.8.0; diff --git a/contracts/access/AccessControlCrossChain.sol b/contracts/access/AccessControlCrossChain.sol index 21e425150..95be5091c 100644 --- a/contracts/access/AccessControlCrossChain.sol +++ b/contracts/access/AccessControlCrossChain.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControlCrossChain.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/CrossChainEnabled.sol b/contracts/crosschain/CrossChainEnabled.sol index cd30a679a..4c9b9e5c5 100644 --- a/contracts/crosschain/CrossChainEnabled.sol +++ b/contracts/crosschain/CrossChainEnabled.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/CrossChainEnabled.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/amb/CrossChainEnabledAMB.sol b/contracts/crosschain/amb/CrossChainEnabledAMB.sol index 445f04780..a52887659 100644 --- a/contracts/crosschain/amb/CrossChainEnabledAMB.sol +++ b/contracts/crosschain/amb/CrossChainEnabledAMB.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/amb/CrossChainEnabledAMB.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/amb/LibAMB.sol b/contracts/crosschain/amb/LibAMB.sol index 74ee922bf..bd1f4907f 100644 --- a/contracts/crosschain/amb/LibAMB.sol +++ b/contracts/crosschain/amb/LibAMB.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/amb/LibAMB.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol index 69c5abd56..6f15c5945 100644 --- a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol +++ b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol index 061862efd..48c4f797a 100644 --- a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol +++ b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/arbitrum/LibArbitrumL1.sol b/contracts/crosschain/arbitrum/LibArbitrumL1.sol index 55c9a50d4..586888c8b 100644 --- a/contracts/crosschain/arbitrum/LibArbitrumL1.sol +++ b/contracts/crosschain/arbitrum/LibArbitrumL1.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/arbitrum/LibArbitrumL1.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/arbitrum/LibArbitrumL2.sol b/contracts/crosschain/arbitrum/LibArbitrumL2.sol index c8a6f541a..54fdb06ff 100644 --- a/contracts/crosschain/arbitrum/LibArbitrumL2.sol +++ b/contracts/crosschain/arbitrum/LibArbitrumL2.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/arbitrum/LibArbitrumL2.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/errors.sol b/contracts/crosschain/errors.sol index fcc947784..004460e97 100644 --- a/contracts/crosschain/errors.sol +++ b/contracts/crosschain/errors.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/errors.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol b/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol index fe3564cbf..453357cf5 100644 --- a/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol +++ b/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/optimism/CrossChainEnabledOptimism.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/optimism/LibOptimism.sol b/contracts/crosschain/optimism/LibOptimism.sol index 3dfc5daf4..f84fd126f 100644 --- a/contracts/crosschain/optimism/LibOptimism.sol +++ b/contracts/crosschain/optimism/LibOptimism.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/optimism/LibOptimism.sol) pragma solidity ^0.8.4; diff --git a/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol b/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol index e7555a3c8..868bd2310 100644 --- a/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol +++ b/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (crosschain/polygon/CrossChainEnabledPolygonChild.sol) pragma solidity ^0.8.4; diff --git a/contracts/finance/VestingWallet.sol b/contracts/finance/VestingWallet.sol index 486ad3789..0e49ab8d3 100644 --- a/contracts/finance/VestingWallet.sol +++ b/contracts/finance/VestingWallet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (finance/VestingWallet.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (finance/VestingWallet.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20.sol"; diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index a18b98577..239b7fb7c 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (governance/Governor.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/Governor.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/IGovernor.sol b/contracts/governance/IGovernor.sol index 6959825b8..47a831690 100644 --- a/contracts/governance/IGovernor.sol +++ b/contracts/governance/IGovernor.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (governance/IGovernor.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/IGovernor.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index cef21d6cd..b293cd163 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (governance/TimelockController.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/TimelockController.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/compatibility/GovernorCompatibilityBravo.sol b/contracts/governance/compatibility/GovernorCompatibilityBravo.sol index 1d639f436..510ff548d 100644 --- a/contracts/governance/compatibility/GovernorCompatibilityBravo.sol +++ b/contracts/governance/compatibility/GovernorCompatibilityBravo.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (governance/compatibility/GovernorCompatibilityBravo.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/compatibility/GovernorCompatibilityBravo.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/extensions/GovernorCountingSimple.sol b/contracts/governance/extensions/GovernorCountingSimple.sol index a262ce4d8..ce28aa3b0 100644 --- a/contracts/governance/extensions/GovernorCountingSimple.sol +++ b/contracts/governance/extensions/GovernorCountingSimple.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorCountingSimple.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorCountingSimple.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/extensions/GovernorPreventLateQuorum.sol b/contracts/governance/extensions/GovernorPreventLateQuorum.sol index 5b58f6032..a26bbf059 100644 --- a/contracts/governance/extensions/GovernorPreventLateQuorum.sol +++ b/contracts/governance/extensions/GovernorPreventLateQuorum.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorPreventLateQuorum.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorPreventLateQuorum.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/extensions/GovernorTimelockCompound.sol b/contracts/governance/extensions/GovernorTimelockCompound.sol index b6421b895..2fa539ead 100644 --- a/contracts/governance/extensions/GovernorTimelockCompound.sol +++ b/contracts/governance/extensions/GovernorTimelockCompound.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorTimelockCompound.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorTimelockCompound.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/extensions/GovernorTimelockControl.sol b/contracts/governance/extensions/GovernorTimelockControl.sol index 8ab992f2e..aaeaf9409 100644 --- a/contracts/governance/extensions/GovernorTimelockControl.sol +++ b/contracts/governance/extensions/GovernorTimelockControl.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorTimelockControl.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorTimelockControl.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/extensions/GovernorVotes.sol b/contracts/governance/extensions/GovernorVotes.sol index f0a2276fb..b328c25d1 100644 --- a/contracts/governance/extensions/GovernorVotes.sol +++ b/contracts/governance/extensions/GovernorVotes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorVotes.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorVotes.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/extensions/GovernorVotesComp.sol b/contracts/governance/extensions/GovernorVotesComp.sol index c31c9583b..8c4a1f8c1 100644 --- a/contracts/governance/extensions/GovernorVotesComp.sol +++ b/contracts/governance/extensions/GovernorVotesComp.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorVotesComp.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorVotesComp.sol) pragma solidity ^0.8.0; diff --git a/contracts/governance/utils/Votes.sol b/contracts/governance/utils/Votes.sol index 202c3f2cf..52d2c0e19 100644 --- a/contracts/governance/utils/Votes.sol +++ b/contracts/governance/utils/Votes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (governance/utils/Votes.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (governance/utils/Votes.sol) pragma solidity ^0.8.0; import "../../utils/Context.sol"; diff --git a/contracts/interfaces/IERC2981.sol b/contracts/interfaces/IERC2981.sol index 063582401..6b0558169 100644 --- a/contracts/interfaces/IERC2981.sol +++ b/contracts/interfaces/IERC2981.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; diff --git a/contracts/package.json b/contracts/package.json index 6f4fcf35a..0b9c1a13d 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,7 +1,7 @@ { "name": "@openzeppelin/contracts", "description": "Secure Smart Contract library for Solidity", - "version": "4.5.0", + "version": "4.6.0", "files": [ "**/*.sol", "/build/contracts/*.json", diff --git a/contracts/proxy/Proxy.sol b/contracts/proxy/Proxy.sol index 6a358fa47..988cf72a0 100644 --- a/contracts/proxy/Proxy.sol +++ b/contracts/proxy/Proxy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol) pragma solidity ^0.8.0; diff --git a/contracts/proxy/utils/Initializable.sol b/contracts/proxy/utils/Initializable.sol index 302653960..fc9461d86 100644 --- a/contracts/proxy/utils/Initializable.sol +++ b/contracts/proxy/utils/Initializable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index d14d26955..ba7eb99cc 100644 --- a/contracts/token/ERC1155/ERC1155.sol +++ b/contracts/token/ERC1155/ERC1155.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC1155/extensions/ERC1155Supply.sol b/contracts/token/ERC1155/extensions/ERC1155Supply.sol index 5caa52726..ec24389a1 100644 --- a/contracts/token/ERC1155/extensions/ERC1155Supply.sol +++ b/contracts/token/ERC1155/extensions/ERC1155Supply.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Supply.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol b/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol index 42ecce7fd..623504f3d 100644 --- a/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol +++ b/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155URIStorage.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index dc963af88..2073a3aa8 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC20/IERC20.sol b/contracts/token/ERC20/IERC20.sol index f0ede8a4d..b816bfed0 100644 --- a/contracts/token/ERC20/IERC20.sol +++ b/contracts/token/ERC20/IERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC20/extensions/ERC20FlashMint.sol b/contracts/token/ERC20/extensions/ERC20FlashMint.sol index 3d526c2d7..dd124fb46 100644 --- a/contracts/token/ERC20/extensions/ERC20FlashMint.sol +++ b/contracts/token/ERC20/extensions/ERC20FlashMint.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20FlashMint.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/extensions/ERC20FlashMint.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC20/extensions/ERC20Snapshot.sol b/contracts/token/ERC20/extensions/ERC20Snapshot.sol index 6f59666ac..d5acaa2f0 100644 --- a/contracts/token/ERC20/extensions/ERC20Snapshot.sol +++ b/contracts/token/ERC20/extensions/ERC20Snapshot.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/ERC20Snapshot.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/extensions/ERC20Snapshot.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC20/extensions/ERC20Wrapper.sol b/contracts/token/ERC20/extensions/ERC20Wrapper.sol index c6dd0184a..8b153ffca 100644 --- a/contracts/token/ERC20/extensions/ERC20Wrapper.sol +++ b/contracts/token/ERC20/extensions/ERC20Wrapper.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/ERC20Wrapper.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/extensions/ERC20Wrapper.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC20/extensions/draft-ERC20Permit.sol b/contracts/token/ERC20/extensions/draft-ERC20Permit.sol index 55172f6e3..63aeb5273 100644 --- a/contracts/token/ERC20/extensions/draft-ERC20Permit.sol +++ b/contracts/token/ERC20/extensions/draft-ERC20Permit.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-ERC20Permit.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/extensions/draft-ERC20Permit.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index b6855f531..27af09ece 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC721/IERC721.sol b/contracts/token/ERC721/IERC721.sol index 9a313867d..2caeabf3a 100644 --- a/contracts/token/ERC721/IERC721.sol +++ b/contracts/token/ERC721/IERC721.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC721/IERC721Receiver.sol b/contracts/token/ERC721/IERC721Receiver.sol index 298e3565f..de672099e 100644 --- a/contracts/token/ERC721/IERC721Receiver.sol +++ b/contracts/token/ERC721/IERC721Receiver.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC721/extensions/draft-ERC721Votes.sol b/contracts/token/ERC721/extensions/draft-ERC721Votes.sol index 4d9d0adba..b4ec91eab 100644 --- a/contracts/token/ERC721/extensions/draft-ERC721Votes.sol +++ b/contracts/token/ERC721/extensions/draft-ERC721Votes.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/draft-ERC721Votes.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/extensions/draft-ERC721Votes.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC777/ERC777.sol b/contracts/token/ERC777/ERC777.sol index e459d041d..348efb983 100644 --- a/contracts/token/ERC777/ERC777.sol +++ b/contracts/token/ERC777/ERC777.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC777/ERC777.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC777/ERC777.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/ERC777/IERC777.sol b/contracts/token/ERC777/IERC777.sol index 71bbf1ac2..dbeab533b 100644 --- a/contracts/token/ERC777/IERC777.sol +++ b/contracts/token/ERC777/IERC777.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (token/ERC777/IERC777.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC777/IERC777.sol) pragma solidity ^0.8.0; diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index b8b0b6333..40e2385bf 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (token/common/ERC2981.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; diff --git a/contracts/utils/cryptography/MerkleProof.sol b/contracts/utils/cryptography/MerkleProof.sol index 03244f488..db7d5894a 100644 --- a/contracts/utils/cryptography/MerkleProof.sol +++ b/contracts/utils/cryptography/MerkleProof.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; diff --git a/contracts/utils/introspection/IERC1820Registry.sol b/contracts/utils/introspection/IERC1820Registry.sol index 5d688d432..dcc346ebc 100644 --- a/contracts/utils/introspection/IERC1820Registry.sol +++ b/contracts/utils/introspection/IERC1820Registry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC1820Registry.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (utils/introspection/IERC1820Registry.sol) pragma solidity ^0.8.0; diff --git a/contracts/utils/math/SafeMath.sol b/contracts/utils/math/SafeMath.sol index 1e97d7602..550f0e779 100644 --- a/contracts/utils/math/SafeMath.sol +++ b/contracts/utils/math/SafeMath.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; diff --git a/contracts/utils/structs/DoubleEndedQueue.sol b/contracts/utils/structs/DoubleEndedQueue.sol index d1d968ef6..eae79ada7 100644 --- a/contracts/utils/structs/DoubleEndedQueue.sol +++ b/contracts/utils/structs/DoubleEndedQueue.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/DoubleEndedQueue.sol) pragma solidity ^0.8.4; import "../math/SafeCast.sol"; diff --git a/contracts/utils/structs/EnumerableMap.sol b/contracts/utils/structs/EnumerableMap.sol index 8717c6978..f9f239a3d 100644 --- a/contracts/utils/structs/EnumerableMap.sol +++ b/contracts/utils/structs/EnumerableMap.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableMap.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableMap.sol) pragma solidity ^0.8.0; diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index bd34a4bd3..a6963ef4e 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol) +// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; diff --git a/contracts/vendor/amb/IAMB.sol b/contracts/vendor/amb/IAMB.sol index 529913f7b..1a5d7080f 100644 --- a/contracts/vendor/amb/IAMB.sol +++ b/contracts/vendor/amb/IAMB.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/amb/IAMB.sol) pragma solidity ^0.8.0; interface IAMB { diff --git a/contracts/vendor/arbitrum/IArbSys.sol b/contracts/vendor/arbitrum/IArbSys.sol index 3658e4660..15a10451a 100644 --- a/contracts/vendor/arbitrum/IArbSys.sol +++ b/contracts/vendor/arbitrum/IArbSys.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/arbitrum/IArbSys.sol) pragma solidity >=0.4.21 <0.9.0; /** diff --git a/contracts/vendor/arbitrum/IBridge.sol b/contracts/vendor/arbitrum/IBridge.sol index 631fce68f..88d5013b1 100644 --- a/contracts/vendor/arbitrum/IBridge.sol +++ b/contracts/vendor/arbitrum/IBridge.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/arbitrum/IBridge.sol) /* * Copyright 2021, Offchain Labs, Inc. diff --git a/contracts/vendor/arbitrum/IInbox.sol b/contracts/vendor/arbitrum/IInbox.sol index 462e24738..75f93ed86 100644 --- a/contracts/vendor/arbitrum/IInbox.sol +++ b/contracts/vendor/arbitrum/IInbox.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/arbitrum/IInbox.sol) /* * Copyright 2021, Offchain Labs, Inc. diff --git a/contracts/vendor/arbitrum/IMessageProvider.sol b/contracts/vendor/arbitrum/IMessageProvider.sol index 76208e215..88d9ba4fc 100644 --- a/contracts/vendor/arbitrum/IMessageProvider.sol +++ b/contracts/vendor/arbitrum/IMessageProvider.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/arbitrum/IMessageProvider.sol) /* * Copyright 2021, Offchain Labs, Inc. diff --git a/contracts/vendor/arbitrum/IOutbox.sol b/contracts/vendor/arbitrum/IOutbox.sol index 9128a2049..95c10800b 100644 --- a/contracts/vendor/arbitrum/IOutbox.sol +++ b/contracts/vendor/arbitrum/IOutbox.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/arbitrum/IOutbox.sol) /* * Copyright 2021, Offchain Labs, Inc. diff --git a/contracts/vendor/compound/ICompoundTimelock.sol b/contracts/vendor/compound/ICompoundTimelock.sol index 1581a8daa..fb33a6805 100644 --- a/contracts/vendor/compound/ICompoundTimelock.sol +++ b/contracts/vendor/compound/ICompoundTimelock.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/compound/ICompoundTimelock.sol) pragma solidity ^0.8.0; diff --git a/contracts/vendor/optimism/ICrossDomainMessenger.sol b/contracts/vendor/optimism/ICrossDomainMessenger.sol index be09e857d..9cc797701 100644 --- a/contracts/vendor/optimism/ICrossDomainMessenger.sol +++ b/contracts/vendor/optimism/ICrossDomainMessenger.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/optimism/ICrossDomainMessenger.sol) pragma solidity >0.5.0 <0.9.0; /** diff --git a/contracts/vendor/polygon/IFxMessageProcessor.sol b/contracts/vendor/polygon/IFxMessageProcessor.sol index cf346bc6b..9f42eb647 100644 --- a/contracts/vendor/polygon/IFxMessageProcessor.sol +++ b/contracts/vendor/polygon/IFxMessageProcessor.sol @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.6.0) (vendor/polygon/IFxMessageProcessor.sol) pragma solidity ^0.8.0; interface IFxMessageProcessor { diff --git a/package-lock.json b/package-lock.json index 79972dda3..9cf7cda87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openzeppelin-solidity", - "version": "4.5.0", + "version": "4.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "openzeppelin-solidity", - "version": "4.5.0", + "version": "4.6.0", "license": "MIT", "bin": { "openzeppelin-contracts-migrate-imports": "scripts/migrate-imports.js" diff --git a/package.json b/package.json index 750e7eafc..8f2f10c87 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "openzeppelin-solidity", "description": "Secure Smart Contract library for Solidity", - "version": "4.5.0", + "version": "4.6.0", "files": [ "/contracts/**/*.sol", "/build/contracts/*.json", From fcf35e5722847f5eadaaee052968a8a54d03622a Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 27 Apr 2022 09:40:13 +0200 Subject: [PATCH 55/81] Fix changelog merge issue (#3364) --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f026dea95..7288d1145 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog ## Unreleased - * `ERC2981`: make `royaltyInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) + * `Clones`: optimize clone creation ([#3329](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3329)) * `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317)) @@ -26,7 +26,7 @@ * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165)) * `Initializable`: add a reinitializer modifier that enables the initialization of new modules, added to already initialized contracts through upgradeability. ([#3232](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3232)) * `Initializable`: add an Initialized event that tracks initialized version numbers. ([#3294](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3294)) - * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) + * `ERC2981`: make `royaltyInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) ### Breaking changes From be3cfa0f9068a1495dc524975209f223da20e148 Mon Sep 17 00:00:00 2001 From: Pascal Marco Caversaccio Date: Fri, 29 Apr 2022 16:14:18 +0200 Subject: [PATCH 56/81] Add custom error to `CrossChainEnabledPolygonChild` (#3380) --- CHANGELOG.md | 1 + .../crosschain/polygon/CrossChainEnabledPolygonChild.sol | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7288d1145..263f869ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * `Clones`: optimize clone creation ([#3329](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3329)) * `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317)) + * `CrossChainEnabledPolygonChild`: replace the `require` statement with the custom error `NotCrossChainCall`. ([#3380](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3380)) ## 4.6.0 (2022-04-26) diff --git a/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol b/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol index 868bd2310..15da83501 100644 --- a/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol +++ b/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol @@ -63,10 +63,10 @@ abstract contract CrossChainEnabledPolygonChild is IFxMessageProcessor, CrossCha address rootMessageSender, bytes calldata data ) external override nonReentrant { - require(msg.sender == _fxChild, "unauthorized cross-chain relay"); + if (!_isCrossChain()) revert NotCrossChainCall(); _sender = rootMessageSender; - Address.functionDelegateCall(address(this), data, "crosschain execution failled"); + Address.functionDelegateCall(address(this), data, "cross-chain execution failed"); _sender = DEFAULT_SENDER; } } From 1d2ab4f41c90219020b2ed80bc9332e440f499e0 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 2 May 2022 18:05:40 -0300 Subject: [PATCH 57/81] Add 4.6 upgradeability notice --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 263f869ff..f978222ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,10 @@ * `Initializable`: add an Initialized event that tracks initialized version numbers. ([#3294](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3294)) * `ERC2981`: make `royaltyInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) +### Upgradeability notice + +* `TimelockController`: **(Action needed)** The upgrade from <4.6 to >=4.6 introduces a new `CANCELLER_ROLE` that requires set up to be assignable. After the upgrade, only addresses with this role will have the ability to cancel. Proposers will no longer be able to cancel. Assigning cancellers can be done by an admin (including the timelock itself) once the role admin is set up. To do this, we recommend upgrading to the `TimelockControllerWith46MigrationUpgradeable` contract and then calling the `migrateTo46` function. + ### Breaking changes * `Governor`: Adds internal virtual `_getVotes` method that must be implemented; this is a breaking change for existing concrete extensions to `Governor`. To fix this on an existing voting module extension, rename `getVotes` to `_getVotes` and add a `bytes memory` argument. ([#3043](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3043)) From 14ca3aeb798d9b9be31df86ae7ef8b8f760caa4c Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 2 May 2022 18:06:52 -0300 Subject: [PATCH 58/81] Fix links in documentation (#3387) --- .../crosschain/amb/CrossChainEnabledAMB.sol | 21 ++++++++++--------- contracts/crosschain/amb/LibAMB.sol | 2 +- .../arbitrum/CrossChainEnabledArbitrumL1.sol | 4 ++-- .../arbitrum/CrossChainEnabledArbitrumL2.sol | 2 +- .../crosschain/arbitrum/LibArbitrumL1.sol | 2 +- .../crosschain/arbitrum/LibArbitrumL2.sol | 2 +- .../optimism/CrossChainEnabledOptimism.sol | 4 ++-- contracts/crosschain/optimism/LibOptimism.sol | 4 ++-- .../polygon/CrossChainEnabledPolygonChild.sol | 4 ++-- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/contracts/crosschain/amb/CrossChainEnabledAMB.sol b/contracts/crosschain/amb/CrossChainEnabledAMB.sol index a52887659..1ff551705 100644 --- a/contracts/crosschain/amb/CrossChainEnabledAMB.sol +++ b/contracts/crosschain/amb/CrossChainEnabledAMB.sol @@ -7,19 +7,20 @@ import "../CrossChainEnabled.sol"; import "./LibAMB.sol"; /** - * @dev [AMB](https://docs.tokenbridge.net/amb-bridge/about-amb-bridge) + * @dev https://docs.tokenbridge.net/amb-bridge/about-amb-bridge[AMB] * specialization or the {CrossChainEnabled} abstraction. * * As of february 2020, AMB bridges are available between the following chains: - * - [ETH <> xDai](https://docs.tokenbridge.net/eth-xdai-amb-bridge/about-the-eth-xdai-amb) - * - [ETH <> qDai](https://docs.tokenbridge.net/eth-qdai-bridge/about-the-eth-qdai-amb) - * - [ETH <> ETC](https://docs.tokenbridge.net/eth-etc-amb-bridge/about-the-eth-etc-amb) - * - [ETH <> BSC](https://docs.tokenbridge.net/eth-bsc-amb/about-the-eth-bsc-amb) - * - [ETH <> POA](https://docs.tokenbridge.net/eth-poa-amb-bridge/about-the-eth-poa-amb) - * - [BSC <> xDai](https://docs.tokenbridge.net/bsc-xdai-amb/about-the-bsc-xdai-amb) - * - [POA <> xDai](https://docs.tokenbridge.net/poa-xdai-amb/about-the-poa-xdai-amb) - * - [Rinkeby <> xDai](https://docs.tokenbridge.net/rinkeby-xdai-amb-bridge/about-the-rinkeby-xdai-amb) - * - [Kovan <> Sokol](https://docs.tokenbridge.net/kovan-sokol-amb-bridge/about-the-kovan-sokol-amb) + * + * - https://docs.tokenbridge.net/eth-xdai-amb-bridge/about-the-eth-xdai-amb[ETH <> xDai] + * - https://docs.tokenbridge.net/eth-qdai-bridge/about-the-eth-qdai-amb[ETH <> qDai] + * - https://docs.tokenbridge.net/eth-etc-amb-bridge/about-the-eth-etc-amb[ETH <> ETC] + * - https://docs.tokenbridge.net/eth-bsc-amb/about-the-eth-bsc-amb[ETH <> BSC] + * - https://docs.tokenbridge.net/eth-poa-amb-bridge/about-the-eth-poa-amb[ETH <> POA] + * - https://docs.tokenbridge.net/bsc-xdai-amb/about-the-bsc-xdai-amb[BSC <> xDai] + * - https://docs.tokenbridge.net/poa-xdai-amb/about-the-poa-xdai-amb[POA <> xDai] + * - https://docs.tokenbridge.net/rinkeby-xdai-amb-bridge/about-the-rinkeby-xdai-amb[Rinkeby <> xDai] + * - https://docs.tokenbridge.net/kovan-sokol-amb-bridge/about-the-kovan-sokol-amb[Kovan <> Sokol] * * _Available since v4.6._ */ diff --git a/contracts/crosschain/amb/LibAMB.sol b/contracts/crosschain/amb/LibAMB.sol index bd1f4907f..83d6005e3 100644 --- a/contracts/crosschain/amb/LibAMB.sol +++ b/contracts/crosschain/amb/LibAMB.sol @@ -8,7 +8,7 @@ import "../errors.sol"; /** * @dev Primitives for cross-chain aware contracts using the - * [AMB](https://docs.tokenbridge.net/amb-bridge/about-amb-bridge) + * https://docs.tokenbridge.net/amb-bridge/about-amb-bridge[AMB] * family of bridges. */ library LibAMB { diff --git a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol index 6f15c5945..88a41d9d1 100644 --- a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol +++ b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol @@ -7,7 +7,7 @@ import "../CrossChainEnabled.sol"; import "./LibArbitrumL1.sol"; /** - * @dev [Arbitrum](https://arbitrum.io/) specialization or the + * @dev https://arbitrum.io/[Arbitrum] specialization or the * {CrossChainEnabled} abstraction the L1 side (mainnet). * * This version should only be deployed on L1 to process cross-chain messages @@ -15,7 +15,7 @@ import "./LibArbitrumL1.sol"; * * The bridge contract is provided and maintained by the arbitrum team. You can * find the address of this contract on the rinkeby testnet in - * [Arbitrum's developer documentation](https://developer.offchainlabs.com/docs/useful_addresses). + * https://developer.offchainlabs.com/docs/useful_addresses[Arbitrum's developer documentation]. * * _Available since v4.6._ */ diff --git a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol index 48c4f797a..12939e347 100644 --- a/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol +++ b/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol @@ -7,7 +7,7 @@ import "../CrossChainEnabled.sol"; import "./LibArbitrumL2.sol"; /** - * @dev [Arbitrum](https://arbitrum.io/) specialization or the + * @dev https://arbitrum.io/[Arbitrum] specialization or the * {CrossChainEnabled} abstraction the L2 side (arbitrum). * * This version should only be deployed on L2 to process cross-chain messages diff --git a/contracts/crosschain/arbitrum/LibArbitrumL1.sol b/contracts/crosschain/arbitrum/LibArbitrumL1.sol index 586888c8b..849e12108 100644 --- a/contracts/crosschain/arbitrum/LibArbitrumL1.sol +++ b/contracts/crosschain/arbitrum/LibArbitrumL1.sol @@ -10,7 +10,7 @@ import "../errors.sol"; /** * @dev Primitives for cross-chain aware contracts for - * [Arbitrum](https://arbitrum.io/). + * https://arbitrum.io/[Arbitrum]. * * This version should only be used on L1 to process cross-chain messages * originating from L2. For the other side, use {LibArbitrumL2}. diff --git a/contracts/crosschain/arbitrum/LibArbitrumL2.sol b/contracts/crosschain/arbitrum/LibArbitrumL2.sol index 54fdb06ff..0f59ce299 100644 --- a/contracts/crosschain/arbitrum/LibArbitrumL2.sol +++ b/contracts/crosschain/arbitrum/LibArbitrumL2.sol @@ -8,7 +8,7 @@ import "../errors.sol"; /** * @dev Primitives for cross-chain aware contracts for - * [Arbitrum](https://arbitrum.io/). + * https://arbitrum.io/[Arbitrum]. * * This version should only be used on L2 to process cross-chain messages * originating from L1. For the other side, use {LibArbitrumL1}. diff --git a/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol b/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol index 453357cf5..9ceb370ad 100644 --- a/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol +++ b/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol @@ -7,12 +7,12 @@ import "../CrossChainEnabled.sol"; import "./LibOptimism.sol"; /** - * @dev [Optimism](https://www.optimism.io/) specialization or the + * @dev https://www.optimism.io/[Optimism] specialization or the * {CrossChainEnabled} abstraction. * * The messenger (`CrossDomainMessenger`) contract is provided and maintained by * the optimism team. You can find the address of this contract on mainnet and - * kovan in the [deployments section of Optimism monorepo](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/deployments). + * kovan in the https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/deployments[deployments section of Optimism monorepo]. * * _Available since v4.6._ */ diff --git a/contracts/crosschain/optimism/LibOptimism.sol b/contracts/crosschain/optimism/LibOptimism.sol index f84fd126f..05ee57c49 100644 --- a/contracts/crosschain/optimism/LibOptimism.sol +++ b/contracts/crosschain/optimism/LibOptimism.sol @@ -7,8 +7,8 @@ import {ICrossDomainMessenger as Optimism_Bridge} from "../../vendor/optimism/IC import "../errors.sol"; /** - * @dev Primitives for cross-chain aware contracts for [Optimism](https://www.optimism.io/). - * See the [documentation](https://community.optimism.io/docs/developers/bridge/messaging/#accessing-msg-sender) + * @dev Primitives for cross-chain aware contracts for https://www.optimism.io/[Optimism]. + * See the https://community.optimism.io/docs/developers/bridge/messaging/#accessing-msg-sender[documentation] * for the functionality used here. */ library LibOptimism { diff --git a/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol b/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol index 15da83501..07b854d2a 100644 --- a/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol +++ b/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol @@ -11,7 +11,7 @@ import "../../vendor/polygon/IFxMessageProcessor.sol"; address constant DEFAULT_SENDER = 0x000000000000000000000000000000000000dEaD; /** - * @dev [Polygon](https://polygon.technology/) specialization or the + * @dev https://polygon.technology/[Polygon] specialization or the * {CrossChainEnabled} abstraction the child side (polygon/mumbai). * * This version should only be deployed on child chain to process cross-chain @@ -19,7 +19,7 @@ address constant DEFAULT_SENDER = 0x000000000000000000000000000000000000dEaD; * * The fxChild contract is provided and maintained by the polygon team. You can * find the address of this contract polygon and mumbai in - * [Polygon's Fx-Portal documentation](https://docs.polygon.technology/docs/develop/l1-l2-communication/fx-portal/#contract-addresses). + * https://docs.polygon.technology/docs/develop/l1-l2-communication/fx-portal/#contract-addresses[Polygon's Fx-Portal documentation]. * * _Available since v4.6._ */ From 5ed20f32cfeb6ebc175b72687e793967490a4ad5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 18:04:52 -0300 Subject: [PATCH 59/81] Update lockfile (#3386) Co-authored-by: Renovate Bot --- package-lock.json | 1722 ++++++++++++++++++++------------------------- 1 file changed, 756 insertions(+), 966 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9cf7cda87..f545f2f70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,9 +65,9 @@ } }, "node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", + "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.16.7", @@ -150,9 +150,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", - "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz", + "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", "dev": true, "dependencies": { "regenerator-runtime": "^0.13.4" @@ -207,9 +207,9 @@ } }, "node_modules/@ensdomains/ensjs/node_modules/ethers": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.2.tgz", - "integrity": "sha512-EzGCbns24/Yluu7+ToWnMca3SXJ1Jk1BvWB7CCmVNxyOeM4LLvw2OLuIHhlkhQk1dtOcj9UMsdkxUh8RiG1dxQ==", + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.4.tgz", + "integrity": "sha512-62UIfxAQXdf67TeeOaoOoPctm5hUlYgfd0iW3wxfj7qRYKDcvvy0f+sJ3W2/Pyx77R8dblvejA8jokj+lS+ATQ==", "dev": true, "funding": [ { @@ -222,7 +222,7 @@ } ], "dependencies": { - "@ethersproject/abi": "5.6.0", + "@ethersproject/abi": "5.6.1", "@ethersproject/abstract-provider": "5.6.0", "@ethersproject/abstract-signer": "5.6.0", "@ethersproject/address": "5.6.0", @@ -237,10 +237,10 @@ "@ethersproject/json-wallets": "5.6.0", "@ethersproject/keccak256": "5.6.0", "@ethersproject/logger": "5.6.0", - "@ethersproject/networks": "5.6.1", + "@ethersproject/networks": "5.6.2", "@ethersproject/pbkdf2": "5.6.0", "@ethersproject/properties": "5.6.0", - "@ethersproject/providers": "5.6.2", + "@ethersproject/providers": "5.6.4", "@ethersproject/random": "5.6.0", "@ethersproject/rlp": "5.6.0", "@ethersproject/sha2": "5.6.0", @@ -310,9 +310,9 @@ } }, "node_modules/@ethereumjs/common": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.3.tgz", - "integrity": "sha512-mQwPucDL7FDYIg9XQ8DL31CnIYZwGhU5hyOO5E+BMmT71G0+RHvIT5rIkLBirJEKxV6+Rcf9aEIY0kXInxUWpQ==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.4.tgz", + "integrity": "sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw==", "dev": true, "dependencies": { "crc-32": "^1.2.0", @@ -352,14 +352,14 @@ } }, "node_modules/@ethereumjs/vm": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.8.0.tgz", - "integrity": "sha512-mn2G2SX79QY4ckVvZUfxlNUpzwT2AEIkvgJI8aHoQaNYEHhH8rmdVDIaVVgz6//PjK52BZsK23afz+WvSR0Qqw==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.0.tgz", + "integrity": "sha512-0IRsj4IuF8lFDWVVLc4mFOImaSX8VWF8CGm3mXHG/LLlQ/Tryy/kKXMw/bU9D+Zw03CdteW+wCGqNFS6+mPjpg==", "dev": true, "dependencies": { "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", @@ -372,9 +372,9 @@ } }, "node_modules/@ethersproject/abi": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", - "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.1.tgz", + "integrity": "sha512-0cqssYh6FXjlwKWBmLm3+zH2BNARoS5u/hxbz+LpQmcDB3w0W553h2btWui1/uZp2GBM/SI3KniTuMcYyHpA5w==", "dev": true, "funding": [ { @@ -725,9 +725,9 @@ ] }, "node_modules/@ethersproject/networks": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.1.tgz", - "integrity": "sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.2.tgz", + "integrity": "sha512-9uEzaJY7j5wpYGTojGp8U89mSsgQLc40PCMJLMCnFXTs7nhBveZ0t7dbqWUNrepWTszDbFkYD6WlL8DKx5huHA==", "dev": true, "funding": [ { @@ -783,9 +783,9 @@ } }, "node_modules/@ethersproject/providers": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.2.tgz", - "integrity": "sha512-6/EaFW/hNWz+224FXwl8+HdMRzVHt8DpPmu5MZaIQqx/K/ELnC9eY236SMV7mleCM3NnEArFwcAAxH5kUUgaRg==", + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.4.tgz", + "integrity": "sha512-WAdknnaZ52hpHV3qPiJmKx401BLpup47h36Axxgre9zT+doa/4GC/Ne48ICPxTm0BqndpToHjpLP1ZnaxyE+vw==", "dev": true, "funding": [ { @@ -1118,9 +1118,9 @@ "dev": true }, "node_modules/@metamask/eth-sig-util": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.0.tgz", - "integrity": "sha512-LczOjjxY4A7XYloxzyxJIHONELmUxVZncpOLoClpEcTiebiVdM46KRPYXGuULro9oNNR2xdVx3yoKiQjdfWmoA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", + "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", "dev": true, "dependencies": { "ethereumjs-abi": "^0.6.8", @@ -2049,9 +2049,9 @@ } }, "node_modules/@truffle/abi-utils": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.11.tgz", - "integrity": "sha512-JYVD+9t6hSc7N34i6sHolwspVvcwcA/TNZNeQxXQObCe/pv6vt+i6xmp+yD87evjHrM0zG+ANlgR/QqJhTJ/qg==", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.13.tgz", + "integrity": "sha512-WzjyNvx+naXmG/XKF+xLI+tJZLUlPGkd29rY4xBCiY9m/xWk0ZUL6gvVvnRr3leLJkBweJUSBiGUW770V8hHOg==", "dev": true, "dependencies": { "change-case": "3.0.2", @@ -2140,9 +2140,9 @@ } }, "node_modules/@truffle/compile-common": { - "version": "0.7.29", - "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.29.tgz", - "integrity": "sha512-Z5h0jQh/GXsjnTBt02boV2QiQ1QlGlWlupZWsIcLHpBxQaw/TXTa7EvicPLWf7JQ3my56iaY3N5rkrQLAlFf1Q==", + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.31.tgz", + "integrity": "sha512-BGhWPd6NoI4VZfYBg+RgrCyLaxxq40vDOp6Ouofa1NQdN6LSPwlqWf0JWvPIKFNRp+TA9aWRHGmZntYyE94OZg==", "dev": true, "dependencies": { "@truffle/error": "^0.1.0", @@ -2156,17 +2156,17 @@ "dev": true }, "node_modules/@truffle/contract": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.5.3.tgz", - "integrity": "sha512-bJJj9kJ6rTEwiroWNozglakdIhXrHzsRdS2UxDPlBRWfN6D5rvGcBUZqC+8QnNqb3iWfcf8CmO7kWhj7OKqbAA==", + "version": "4.5.8", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.5.8.tgz", + "integrity": "sha512-jqy9CFCw2EmOlyel+XQKK1ckv4m9i5Ag8pM8Mv6J+Xcv9lIE8b+FxVJAUD09Sad2OdOFFHw6f++MVPfygmTZ5w==", "dev": true, "dependencies": { "@ensdomains/ensjs": "^2.0.1", - "@truffle/blockchain-utils": "^0.1.1", - "@truffle/contract-schema": "^3.4.6", - "@truffle/debug-utils": "^6.0.15", + "@truffle/blockchain-utils": "^0.1.3", + "@truffle/contract-schema": "^3.4.7", + "@truffle/debug-utils": "^6.0.20", "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.12", + "@truffle/interface-adapter": "^0.5.16", "bignumber.js": "^7.2.1", "debug": "^4.3.1", "ethers": "^4.0.32", @@ -2178,9 +2178,9 @@ } }, "node_modules/@truffle/contract-schema": { - "version": "3.4.6", - "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.6.tgz", - "integrity": "sha512-YzVAoPxEnM7pz7vLrQvtgtnpIwERrZcbYRjRTEJP8Y7rxudYDYaZ8PwjHD3j0SQxE6Y0WquDi3PtbfgZB9BwYQ==", + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.7.tgz", + "integrity": "sha512-vbOHMq/a8rVPh+cFMBDDGPqqiKrXXOc+f1kB4znfh3ewOX8rJxZhGJvdMm3WNMJHR5RstqDV7ZIZ7ePwtSXH8Q==", "dev": true, "dependencies": { "ajv": "^6.10.0", @@ -2205,19 +2205,19 @@ } }, "node_modules/@truffle/contract/node_modules/@truffle/blockchain-utils": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.1.tgz", - "integrity": "sha512-o7nBlaMuasuADCCL2WzhvOXA5GT5ewd/F35cY6ZU69U5OUASR3ZP4CZetVCc5MZePPa/3CL9pzJ4Rhtg1ChwVA==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.3.tgz", + "integrity": "sha512-K21Wf10u6VmS12/f9OrLN98f1RCqzrmuM2zlsly4b7BF/Xdh55Iq/jNSOnsNUJa+6Iaqqz6zeidquCYu9nTFng==", "dev": true }, "node_modules/@truffle/contract/node_modules/@truffle/codec": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.5.tgz", - "integrity": "sha512-wkA6WIMVFhXkaSG6vNVaoYhHjubuek47YgsGFc2m24I7mgasOfcLQ9CVP1h/CBzOBxuy6vP/GX95DTPzsYxL9A==", + "version": "0.12.10", + "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.10.tgz", + "integrity": "sha512-5PEkeBl1z7SyAE1NWnKotHe9sOM+/Rx9O7Lwn/gnOJMD2WrFf9q2oTlxRrOQG6joUDOmGcIejEjqbo+aKyBKrw==", "dev": true, "dependencies": { - "@truffle/abi-utils": "^0.2.11", - "@truffle/compile-common": "^0.7.29", + "@truffle/abi-utils": "^0.2.13", + "@truffle/compile-common": "^0.7.31", "big.js": "^6.0.3", "bn.js": "^5.1.3", "cbor": "^5.1.0", @@ -2235,12 +2235,12 @@ "dev": true }, "node_modules/@truffle/contract/node_modules/@truffle/debug-utils": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.15.tgz", - "integrity": "sha512-y+6u2+pPU4FQRAjGmL2zFCJ39evO/5CvR2Yh8kT7o+ZG02VODGr754e8lEFPt4WO2O5fDMlIyH/7ewIGhZVLGw==", + "version": "6.0.20", + "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.20.tgz", + "integrity": "sha512-mJIVurSZsFNEnMtBgcwkOTIyi1xyuA1eQC5GV1Dgxzut+h0QDBAWdcfMqhGoRNY7AVjw2ZVN6V45DhGc80KtSA==", "dev": true, "dependencies": { - "@truffle/codec": "^0.12.5", + "@truffle/codec": "^0.12.10", "@trufflesuite/chromafi": "^3.0.0", "bn.js": "^5.1.3", "chalk": "^2.4.2", @@ -2261,9 +2261,9 @@ "dev": true }, "node_modules/@truffle/contract/node_modules/@truffle/interface-adapter": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.12.tgz", - "integrity": "sha512-Qrc5VARnvSILYqZNsAM0xsUHqGqphLXVdIvDnhUA1Xj1xyNz8iboTr8bXorMd+Uspw+PXmsW44BJ/Wioo/jL2A==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.16.tgz", + "integrity": "sha512-4L8/TtFSe9eW4KWeXAvi3RrD0rImbLeYB4axPLOCAitUEDCTB/iJjZ1cMkC85LbO9mwz5/AjP0i37YO10rging==", "dev": true, "dependencies": { "bn.js": "^5.1.3", @@ -2303,9 +2303,9 @@ } }, "node_modules/@truffle/contract/node_modules/@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "node_modules/@truffle/contract/node_modules/ansi-styles": { @@ -2903,9 +2903,9 @@ } }, "node_modules/@truffle/interface-adapter/node_modules/@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "node_modules/@truffle/interface-adapter/node_modules/bignumber.js": { @@ -3317,13 +3317,13 @@ "dev": true }, "node_modules/@truffle/provider": { - "version": "0.2.50", - "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.50.tgz", - "integrity": "sha512-GCoyX8SncfgizXYJfordv5kiysQS7S1311D3ewciixaoQpTkbqC3s0wxwHlPxU7m5wJOCw2K8rQtL3oIFfeHwA==", + "version": "0.2.54", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.54.tgz", + "integrity": "sha512-BW2bb6p7dAipUCHlRDMSswFqessXkIb8tHVRVkm6KAENIor0F4UCCPlxIzrM/ShRQ1O16jZ+0cxLMwiRWTWdLg==", "dev": true, "dependencies": { "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.12", + "@truffle/interface-adapter": "^0.5.16", "web3": "1.5.3" } }, @@ -3351,9 +3351,9 @@ "dev": true }, "node_modules/@truffle/provider/node_modules/@truffle/interface-adapter": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.12.tgz", - "integrity": "sha512-Qrc5VARnvSILYqZNsAM0xsUHqGqphLXVdIvDnhUA1Xj1xyNz8iboTr8bXorMd+Uspw+PXmsW44BJ/Wioo/jL2A==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.16.tgz", + "integrity": "sha512-4L8/TtFSe9eW4KWeXAvi3RrD0rImbLeYB4axPLOCAitUEDCTB/iJjZ1cMkC85LbO9mwz5/AjP0i37YO10rging==", "dev": true, "dependencies": { "bn.js": "^5.1.3", @@ -3371,9 +3371,9 @@ } }, "node_modules/@truffle/provider/node_modules/@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "node_modules/@truffle/provider/node_modules/bignumber.js": { @@ -3895,9 +3895,9 @@ } }, "node_modules/@types/chai": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", - "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.1.tgz", + "integrity": "sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==", "dev": true }, "node_modules/@types/concat-stream": { @@ -3964,9 +3964,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", - "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==", + "version": "17.0.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.30.tgz", + "integrity": "sha512-oNBIZjIqyHYP8VCNAV9uEytXVeXG2oR0w9lgAXro20eugRQfY002qr3CUl6BAe+Yf/z3CRjPdz27Pu6WWtuSRw==", "dev": true }, "node_modules/@types/pbkdf2": { @@ -4068,12 +4068,12 @@ } }, "node_modules/address": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz", - "integrity": "sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/address/-/address-1.2.0.tgz", + "integrity": "sha512-tNEZYz5G/zYunxFm7sfhAxkXEuLj3K6BKwv6ZURlsF6yiUQ65z0Q2wZW9L5cPUl9ocofGvXOdFYbFHp0+6MOig==", "dev": true, "engines": { - "node": ">= 0.12.0" + "node": ">= 10.0.0" } }, "node_modules/adm-zip": { @@ -4421,14 +4421,15 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -4507,9 +4508,9 @@ } }, "node_modules/async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "dependencies": { "lodash": "^4.17.14" @@ -5820,9 +5821,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.21.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.1.tgz", - "integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==", + "version": "3.22.3", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.3.tgz", + "integrity": "sha512-oN88zz7nmKROMy8GOjs+LN+0LedIvbMdnB5XsTlhcOg1WGARt9l0LFg0zohdoFmCsEZ1h2ZbSQ6azj3M+vhzwQ==", "dev": true, "hasInstallScript": true, "funding": { @@ -6161,15 +6162,19 @@ } }, "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "dependencies": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-property": { @@ -6314,9 +6319,9 @@ } }, "node_modules/dom-serializer": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", - "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", "dev": true, "dependencies": { "domelementtype": "^2.0.1", @@ -6334,9 +6339,9 @@ "dev": true }, "node_modules/domelementtype": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", - "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", "dev": true, "funding": [ { @@ -6526,9 +6531,9 @@ } }, "node_modules/es-abstract": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.2.tgz", - "integrity": "sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w==", + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz", + "integrity": "sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", @@ -6542,7 +6547,7 @@ "is-callable": "^1.2.4", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", "is-weakref": "^1.0.2", "object-inspect": "^1.12.0", @@ -6559,6 +6564,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -6577,9 +6591,9 @@ } }, "node_modules/es5-ext": { - "version": "0.10.59", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.59.tgz", - "integrity": "sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw==", + "version": "0.10.61", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -6999,13 +7013,13 @@ "dev": true }, "node_modules/eslint-plugin-mocha": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.0.3.tgz", - "integrity": "sha512-9mM7PZGxfejpjey+MrG0Cu3Lc8MyA5E2s7eUCdHXgS4SY/H9zLuwa7wVAjnEaoDjbBilA+0bPEB+iMO7lBUPcg==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.0.4.tgz", + "integrity": "sha512-8wzAeepVY027oBHz/TmBmUr7vhVqoC1KTFeDybFLhbaWKx+aQ7fJJVuUsqcUy+L+G+XvgQBJY+cbAf7hl5DF7Q==", "dev": true, "dependencies": { "eslint-utils": "^3.0.0", - "ramda": "^0.27.1" + "ramda": "^0.28.0" }, "engines": { "node": ">=14.0.0" @@ -8247,38 +8261,39 @@ "dev": true }, "node_modules/express": { - "version": "4.17.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", - "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", + "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.2", + "body-parser": "1.20.0", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.2", + "cookie": "0.5.0", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "~1.1.2", + "depd": "2.0.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "~1.1.2", + "finalhandler": "1.2.0", "fresh": "0.5.2", + "http-errors": "2.0.0", "merge-descriptors": "1.0.1", "methods": "~1.1.2", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.9.7", + "qs": "6.10.3", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.17.2", - "serve-static": "1.14.2", + "send": "0.18.0", + "serve-static": "1.15.0", "setprototypeof": "1.2.0", - "statuses": "~1.5.0", + "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" @@ -8287,25 +8302,13 @@ "node": ">= 0.10.0" } }, - "node_modules/express/node_modules/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "node_modules/express/node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "dev": true, - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" - }, "engines": { - "node": ">= 0.8" + "node": ">= 0.6" } }, "node_modules/express/node_modules/debug": { @@ -8317,35 +8320,22 @@ "ms": "2.0.0" } }, - "node_modules/express/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express/node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "node_modules/express/node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "node_modules/express/node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "dev": true, "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.8" } }, "node_modules/express/node_modules/ms": { @@ -8354,63 +8344,27 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "node_modules/express/node_modules/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", - "dev": true, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/express/node_modules/raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "node_modules/express/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "dependencies": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "ee-first": "1.1.1" }, "engines": { "node": ">= 0.8" } }, - "node_modules/express/node_modules/send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "node_modules/express/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, - "dependencies": { - "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.8.1", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.8" } }, - "node_modules/express/node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/ext": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", @@ -8543,9 +8497,9 @@ "dev": true }, "node_modules/fast-check": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.24.0.tgz", - "integrity": "sha512-iNXbN90lbabaCUfnW5jyXYPwMJLFYl09eJDkXA9ZoidFlBK63gNRvcKxv+8D1OJ1kIYjwBef4bO/K3qesUeWLQ==", + "version": "2.25.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.25.0.tgz", + "integrity": "sha512-wRUT2KD2lAmT75WNIJIHECawoUUMHM0I5jrlLXGtGeqmPL8jl/EldUDjY1VCp6fDY8yflyfUeIOsOBrIbIiArg==", "dev": true, "dependencies": { "pure-rand": "^5.0.1" @@ -9628,9 +9582,9 @@ } }, "node_modules/has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9645,6 +9599,18 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/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", @@ -9972,9 +9938,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { "agent-base": "6", @@ -10408,9 +10374,9 @@ } }, "node_modules/is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -11217,13 +11183,13 @@ } }, "node_modules/live-server": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/live-server/-/live-server-1.2.1.tgz", - "integrity": "sha512-Yn2XCVjErTkqnM3FfTmM7/kWy3zP7+cEtC7x6u+wUzlQ+1UW3zEYbbyJrc0jNDwiMDZI0m4a0i3dxlGHVyXczw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/live-server/-/live-server-1.2.2.tgz", + "integrity": "sha512-t28HXLjITRGoMSrCOv4eZ88viHaBVIjKjdI5PO92Vxlu+twbk6aE0t7dVIaz6ZWkjPilYFV6OSdMYl9ybN2B4w==", "dev": true, "dependencies": { "chokidar": "^2.0.4", - "colors": "latest", + "colors": "1.4.0", "connect": "^3.6.6", "cors": "latest", "event-stream": "3.3.4", @@ -12971,9 +12937,9 @@ } }, "node_modules/obliterator": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.2.tgz", - "integrity": "sha512-g0TrA7SbUggROhDPK8cEu/qpItwH2LSKcNl4tlfBNT54XY+nOsqrs0Q68h1V9b3HOSpIWv15jb1lax2hAggdIg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.3.tgz", + "integrity": "sha512-qN5lHhArxl/789Bp3XCpssAYy7cvOdRzxzflmGEJaiipAT2b/USr1XvKjYyssPOwQ/3KjV1e8Ed9po9rie6E6A==", "dev": true }, "node_modules/oboe": { @@ -13690,10 +13656,14 @@ ] }, "node_modules/ramda": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.2.tgz", - "integrity": "sha512-SbiLPU40JuJniHexQSAgad32hfwd+DRUdwF2PlVuI5RZD0/vahUco7R8vD86J/tcEKKF9vZrUVwgtmGCqlCKyA==", - "dev": true + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.28.0.tgz", + "integrity": "sha512-9QnLuG/kPVgWvMQ4aODhsBUFKOUmnbUnsSXACv+NCQZcHbeb+v8Lodp8OVxtRULN1/xOyYLLaL6npE6dMq5QTA==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ramda" + } }, "node_modules/randombytes": { "version": "2.1.0", @@ -14443,9 +14413,9 @@ } }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -14630,91 +14600,15 @@ "dev": true }, "node_modules/serve-static": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", - "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "dev": true, "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.17.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/serve-static/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/serve-static/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/serve-static/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static/node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "node_modules/serve-static/node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dev": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/serve-static/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/serve-static/node_modules/send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", - "dev": true, - "dependencies": { - "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.8.1", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "send": "0.18.0" }, "engines": { "node": ">= 0.8.0" @@ -15817,9 +15711,9 @@ } }, "node_modules/solidity-ast": { - "version": "0.4.31", - "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.31.tgz", - "integrity": "sha512-kX6o4XE4ihaqENuRRTMJfwQNHoqWusPENZUlX4oVb19gQdfi7IswFWnThONHSW/61umgfWdKtCBgW45iuOTryQ==", + "version": "0.4.32", + "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.32.tgz", + "integrity": "sha512-vCx17410X+NMnpLVyg6ix4NMCHFIkvWrJb1rPBBeQYEQChX93Zgb9WB9NaIY4zpsr3Q8IvAfohw+jmuBzGf8OQ==", "dev": true }, "node_modules/solidity-comments-extractor": { @@ -15829,9 +15723,9 @@ "dev": true }, "node_modules/solidity-coverage": { - "version": "0.7.20", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.7.20.tgz", - "integrity": "sha512-edOXTugUYdqxrtEnIn4vgrGjLPxdexcL0WD8LzAvVA3d1dwgcfRO3k8xQR02ZQnOnWMBi8Cqs0F+kAQQp3JW8g==", + "version": "0.7.21", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.7.21.tgz", + "integrity": "sha512-O8nuzJ9yXiKUx3NdzVvHrUW0DxoNVcGzq/I7NzewNO9EZE3wYAQ4l8BwcnV64r4aC/HB6Vnw/q2sF0BQHv/3fg==", "dev": true, "dependencies": { "@solidity-parser/parser": "^0.14.0", @@ -16990,9 +16884,9 @@ } }, "node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, "node_modules/tsort": { @@ -17093,9 +16987,9 @@ } }, "node_modules/uglify-js": { - "version": "3.15.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.3.tgz", - "integrity": "sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg==", + "version": "3.15.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz", + "integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==", "dev": true, "optional": true, "bin": { @@ -17112,14 +17006,14 @@ "dev": true }, "node_modules/unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" }, "funding": { @@ -17127,9 +17021,9 @@ } }, "node_modules/underscore": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz", - "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.3.tgz", + "integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA==", "dev": true }, "node_modules/undici": { @@ -17408,28 +17302,28 @@ } }, "node_modules/web3": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.7.1.tgz", - "integrity": "sha512-RKVdyZ5FuVEykj62C1o2tc0teJciSOh61jpVB9yb344dBHO3ZV4XPPP24s/PPqIMXmVFN00g2GD9M/v1SoHO/A==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.7.3.tgz", + "integrity": "sha512-UgBvQnKIXncGYzsiGacaiHtm0xzQ/JtGqcSO/ddzQHYxnNuwI72j1Pb4gskztLYihizV9qPNQYHMSCiBlStI9A==", "dev": true, "hasInstallScript": true, "dependencies": { - "web3-bzz": "1.7.1", - "web3-core": "1.7.1", - "web3-eth": "1.7.1", - "web3-eth-personal": "1.7.1", - "web3-net": "1.7.1", - "web3-shh": "1.7.1", - "web3-utils": "1.7.1" + "web3-bzz": "1.7.3", + "web3-core": "1.7.3", + "web3-eth": "1.7.3", + "web3-eth-personal": "1.7.3", + "web3-net": "1.7.3", + "web3-shh": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-bzz": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.7.1.tgz", - "integrity": "sha512-sVeUSINx4a4pfdnT+3ahdRdpDPvZDf4ZT/eBF5XtqGWq1mhGTl8XaQAk15zafKVm6Onq28vN8abgB/l+TrG8kA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.7.3.tgz", + "integrity": "sha512-y2i2IW0MfSqFc1JBhBSQ59Ts9xE30hhxSmLS13jLKWzie24/An5dnoGarp2rFAy20tevJu1zJVPYrEl14jiL5w==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -17442,62 +17336,62 @@ } }, "node_modules/web3-bzz/node_modules/@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "node_modules/web3-core": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.7.1.tgz", - "integrity": "sha512-HOyDPj+4cNyeNPwgSeUkhtS0F+Pxc2obcm4oRYPW5ku6jnTO34pjaij0us+zoY3QEusR8FfAKVK1kFPZnS7Dzw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.7.3.tgz", + "integrity": "sha512-4RNxueGyevD1XSjdHE57vz/YWRHybpcd3wfQS33fgMyHZBVLFDNwhn+4dX4BeofVlK/9/cmPAokLfBUStZMLdw==", "dev": true, "dependencies": { "@types/bn.js": "^4.11.5", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-core-requestmanager": "1.7.1", - "web3-utils": "1.7.1" + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-core-requestmanager": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-helpers": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.7.1.tgz", - "integrity": "sha512-xn7Sx+s4CyukOJdlW8bBBDnUCWndr+OCJAlUe/dN2wXiyaGRiCWRhuQZrFjbxLeBt1fYFH7uWyYHhYU6muOHgw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.7.3.tgz", + "integrity": "sha512-qS2t6UKLhRV/6C7OFHtMeoHphkcA+CKUr2vfpxy4hubs3+Nj28K9pgiqFuvZiXmtEEwIAE2A28GBOC3RdcSuFg==", "dev": true, "dependencies": { - "web3-eth-iban": "1.7.1", - "web3-utils": "1.7.1" + "web3-eth-iban": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-method": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.7.1.tgz", - "integrity": "sha512-383wu5FMcEphBFl5jCjk502JnEg3ugHj7MQrsX7DY76pg5N5/dEzxeEMIJFCN6kr5Iq32NINOG3VuJIyjxpsEg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.7.3.tgz", + "integrity": "sha512-SeF8YL/NVFbj/ddwLhJeS0io8y7wXaPYA2AVT0h2C2ESYkpvOtQmyw2Bc3aXxBmBErKcbOJjE2ABOKdUmLSmMA==", "dev": true, "dependencies": { "@ethersproject/transactions": "^5.0.0-beta.135", - "web3-core-helpers": "1.7.1", - "web3-core-promievent": "1.7.1", - "web3-core-subscriptions": "1.7.1", - "web3-utils": "1.7.1" + "web3-core-helpers": "1.7.3", + "web3-core-promievent": "1.7.3", + "web3-core-subscriptions": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-promievent": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.7.1.tgz", - "integrity": "sha512-Vd+CVnpPejrnevIdxhCkzMEywqgVbhHk/AmXXceYpmwA6sX41c5a65TqXv1i3FWRJAz/dW7oKz9NAzRIBAO/kA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.7.3.tgz", + "integrity": "sha512-+mcfNJLP8h2JqcL/UdMGdRVfTdm+bsoLzAFtLpazE4u9kU7yJUgMMAqnK59fKD3Zpke3DjaUJKwz1TyiGM5wig==", "dev": true, "dependencies": { "eventemitter3": "4.0.4" @@ -17507,29 +17401,29 @@ } }, "node_modules/web3-core-requestmanager": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.7.1.tgz", - "integrity": "sha512-/EHVTiMShpZKiq0Jka0Vgguxi3vxq1DAHKxg42miqHdUsz4/cDWay2wGALDR2x3ofDB9kqp7pb66HsvQImQeag==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.7.3.tgz", + "integrity": "sha512-bC+jeOjPbagZi2IuL1J5d44f3zfPcgX+GWYUpE9vicNkPUxFBWRG+olhMo7L+BIcD57cTmukDlnz+1xBULAjFg==", "dev": true, "dependencies": { "util": "^0.12.0", - "web3-core-helpers": "1.7.1", - "web3-providers-http": "1.7.1", - "web3-providers-ipc": "1.7.1", - "web3-providers-ws": "1.7.1" + "web3-core-helpers": "1.7.3", + "web3-providers-http": "1.7.3", + "web3-providers-ipc": "1.7.3", + "web3-providers-ws": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-subscriptions": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.7.1.tgz", - "integrity": "sha512-NZBsvSe4J+Wt16xCf4KEtBbxA9TOwSVr8KWfUQ0tC2KMdDYdzNswl0Q9P58xaVuNlJ3/BH+uDFZJJ5E61BSA1Q==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.7.3.tgz", + "integrity": "sha512-/i1ZCLW3SDxEs5mu7HW8KL4Vq7x4/fDXY+yf/vPoDljlpvcLEOnI8y9r7om+0kYwvuTlM6DUHHafvW0221TyRQ==", "dev": true, "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.7.1" + "web3-core-helpers": "1.7.3" }, "engines": { "node": ">=8.0.0" @@ -17545,9 +17439,9 @@ } }, "node_modules/web3-core/node_modules/@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "node_modules/web3-core/node_modules/bignumber.js": { @@ -17560,36 +17454,36 @@ } }, "node_modules/web3-eth": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.7.1.tgz", - "integrity": "sha512-Uz3gO4CjTJ+hMyJZAd2eiv2Ur1uurpN7sTMATWKXYR/SgG+SZgncnk/9d8t23hyu4lyi2GiVL1AqVqptpRElxg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.7.3.tgz", + "integrity": "sha512-BCIRMPwaMlTCbswXyGT6jj9chCh9RirbDFkPtvqozfQ73HGW7kP78TXXf9+Xdo1GjutQfxi/fQ9yPdxtDJEpDA==", "dev": true, "dependencies": { - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-core-subscriptions": "1.7.1", - "web3-eth-abi": "1.7.1", - "web3-eth-accounts": "1.7.1", - "web3-eth-contract": "1.7.1", - "web3-eth-ens": "1.7.1", - "web3-eth-iban": "1.7.1", - "web3-eth-personal": "1.7.1", - "web3-net": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-core-subscriptions": "1.7.3", + "web3-eth-abi": "1.7.3", + "web3-eth-accounts": "1.7.3", + "web3-eth-contract": "1.7.3", + "web3-eth-ens": "1.7.3", + "web3-eth-iban": "1.7.3", + "web3-eth-personal": "1.7.3", + "web3-net": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-abi": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.1.tgz", - "integrity": "sha512-8BVBOoFX1oheXk+t+uERBibDaVZ5dxdcefpbFTWcBs7cdm0tP8CD1ZTCLi5Xo+1bolVHNH2dMSf/nEAssq5pUA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.3.tgz", + "integrity": "sha512-ZlD8DrJro0ocnbZViZpAoMX44x5aYAb73u2tMq557rMmpiluZNnhcCYF/NnVMy6UIkn7SF/qEA45GXA1ne6Tnw==", "dev": true, "dependencies": { "@ethersproject/abi": "5.0.7", - "web3-utils": "1.7.1" + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" @@ -17613,9 +17507,9 @@ } }, "node_modules/web3-eth-accounts": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.7.1.tgz", - "integrity": "sha512-3xGQ2bkTQc7LFoqGWxp5cQDrKndlX05s7m0rAFVoyZZODMqrdSGjMPMqmWqHzJRUswNEMc+oelqSnGBubqhguQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.7.3.tgz", + "integrity": "sha512-aDaWjW1oJeh0LeSGRVyEBiTe/UD2/cMY4dD6pQYa8dOhwgMtNQjxIQ7kacBBXe7ZKhjbIFZDhvXN4mjXZ82R2Q==", "dev": true, "dependencies": { "@ethereumjs/common": "^2.5.0", @@ -17625,10 +17519,10 @@ "ethereumjs-util": "^7.0.10", "scrypt-js": "^3.0.1", "uuid": "3.3.2", - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" @@ -17656,19 +17550,19 @@ } }, "node_modules/web3-eth-contract": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.7.1.tgz", - "integrity": "sha512-HpnbkPYkVK3lOyos2SaUjCleKfbF0SP3yjw7l551rAAi5sIz/vwlEzdPWd0IHL7ouxXbO0tDn7jzWBRcD3sTbA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.7.3.tgz", + "integrity": "sha512-7mjkLxCNMWlQrlfM/MmNnlKRHwFk5XrZcbndoMt3KejcqDP6dPHi2PZLutEcw07n/Sk8OMpSamyF3QiGfmyRxw==", "dev": true, "dependencies": { "@types/bn.js": "^4.11.5", - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-core-promievent": "1.7.1", - "web3-core-subscriptions": "1.7.1", - "web3-eth-abi": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-core-promievent": "1.7.3", + "web3-core-subscriptions": "1.7.3", + "web3-eth-abi": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" @@ -17684,81 +17578,81 @@ } }, "node_modules/web3-eth-ens": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.7.1.tgz", - "integrity": "sha512-DVCF76i9wM93DrPQwLrYiCw/UzxFuofBsuxTVugrnbm0SzucajLLNftp3ITK0c4/lV3x9oo5ER/wD6RRMHQnvw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.7.3.tgz", + "integrity": "sha512-q7+hFGHIc0mBI3LwgRVcLCQmp6GItsWgUtEZ5bjwdjOnJdbjYddm7PO9RDcTDQ6LIr7hqYaY4WTRnDHZ6BEt5Q==", "dev": true, "dependencies": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-promievent": "1.7.1", - "web3-eth-abi": "1.7.1", - "web3-eth-contract": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-promievent": "1.7.3", + "web3-eth-abi": "1.7.3", + "web3-eth-contract": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-iban": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.7.1.tgz", - "integrity": "sha512-XG4I3QXuKB/udRwZdNEhdYdGKjkhfb/uH477oFVMLBqNimU/Cw8yXUI5qwFKvBHM+hMQWfzPDuSDEDKC2uuiMg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.7.3.tgz", + "integrity": "sha512-1GPVWgajwhh7g53mmYDD1YxcftQniIixMiRfOqlnA1w0mFGrTbCoPeVaSQ3XtSf+rYehNJIZAUeDBnONVjXXmg==", "dev": true, "dependencies": { "bn.js": "^4.11.9", - "web3-utils": "1.7.1" + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-personal": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.1.tgz", - "integrity": "sha512-02H6nFBNfNmFjMGZL6xcDi0r7tUhxrUP91FTFdoLyR94eIJDadPp4rpXfG7MVES873i1PReh4ep5pSCHbc3+Pg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.3.tgz", + "integrity": "sha512-iTLz2OYzEsJj2qGE4iXC1Gw+KZN924fTAl0ESBFs2VmRhvVaM7GFqZz/wx7/XESl3GVxGxlRje3gNK0oGIoYYQ==", "dev": true, "dependencies": { "@types/node": "^12.12.6", - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-net": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-net": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-personal/node_modules/@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "node_modules/web3-net": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.7.1.tgz", - "integrity": "sha512-8yPNp2gvjInWnU7DCoj4pIPNhxzUjrxKlODsyyXF8j0q3Z2VZuQp+c63gL++r2Prg4fS8t141/HcJw4aMu5sVA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.7.3.tgz", + "integrity": "sha512-zAByK0Qrr71k9XW0Adtn+EOuhS9bt77vhBO6epAeQ2/VKl8rCGLAwrl3GbeEl7kWa8s/su72cjI5OetG7cYR0g==", "dev": true, "dependencies": { - "web3-core": "1.7.1", - "web3-core-method": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-method": "1.7.3", + "web3-utils": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-http": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.7.1.tgz", - "integrity": "sha512-dmiO6G4dgAa3yv+2VD5TduKNckgfR97VI9YKXVleWdcpBoKXe2jofhdvtafd42fpIoaKiYsErxQNcOC5gI/7Vg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.7.3.tgz", + "integrity": "sha512-TQJfMsDQ5Uq9zGMYlu7azx1L7EvxW+Llks3MaWn3cazzr5tnrDbGh6V17x6LN4t8tFDHWx0rYKr3mDPqyTjOZw==", "dev": true, "dependencies": { - "web3-core-helpers": "1.7.1", + "web3-core-helpers": "1.7.3", "xhr2-cookies": "1.1.0" }, "engines": { @@ -17766,26 +17660,26 @@ } }, "node_modules/web3-providers-ipc": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.7.1.tgz", - "integrity": "sha512-uNgLIFynwnd5M9ZC0lBvRQU5iLtU75hgaPpc7ZYYR+kjSk2jr2BkEAQhFVJ8dlqisrVmmqoAPXOEU0flYZZgNQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.7.3.tgz", + "integrity": "sha512-Z4EGdLKzz6I1Bw+VcSyqVN4EJiT2uAro48Am1eRvxUi4vktGoZtge1ixiyfrRIVb6nPe7KnTFl30eQBtMqS0zA==", "dev": true, "dependencies": { "oboe": "2.1.5", - "web3-core-helpers": "1.7.1" + "web3-core-helpers": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-ws": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.7.1.tgz", - "integrity": "sha512-Uj0n5hdrh0ESkMnTQBsEUS2u6Unqdc7Pe4Zl+iZFb7Yn9cIGsPJBl7/YOP4137EtD5ueXAv+MKwzcelpVhFiFg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.7.3.tgz", + "integrity": "sha512-PpykGbkkkKtxPgv7U4ny4UhnkqSZDfLgBEvFTXuXLAngbX/qdgfYkhIuz3MiGplfL7Yh93SQw3xDjImXmn2Rgw==", "dev": true, "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.7.1", + "web3-core-helpers": "1.7.3", "websocket": "^1.0.32" }, "engines": { @@ -17793,25 +17687,25 @@ } }, "node_modules/web3-shh": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.7.1.tgz", - "integrity": "sha512-NO+jpEjo8kYX6c7GiaAm57Sx93PLYkWYUCWlZmUOW7URdUcux8VVluvTWklGPvdM9H1WfDrol91DjuSW+ykyqg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.7.3.tgz", + "integrity": "sha512-bQTSKkyG7GkuULdZInJ0osHjnmkHij9tAySibpev1XjYdjLiQnd0J9YGF4HjvxoG3glNROpuCyTaRLrsLwaZuw==", "dev": true, "hasInstallScript": true, "dependencies": { - "web3-core": "1.7.1", - "web3-core-method": "1.7.1", - "web3-core-subscriptions": "1.7.1", - "web3-net": "1.7.1" + "web3-core": "1.7.3", + "web3-core-method": "1.7.3", + "web3-core-subscriptions": "1.7.3", + "web3-net": "1.7.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-utils": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.1.tgz", - "integrity": "sha512-fef0EsqMGJUgiHPdX+KN9okVWshbIumyJPmR+btnD1HgvoXijKEkuKBv0OmUqjbeqmLKP2/N9EiXKJel5+E1Dw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.3.tgz", + "integrity": "sha512-g6nQgvb/bUpVUIxJE+ezVN+rYwYmlFyMvMIRSuqpi1dk6ApDD00YNArrk7sPcZnjvxOJ76813Xs2vIN2rgh4lg==", "dev": true, "dependencies": { "bn.js": "^4.11.9", @@ -18236,9 +18130,9 @@ "dev": true }, "node_modules/yargs": { - "version": "17.4.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.0.tgz", - "integrity": "sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA==", + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", + "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", "dev": true, "dependencies": { "cliui": "^7.0.2", @@ -18378,9 +18272,9 @@ "dev": true }, "@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz", + "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.16.7", @@ -18447,9 +18341,9 @@ } }, "@babel/runtime": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", - "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", + "version": "7.17.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz", + "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -18500,12 +18394,12 @@ }, "dependencies": { "ethers": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.2.tgz", - "integrity": "sha512-EzGCbns24/Yluu7+ToWnMca3SXJ1Jk1BvWB7CCmVNxyOeM4LLvw2OLuIHhlkhQk1dtOcj9UMsdkxUh8RiG1dxQ==", + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.4.tgz", + "integrity": "sha512-62UIfxAQXdf67TeeOaoOoPctm5hUlYgfd0iW3wxfj7qRYKDcvvy0f+sJ3W2/Pyx77R8dblvejA8jokj+lS+ATQ==", "dev": true, "requires": { - "@ethersproject/abi": "5.6.0", + "@ethersproject/abi": "5.6.1", "@ethersproject/abstract-provider": "5.6.0", "@ethersproject/abstract-signer": "5.6.0", "@ethersproject/address": "5.6.0", @@ -18520,10 +18414,10 @@ "@ethersproject/json-wallets": "5.6.0", "@ethersproject/keccak256": "5.6.0", "@ethersproject/logger": "5.6.0", - "@ethersproject/networks": "5.6.1", + "@ethersproject/networks": "5.6.2", "@ethersproject/pbkdf2": "5.6.0", "@ethersproject/properties": "5.6.0", - "@ethersproject/providers": "5.6.2", + "@ethersproject/providers": "5.6.4", "@ethersproject/random": "5.6.0", "@ethersproject/rlp": "5.6.0", "@ethersproject/sha2": "5.6.0", @@ -18591,9 +18485,9 @@ } }, "@ethereumjs/common": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.3.tgz", - "integrity": "sha512-mQwPucDL7FDYIg9XQ8DL31CnIYZwGhU5hyOO5E+BMmT71G0+RHvIT5rIkLBirJEKxV6+Rcf9aEIY0kXInxUWpQ==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.4.tgz", + "integrity": "sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw==", "dev": true, "requires": { "crc-32": "^1.2.0", @@ -18635,14 +18529,14 @@ } }, "@ethereumjs/vm": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.8.0.tgz", - "integrity": "sha512-mn2G2SX79QY4ckVvZUfxlNUpzwT2AEIkvgJI8aHoQaNYEHhH8rmdVDIaVVgz6//PjK52BZsK23afz+WvSR0Qqw==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.0.tgz", + "integrity": "sha512-0IRsj4IuF8lFDWVVLc4mFOImaSX8VWF8CGm3mXHG/LLlQ/Tryy/kKXMw/bU9D+Zw03CdteW+wCGqNFS6+mPjpg==", "dev": true, "requires": { "@ethereumjs/block": "^3.6.2", "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", @@ -18655,9 +18549,9 @@ } }, "@ethersproject/abi": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.0.tgz", - "integrity": "sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.1.tgz", + "integrity": "sha512-0cqssYh6FXjlwKWBmLm3+zH2BNARoS5u/hxbz+LpQmcDB3w0W553h2btWui1/uZp2GBM/SI3KniTuMcYyHpA5w==", "dev": true, "requires": { "@ethersproject/address": "^5.6.0", @@ -18860,9 +18754,9 @@ "dev": true }, "@ethersproject/networks": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.1.tgz", - "integrity": "sha512-b2rrupf3kCTcc3jr9xOWBuHylSFtbpJf79Ga7QR98ienU2UqGimPGEsYMgbI29KHJfA5Us89XwGVmxrlxmSrMg==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.2.tgz", + "integrity": "sha512-9uEzaJY7j5wpYGTojGp8U89mSsgQLc40PCMJLMCnFXTs7nhBveZ0t7dbqWUNrepWTszDbFkYD6WlL8DKx5huHA==", "dev": true, "requires": { "@ethersproject/logger": "^5.6.0" @@ -18888,9 +18782,9 @@ } }, "@ethersproject/providers": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.2.tgz", - "integrity": "sha512-6/EaFW/hNWz+224FXwl8+HdMRzVHt8DpPmu5MZaIQqx/K/ELnC9eY236SMV7mleCM3NnEArFwcAAxH5kUUgaRg==", + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.4.tgz", + "integrity": "sha512-WAdknnaZ52hpHV3qPiJmKx401BLpup47h36Axxgre9zT+doa/4GC/Ne48ICPxTm0BqndpToHjpLP1ZnaxyE+vw==", "dev": true, "requires": { "@ethersproject/abstract-provider": "^5.6.0", @@ -19088,9 +18982,9 @@ "dev": true }, "@metamask/eth-sig-util": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.0.tgz", - "integrity": "sha512-LczOjjxY4A7XYloxzyxJIHONELmUxVZncpOLoClpEcTiebiVdM46KRPYXGuULro9oNNR2xdVx3yoKiQjdfWmoA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", + "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", "dev": true, "requires": { "ethereumjs-abi": "^0.6.8", @@ -19833,9 +19727,9 @@ } }, "@truffle/abi-utils": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.11.tgz", - "integrity": "sha512-JYVD+9t6hSc7N34i6sHolwspVvcwcA/TNZNeQxXQObCe/pv6vt+i6xmp+yD87evjHrM0zG+ANlgR/QqJhTJ/qg==", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-0.2.13.tgz", + "integrity": "sha512-WzjyNvx+naXmG/XKF+xLI+tJZLUlPGkd29rY4xBCiY9m/xWk0ZUL6gvVvnRr3leLJkBweJUSBiGUW770V8hHOg==", "dev": true, "requires": { "change-case": "3.0.2", @@ -19920,9 +19814,9 @@ } }, "@truffle/compile-common": { - "version": "0.7.29", - "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.29.tgz", - "integrity": "sha512-Z5h0jQh/GXsjnTBt02boV2QiQ1QlGlWlupZWsIcLHpBxQaw/TXTa7EvicPLWf7JQ3my56iaY3N5rkrQLAlFf1Q==", + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.7.31.tgz", + "integrity": "sha512-BGhWPd6NoI4VZfYBg+RgrCyLaxxq40vDOp6Ouofa1NQdN6LSPwlqWf0JWvPIKFNRp+TA9aWRHGmZntYyE94OZg==", "dev": true, "requires": { "@truffle/error": "^0.1.0", @@ -19938,17 +19832,17 @@ } }, "@truffle/contract": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.5.3.tgz", - "integrity": "sha512-bJJj9kJ6rTEwiroWNozglakdIhXrHzsRdS2UxDPlBRWfN6D5rvGcBUZqC+8QnNqb3iWfcf8CmO7kWhj7OKqbAA==", + "version": "4.5.8", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.5.8.tgz", + "integrity": "sha512-jqy9CFCw2EmOlyel+XQKK1ckv4m9i5Ag8pM8Mv6J+Xcv9lIE8b+FxVJAUD09Sad2OdOFFHw6f++MVPfygmTZ5w==", "dev": true, "requires": { "@ensdomains/ensjs": "^2.0.1", - "@truffle/blockchain-utils": "^0.1.1", - "@truffle/contract-schema": "^3.4.6", - "@truffle/debug-utils": "^6.0.15", + "@truffle/blockchain-utils": "^0.1.3", + "@truffle/contract-schema": "^3.4.7", + "@truffle/debug-utils": "^6.0.20", "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.12", + "@truffle/interface-adapter": "^0.5.16", "bignumber.js": "^7.2.1", "debug": "^4.3.1", "ethers": "^4.0.32", @@ -19977,19 +19871,19 @@ } }, "@truffle/blockchain-utils": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.1.tgz", - "integrity": "sha512-o7nBlaMuasuADCCL2WzhvOXA5GT5ewd/F35cY6ZU69U5OUASR3ZP4CZetVCc5MZePPa/3CL9pzJ4Rhtg1ChwVA==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.3.tgz", + "integrity": "sha512-K21Wf10u6VmS12/f9OrLN98f1RCqzrmuM2zlsly4b7BF/Xdh55Iq/jNSOnsNUJa+6Iaqqz6zeidquCYu9nTFng==", "dev": true }, "@truffle/codec": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.5.tgz", - "integrity": "sha512-wkA6WIMVFhXkaSG6vNVaoYhHjubuek47YgsGFc2m24I7mgasOfcLQ9CVP1h/CBzOBxuy6vP/GX95DTPzsYxL9A==", + "version": "0.12.10", + "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.12.10.tgz", + "integrity": "sha512-5PEkeBl1z7SyAE1NWnKotHe9sOM+/Rx9O7Lwn/gnOJMD2WrFf9q2oTlxRrOQG6joUDOmGcIejEjqbo+aKyBKrw==", "dev": true, "requires": { - "@truffle/abi-utils": "^0.2.11", - "@truffle/compile-common": "^0.7.29", + "@truffle/abi-utils": "^0.2.13", + "@truffle/compile-common": "^0.7.31", "big.js": "^6.0.3", "bn.js": "^5.1.3", "cbor": "^5.1.0", @@ -20009,12 +19903,12 @@ } }, "@truffle/debug-utils": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.15.tgz", - "integrity": "sha512-y+6u2+pPU4FQRAjGmL2zFCJ39evO/5CvR2Yh8kT7o+ZG02VODGr754e8lEFPt4WO2O5fDMlIyH/7ewIGhZVLGw==", + "version": "6.0.20", + "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.20.tgz", + "integrity": "sha512-mJIVurSZsFNEnMtBgcwkOTIyi1xyuA1eQC5GV1Dgxzut+h0QDBAWdcfMqhGoRNY7AVjw2ZVN6V45DhGc80KtSA==", "dev": true, "requires": { - "@truffle/codec": "^0.12.5", + "@truffle/codec": "^0.12.10", "@trufflesuite/chromafi": "^3.0.0", "bn.js": "^5.1.3", "chalk": "^2.4.2", @@ -20037,9 +19931,9 @@ "dev": true }, "@truffle/interface-adapter": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.12.tgz", - "integrity": "sha512-Qrc5VARnvSILYqZNsAM0xsUHqGqphLXVdIvDnhUA1Xj1xyNz8iboTr8bXorMd+Uspw+PXmsW44BJ/Wioo/jL2A==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.16.tgz", + "integrity": "sha512-4L8/TtFSe9eW4KWeXAvi3RrD0rImbLeYB4axPLOCAitUEDCTB/iJjZ1cMkC85LbO9mwz5/AjP0i37YO10rging==", "dev": true, "requires": { "bn.js": "^5.1.3", @@ -20081,9 +19975,9 @@ } }, "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "ansi-styles": { @@ -20459,9 +20353,9 @@ } }, "@truffle/contract-schema": { - "version": "3.4.6", - "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.6.tgz", - "integrity": "sha512-YzVAoPxEnM7pz7vLrQvtgtnpIwERrZcbYRjRTEJP8Y7rxudYDYaZ8PwjHD3j0SQxE6Y0WquDi3PtbfgZB9BwYQ==", + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.4.7.tgz", + "integrity": "sha512-vbOHMq/a8rVPh+cFMBDDGPqqiKrXXOc+f1kB4znfh3ewOX8rJxZhGJvdMm3WNMJHR5RstqDV7ZIZ7ePwtSXH8Q==", "dev": true, "requires": { "ajv": "^6.10.0", @@ -20584,9 +20478,9 @@ } }, "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "bignumber.js": { @@ -20933,13 +20827,13 @@ } }, "@truffle/provider": { - "version": "0.2.50", - "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.50.tgz", - "integrity": "sha512-GCoyX8SncfgizXYJfordv5kiysQS7S1311D3ewciixaoQpTkbqC3s0wxwHlPxU7m5wJOCw2K8rQtL3oIFfeHwA==", + "version": "0.2.54", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.54.tgz", + "integrity": "sha512-BW2bb6p7dAipUCHlRDMSswFqessXkIb8tHVRVkm6KAENIor0F4UCCPlxIzrM/ShRQ1O16jZ+0cxLMwiRWTWdLg==", "dev": true, "requires": { "@truffle/error": "^0.1.0", - "@truffle/interface-adapter": "^0.5.12", + "@truffle/interface-adapter": "^0.5.16", "web3": "1.5.3" }, "dependencies": { @@ -20967,9 +20861,9 @@ "dev": true }, "@truffle/interface-adapter": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.12.tgz", - "integrity": "sha512-Qrc5VARnvSILYqZNsAM0xsUHqGqphLXVdIvDnhUA1Xj1xyNz8iboTr8bXorMd+Uspw+PXmsW44BJ/Wioo/jL2A==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.16.tgz", + "integrity": "sha512-4L8/TtFSe9eW4KWeXAvi3RrD0rImbLeYB4axPLOCAitUEDCTB/iJjZ1cMkC85LbO9mwz5/AjP0i37YO10rging==", "dev": true, "requires": { "bn.js": "^5.1.3", @@ -20987,9 +20881,9 @@ } }, "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "bignumber.js": { @@ -21429,9 +21323,9 @@ } }, "@types/chai": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", - "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.1.tgz", + "integrity": "sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==", "dev": true }, "@types/concat-stream": { @@ -21498,9 +21392,9 @@ "dev": true }, "@types/node": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", - "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==", + "version": "17.0.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.30.tgz", + "integrity": "sha512-oNBIZjIqyHYP8VCNAV9uEytXVeXG2oR0w9lgAXro20eugRQfY002qr3CUl6BAe+Yf/z3CRjPdz27Pu6WWtuSRw==", "dev": true }, "@types/pbkdf2": { @@ -21585,9 +21479,9 @@ "requires": {} }, "address": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz", - "integrity": "sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/address/-/address-1.2.0.tgz", + "integrity": "sha512-tNEZYz5G/zYunxFm7sfhAxkXEuLj3K6BKwv6ZURlsF6yiUQ65z0Q2wZW9L5cPUl9ocofGvXOdFYbFHp0+6MOig==", "dev": true }, "adm-zip": { @@ -21851,14 +21745,15 @@ "dev": true }, "array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" } }, "asap": { @@ -21919,9 +21814,9 @@ "dev": true }, "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "requires": { "lodash": "^4.17.14" @@ -23025,9 +22920,9 @@ "dev": true }, "core-js-pure": { - "version": "3.21.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.1.tgz", - "integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==", + "version": "3.22.3", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.3.tgz", + "integrity": "sha512-oN88zz7nmKROMy8GOjs+LN+0LedIvbMdnB5XsTlhcOg1WGARt9l0LFg0zohdoFmCsEZ1h2ZbSQ6azj3M+vhzwQ==", "dev": true }, "core-util-is": { @@ -23297,12 +23192,13 @@ } }, "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "requires": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, "define-property": { @@ -23417,9 +23313,9 @@ } }, "dom-serializer": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", - "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", "dev": true, "requires": { "domelementtype": "^2.0.1", @@ -23434,9 +23330,9 @@ "dev": true }, "domelementtype": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", - "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", "dev": true }, "domhandler": { @@ -23592,9 +23488,9 @@ } }, "es-abstract": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.2.tgz", - "integrity": "sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w==", + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz", + "integrity": "sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -23608,7 +23504,7 @@ "is-callable": "^1.2.4", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", "is-weakref": "^1.0.2", "object-inspect": "^1.12.0", @@ -23619,6 +23515,15 @@ "unbox-primitive": "^1.0.1" } }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -23631,9 +23536,9 @@ } }, "es5-ext": { - "version": "0.10.59", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.59.tgz", - "integrity": "sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw==", + "version": "0.10.61", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", "dev": true, "requires": { "es6-iterator": "^2.0.3", @@ -23977,13 +23882,13 @@ } }, "eslint-plugin-mocha": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.0.3.tgz", - "integrity": "sha512-9mM7PZGxfejpjey+MrG0Cu3Lc8MyA5E2s7eUCdHXgS4SY/H9zLuwa7wVAjnEaoDjbBilA+0bPEB+iMO7lBUPcg==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.0.4.tgz", + "integrity": "sha512-8wzAeepVY027oBHz/TmBmUr7vhVqoC1KTFeDybFLhbaWKx+aQ7fJJVuUsqcUy+L+G+XvgQBJY+cbAf7hl5DF7Q==", "dev": true, "requires": { "eslint-utils": "^3.0.0", - "ramda": "^0.27.1" + "ramda": "^0.28.0" }, "dependencies": { "eslint-utils": { @@ -25000,60 +24905,49 @@ } }, "express": { - "version": "4.17.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", - "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", + "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", "dev": true, "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.2", + "body-parser": "1.20.0", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.2", + "cookie": "0.5.0", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "~1.1.2", + "depd": "2.0.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "~1.1.2", + "finalhandler": "1.2.0", "fresh": "0.5.2", + "http-errors": "2.0.0", "merge-descriptors": "1.0.1", "methods": "~1.1.2", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.9.7", + "qs": "6.10.3", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.17.2", - "serve-static": "1.14.2", + "send": "0.18.0", + "serve-static": "1.15.0", "setprototypeof": "1.2.0", - "statuses": "~1.5.0", + "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" }, "dependencies": { - "body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" - } + "cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "dev": true }, "debug": { "version": "2.6.9", @@ -25064,29 +24958,19 @@ "ms": "2.0.0" } }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "dev": true, "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" } }, "ms": { @@ -25095,52 +24979,20 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true - }, - "raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "1.8.1", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } - } } } }, @@ -25256,9 +25108,9 @@ "dev": true }, "fast-check": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.24.0.tgz", - "integrity": "sha512-iNXbN90lbabaCUfnW5jyXYPwMJLFYl09eJDkXA9ZoidFlBK63gNRvcKxv+8D1OJ1kIYjwBef4bO/K3qesUeWLQ==", + "version": "2.25.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.25.0.tgz", + "integrity": "sha512-wRUT2KD2lAmT75WNIJIHECawoUUMHM0I5jrlLXGtGeqmPL8jl/EldUDjY1VCp6fDY8yflyfUeIOsOBrIbIiArg==", "dev": true, "requires": { "pure-rand": "^5.0.1" @@ -26116,9 +25968,9 @@ } }, "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true }, "has-flag": { @@ -26127,6 +25979,15 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.1" + } + }, "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", @@ -26393,9 +26254,9 @@ } }, "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "requires": { "agent-base": "6", @@ -26709,9 +26570,9 @@ "dev": true }, "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "requires": { "has": "^1.0.3" @@ -27316,13 +27177,13 @@ } }, "live-server": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/live-server/-/live-server-1.2.1.tgz", - "integrity": "sha512-Yn2XCVjErTkqnM3FfTmM7/kWy3zP7+cEtC7x6u+wUzlQ+1UW3zEYbbyJrc0jNDwiMDZI0m4a0i3dxlGHVyXczw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/live-server/-/live-server-1.2.2.tgz", + "integrity": "sha512-t28HXLjITRGoMSrCOv4eZ88viHaBVIjKjdI5PO92Vxlu+twbk6aE0t7dVIaz6ZWkjPilYFV6OSdMYl9ybN2B4w==", "dev": true, "requires": { "chokidar": "^2.0.4", - "colors": "latest", + "colors": "1.4.0", "connect": "^3.6.6", "cors": "latest", "event-stream": "3.3.4", @@ -28750,9 +28611,9 @@ } }, "obliterator": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.2.tgz", - "integrity": "sha512-g0TrA7SbUggROhDPK8cEu/qpItwH2LSKcNl4tlfBNT54XY+nOsqrs0Q68h1V9b3HOSpIWv15jb1lax2hAggdIg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.3.tgz", + "integrity": "sha512-qN5lHhArxl/789Bp3XCpssAYy7cvOdRzxzflmGEJaiipAT2b/USr1XvKjYyssPOwQ/3KjV1e8Ed9po9rie6E6A==", "dev": true }, "oboe": { @@ -29301,9 +29162,9 @@ "dev": true }, "ramda": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.2.tgz", - "integrity": "sha512-SbiLPU40JuJniHexQSAgad32hfwd+DRUdwF2PlVuI5RZD0/vahUco7R8vD86J/tcEKKF9vZrUVwgtmGCqlCKyA==", + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.28.0.tgz", + "integrity": "sha512-9QnLuG/kPVgWvMQ4aODhsBUFKOUmnbUnsSXACv+NCQZcHbeb+v8Lodp8OVxtRULN1/xOyYLLaL6npE6dMq5QTA==", "dev": true }, "randombytes": { @@ -29878,9 +29739,9 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -30046,86 +29907,15 @@ } }, "serve-static": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", - "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "dev": true, "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.17.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "1.8.1", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - } - } + "send": "0.18.0" } }, "servify": { @@ -30999,9 +30789,9 @@ } }, "solidity-ast": { - "version": "0.4.31", - "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.31.tgz", - "integrity": "sha512-kX6o4XE4ihaqENuRRTMJfwQNHoqWusPENZUlX4oVb19gQdfi7IswFWnThONHSW/61umgfWdKtCBgW45iuOTryQ==", + "version": "0.4.32", + "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.32.tgz", + "integrity": "sha512-vCx17410X+NMnpLVyg6ix4NMCHFIkvWrJb1rPBBeQYEQChX93Zgb9WB9NaIY4zpsr3Q8IvAfohw+jmuBzGf8OQ==", "dev": true }, "solidity-comments-extractor": { @@ -31011,9 +30801,9 @@ "dev": true }, "solidity-coverage": { - "version": "0.7.20", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.7.20.tgz", - "integrity": "sha512-edOXTugUYdqxrtEnIn4vgrGjLPxdexcL0WD8LzAvVA3d1dwgcfRO3k8xQR02ZQnOnWMBi8Cqs0F+kAQQp3JW8g==", + "version": "0.7.21", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.7.21.tgz", + "integrity": "sha512-O8nuzJ9yXiKUx3NdzVvHrUW0DxoNVcGzq/I7NzewNO9EZE3wYAQ4l8BwcnV64r4aC/HB6Vnw/q2sF0BQHv/3fg==", "dev": true, "requires": { "@solidity-parser/parser": "^0.14.0", @@ -31965,9 +31755,9 @@ } }, "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, "tsort": { @@ -32050,9 +31840,9 @@ } }, "uglify-js": { - "version": "3.15.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.3.tgz", - "integrity": "sha512-6iCVm2omGJbsu3JWac+p6kUiOpg3wFO2f8lIXjfEb8RrmLjzog1wTPMmwKB7swfzzqxj9YM+sGUM++u1qN4qJg==", + "version": "3.15.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz", + "integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==", "dev": true, "optional": true }, @@ -32063,21 +31853,21 @@ "dev": true }, "unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" } }, "underscore": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz", - "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.3.tgz", + "integrity": "sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA==", "dev": true }, "undici": { @@ -32306,24 +32096,24 @@ } }, "web3": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.7.1.tgz", - "integrity": "sha512-RKVdyZ5FuVEykj62C1o2tc0teJciSOh61jpVB9yb344dBHO3ZV4XPPP24s/PPqIMXmVFN00g2GD9M/v1SoHO/A==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.7.3.tgz", + "integrity": "sha512-UgBvQnKIXncGYzsiGacaiHtm0xzQ/JtGqcSO/ddzQHYxnNuwI72j1Pb4gskztLYihizV9qPNQYHMSCiBlStI9A==", "dev": true, "requires": { - "web3-bzz": "1.7.1", - "web3-core": "1.7.1", - "web3-eth": "1.7.1", - "web3-eth-personal": "1.7.1", - "web3-net": "1.7.1", - "web3-shh": "1.7.1", - "web3-utils": "1.7.1" + "web3-bzz": "1.7.3", + "web3-core": "1.7.3", + "web3-eth": "1.7.3", + "web3-eth-personal": "1.7.3", + "web3-net": "1.7.3", + "web3-shh": "1.7.3", + "web3-utils": "1.7.3" } }, "web3-bzz": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.7.1.tgz", - "integrity": "sha512-sVeUSINx4a4pfdnT+3ahdRdpDPvZDf4ZT/eBF5XtqGWq1mhGTl8XaQAk15zafKVm6Onq28vN8abgB/l+TrG8kA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.7.3.tgz", + "integrity": "sha512-y2i2IW0MfSqFc1JBhBSQ59Ts9xE30hhxSmLS13jLKWzie24/An5dnoGarp2rFAy20tevJu1zJVPYrEl14jiL5w==", "dev": true, "requires": { "@types/node": "^12.12.6", @@ -32332,26 +32122,26 @@ }, "dependencies": { "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true } } }, "web3-core": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.7.1.tgz", - "integrity": "sha512-HOyDPj+4cNyeNPwgSeUkhtS0F+Pxc2obcm4oRYPW5ku6jnTO34pjaij0us+zoY3QEusR8FfAKVK1kFPZnS7Dzw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.7.3.tgz", + "integrity": "sha512-4RNxueGyevD1XSjdHE57vz/YWRHybpcd3wfQS33fgMyHZBVLFDNwhn+4dX4BeofVlK/9/cmPAokLfBUStZMLdw==", "dev": true, "requires": { "@types/bn.js": "^4.11.5", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-core-requestmanager": "1.7.1", - "web3-utils": "1.7.1" + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-core-requestmanager": "1.7.3", + "web3-utils": "1.7.3" }, "dependencies": { "@types/bn.js": { @@ -32364,9 +32154,9 @@ } }, "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true }, "bignumber.js": { @@ -32378,88 +32168,88 @@ } }, "web3-core-helpers": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.7.1.tgz", - "integrity": "sha512-xn7Sx+s4CyukOJdlW8bBBDnUCWndr+OCJAlUe/dN2wXiyaGRiCWRhuQZrFjbxLeBt1fYFH7uWyYHhYU6muOHgw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.7.3.tgz", + "integrity": "sha512-qS2t6UKLhRV/6C7OFHtMeoHphkcA+CKUr2vfpxy4hubs3+Nj28K9pgiqFuvZiXmtEEwIAE2A28GBOC3RdcSuFg==", "dev": true, "requires": { - "web3-eth-iban": "1.7.1", - "web3-utils": "1.7.1" + "web3-eth-iban": "1.7.3", + "web3-utils": "1.7.3" } }, "web3-core-method": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.7.1.tgz", - "integrity": "sha512-383wu5FMcEphBFl5jCjk502JnEg3ugHj7MQrsX7DY76pg5N5/dEzxeEMIJFCN6kr5Iq32NINOG3VuJIyjxpsEg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.7.3.tgz", + "integrity": "sha512-SeF8YL/NVFbj/ddwLhJeS0io8y7wXaPYA2AVT0h2C2ESYkpvOtQmyw2Bc3aXxBmBErKcbOJjE2ABOKdUmLSmMA==", "dev": true, "requires": { "@ethersproject/transactions": "^5.0.0-beta.135", - "web3-core-helpers": "1.7.1", - "web3-core-promievent": "1.7.1", - "web3-core-subscriptions": "1.7.1", - "web3-utils": "1.7.1" + "web3-core-helpers": "1.7.3", + "web3-core-promievent": "1.7.3", + "web3-core-subscriptions": "1.7.3", + "web3-utils": "1.7.3" } }, "web3-core-promievent": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.7.1.tgz", - "integrity": "sha512-Vd+CVnpPejrnevIdxhCkzMEywqgVbhHk/AmXXceYpmwA6sX41c5a65TqXv1i3FWRJAz/dW7oKz9NAzRIBAO/kA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.7.3.tgz", + "integrity": "sha512-+mcfNJLP8h2JqcL/UdMGdRVfTdm+bsoLzAFtLpazE4u9kU7yJUgMMAqnK59fKD3Zpke3DjaUJKwz1TyiGM5wig==", "dev": true, "requires": { "eventemitter3": "4.0.4" } }, "web3-core-requestmanager": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.7.1.tgz", - "integrity": "sha512-/EHVTiMShpZKiq0Jka0Vgguxi3vxq1DAHKxg42miqHdUsz4/cDWay2wGALDR2x3ofDB9kqp7pb66HsvQImQeag==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.7.3.tgz", + "integrity": "sha512-bC+jeOjPbagZi2IuL1J5d44f3zfPcgX+GWYUpE9vicNkPUxFBWRG+olhMo7L+BIcD57cTmukDlnz+1xBULAjFg==", "dev": true, "requires": { "util": "^0.12.0", - "web3-core-helpers": "1.7.1", - "web3-providers-http": "1.7.1", - "web3-providers-ipc": "1.7.1", - "web3-providers-ws": "1.7.1" + "web3-core-helpers": "1.7.3", + "web3-providers-http": "1.7.3", + "web3-providers-ipc": "1.7.3", + "web3-providers-ws": "1.7.3" } }, "web3-core-subscriptions": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.7.1.tgz", - "integrity": "sha512-NZBsvSe4J+Wt16xCf4KEtBbxA9TOwSVr8KWfUQ0tC2KMdDYdzNswl0Q9P58xaVuNlJ3/BH+uDFZJJ5E61BSA1Q==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.7.3.tgz", + "integrity": "sha512-/i1ZCLW3SDxEs5mu7HW8KL4Vq7x4/fDXY+yf/vPoDljlpvcLEOnI8y9r7om+0kYwvuTlM6DUHHafvW0221TyRQ==", "dev": true, "requires": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.7.1" + "web3-core-helpers": "1.7.3" } }, "web3-eth": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.7.1.tgz", - "integrity": "sha512-Uz3gO4CjTJ+hMyJZAd2eiv2Ur1uurpN7sTMATWKXYR/SgG+SZgncnk/9d8t23hyu4lyi2GiVL1AqVqptpRElxg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.7.3.tgz", + "integrity": "sha512-BCIRMPwaMlTCbswXyGT6jj9chCh9RirbDFkPtvqozfQ73HGW7kP78TXXf9+Xdo1GjutQfxi/fQ9yPdxtDJEpDA==", "dev": true, "requires": { - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-core-subscriptions": "1.7.1", - "web3-eth-abi": "1.7.1", - "web3-eth-accounts": "1.7.1", - "web3-eth-contract": "1.7.1", - "web3-eth-ens": "1.7.1", - "web3-eth-iban": "1.7.1", - "web3-eth-personal": "1.7.1", - "web3-net": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-core-subscriptions": "1.7.3", + "web3-eth-abi": "1.7.3", + "web3-eth-accounts": "1.7.3", + "web3-eth-contract": "1.7.3", + "web3-eth-ens": "1.7.3", + "web3-eth-iban": "1.7.3", + "web3-eth-personal": "1.7.3", + "web3-net": "1.7.3", + "web3-utils": "1.7.3" } }, "web3-eth-abi": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.1.tgz", - "integrity": "sha512-8BVBOoFX1oheXk+t+uERBibDaVZ5dxdcefpbFTWcBs7cdm0tP8CD1ZTCLi5Xo+1bolVHNH2dMSf/nEAssq5pUA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.3.tgz", + "integrity": "sha512-ZlD8DrJro0ocnbZViZpAoMX44x5aYAb73u2tMq557rMmpiluZNnhcCYF/NnVMy6UIkn7SF/qEA45GXA1ne6Tnw==", "dev": true, "requires": { "@ethersproject/abi": "5.0.7", - "web3-utils": "1.7.1" + "web3-utils": "1.7.3" }, "dependencies": { "@ethersproject/abi": { @@ -32482,9 +32272,9 @@ } }, "web3-eth-accounts": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.7.1.tgz", - "integrity": "sha512-3xGQ2bkTQc7LFoqGWxp5cQDrKndlX05s7m0rAFVoyZZODMqrdSGjMPMqmWqHzJRUswNEMc+oelqSnGBubqhguQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.7.3.tgz", + "integrity": "sha512-aDaWjW1oJeh0LeSGRVyEBiTe/UD2/cMY4dD6pQYa8dOhwgMtNQjxIQ7kacBBXe7ZKhjbIFZDhvXN4mjXZ82R2Q==", "dev": true, "requires": { "@ethereumjs/common": "^2.5.0", @@ -32494,10 +32284,10 @@ "ethereumjs-util": "^7.0.10", "scrypt-js": "^3.0.1", "uuid": "3.3.2", - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-utils": "1.7.3" }, "dependencies": { "eth-lib": { @@ -32520,19 +32310,19 @@ } }, "web3-eth-contract": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.7.1.tgz", - "integrity": "sha512-HpnbkPYkVK3lOyos2SaUjCleKfbF0SP3yjw7l551rAAi5sIz/vwlEzdPWd0IHL7ouxXbO0tDn7jzWBRcD3sTbA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.7.3.tgz", + "integrity": "sha512-7mjkLxCNMWlQrlfM/MmNnlKRHwFk5XrZcbndoMt3KejcqDP6dPHi2PZLutEcw07n/Sk8OMpSamyF3QiGfmyRxw==", "dev": true, "requires": { "@types/bn.js": "^4.11.5", - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-core-promievent": "1.7.1", - "web3-core-subscriptions": "1.7.1", - "web3-eth-abi": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-core-promievent": "1.7.3", + "web3-core-subscriptions": "1.7.3", + "web3-eth-abi": "1.7.3", + "web3-utils": "1.7.3" }, "dependencies": { "@types/bn.js": { @@ -32547,111 +32337,111 @@ } }, "web3-eth-ens": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.7.1.tgz", - "integrity": "sha512-DVCF76i9wM93DrPQwLrYiCw/UzxFuofBsuxTVugrnbm0SzucajLLNftp3ITK0c4/lV3x9oo5ER/wD6RRMHQnvw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.7.3.tgz", + "integrity": "sha512-q7+hFGHIc0mBI3LwgRVcLCQmp6GItsWgUtEZ5bjwdjOnJdbjYddm7PO9RDcTDQ6LIr7hqYaY4WTRnDHZ6BEt5Q==", "dev": true, "requires": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-promievent": "1.7.1", - "web3-eth-abi": "1.7.1", - "web3-eth-contract": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-promievent": "1.7.3", + "web3-eth-abi": "1.7.3", + "web3-eth-contract": "1.7.3", + "web3-utils": "1.7.3" } }, "web3-eth-iban": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.7.1.tgz", - "integrity": "sha512-XG4I3QXuKB/udRwZdNEhdYdGKjkhfb/uH477oFVMLBqNimU/Cw8yXUI5qwFKvBHM+hMQWfzPDuSDEDKC2uuiMg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.7.3.tgz", + "integrity": "sha512-1GPVWgajwhh7g53mmYDD1YxcftQniIixMiRfOqlnA1w0mFGrTbCoPeVaSQ3XtSf+rYehNJIZAUeDBnONVjXXmg==", "dev": true, "requires": { "bn.js": "^4.11.9", - "web3-utils": "1.7.1" + "web3-utils": "1.7.3" } }, "web3-eth-personal": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.1.tgz", - "integrity": "sha512-02H6nFBNfNmFjMGZL6xcDi0r7tUhxrUP91FTFdoLyR94eIJDadPp4rpXfG7MVES873i1PReh4ep5pSCHbc3+Pg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.3.tgz", + "integrity": "sha512-iTLz2OYzEsJj2qGE4iXC1Gw+KZN924fTAl0ESBFs2VmRhvVaM7GFqZz/wx7/XESl3GVxGxlRje3gNK0oGIoYYQ==", "dev": true, "requires": { "@types/node": "^12.12.6", - "web3-core": "1.7.1", - "web3-core-helpers": "1.7.1", - "web3-core-method": "1.7.1", - "web3-net": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-helpers": "1.7.3", + "web3-core-method": "1.7.3", + "web3-net": "1.7.3", + "web3-utils": "1.7.3" }, "dependencies": { "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.50.tgz", + "integrity": "sha512-+9axpWx2b2JCVovr7Ilgt96uc6C1zBKOQMpGtRbWT9IoR/8ue32GGMfGA4woP8QyP2gBs6GQWEVM3tCybGCxDA==", "dev": true } } }, "web3-net": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.7.1.tgz", - "integrity": "sha512-8yPNp2gvjInWnU7DCoj4pIPNhxzUjrxKlODsyyXF8j0q3Z2VZuQp+c63gL++r2Prg4fS8t141/HcJw4aMu5sVA==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.7.3.tgz", + "integrity": "sha512-zAByK0Qrr71k9XW0Adtn+EOuhS9bt77vhBO6epAeQ2/VKl8rCGLAwrl3GbeEl7kWa8s/su72cjI5OetG7cYR0g==", "dev": true, "requires": { - "web3-core": "1.7.1", - "web3-core-method": "1.7.1", - "web3-utils": "1.7.1" + "web3-core": "1.7.3", + "web3-core-method": "1.7.3", + "web3-utils": "1.7.3" } }, "web3-providers-http": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.7.1.tgz", - "integrity": "sha512-dmiO6G4dgAa3yv+2VD5TduKNckgfR97VI9YKXVleWdcpBoKXe2jofhdvtafd42fpIoaKiYsErxQNcOC5gI/7Vg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.7.3.tgz", + "integrity": "sha512-TQJfMsDQ5Uq9zGMYlu7azx1L7EvxW+Llks3MaWn3cazzr5tnrDbGh6V17x6LN4t8tFDHWx0rYKr3mDPqyTjOZw==", "dev": true, "requires": { - "web3-core-helpers": "1.7.1", + "web3-core-helpers": "1.7.3", "xhr2-cookies": "1.1.0" } }, "web3-providers-ipc": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.7.1.tgz", - "integrity": "sha512-uNgLIFynwnd5M9ZC0lBvRQU5iLtU75hgaPpc7ZYYR+kjSk2jr2BkEAQhFVJ8dlqisrVmmqoAPXOEU0flYZZgNQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.7.3.tgz", + "integrity": "sha512-Z4EGdLKzz6I1Bw+VcSyqVN4EJiT2uAro48Am1eRvxUi4vktGoZtge1ixiyfrRIVb6nPe7KnTFl30eQBtMqS0zA==", "dev": true, "requires": { "oboe": "2.1.5", - "web3-core-helpers": "1.7.1" + "web3-core-helpers": "1.7.3" } }, "web3-providers-ws": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.7.1.tgz", - "integrity": "sha512-Uj0n5hdrh0ESkMnTQBsEUS2u6Unqdc7Pe4Zl+iZFb7Yn9cIGsPJBl7/YOP4137EtD5ueXAv+MKwzcelpVhFiFg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.7.3.tgz", + "integrity": "sha512-PpykGbkkkKtxPgv7U4ny4UhnkqSZDfLgBEvFTXuXLAngbX/qdgfYkhIuz3MiGplfL7Yh93SQw3xDjImXmn2Rgw==", "dev": true, "requires": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.7.1", + "web3-core-helpers": "1.7.3", "websocket": "^1.0.32" } }, "web3-shh": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.7.1.tgz", - "integrity": "sha512-NO+jpEjo8kYX6c7GiaAm57Sx93PLYkWYUCWlZmUOW7URdUcux8VVluvTWklGPvdM9H1WfDrol91DjuSW+ykyqg==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.7.3.tgz", + "integrity": "sha512-bQTSKkyG7GkuULdZInJ0osHjnmkHij9tAySibpev1XjYdjLiQnd0J9YGF4HjvxoG3glNROpuCyTaRLrsLwaZuw==", "dev": true, "requires": { - "web3-core": "1.7.1", - "web3-core-method": "1.7.1", - "web3-core-subscriptions": "1.7.1", - "web3-net": "1.7.1" + "web3-core": "1.7.3", + "web3-core-method": "1.7.3", + "web3-core-subscriptions": "1.7.3", + "web3-net": "1.7.3" } }, "web3-utils": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.1.tgz", - "integrity": "sha512-fef0EsqMGJUgiHPdX+KN9okVWshbIumyJPmR+btnD1HgvoXijKEkuKBv0OmUqjbeqmLKP2/N9EiXKJel5+E1Dw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.3.tgz", + "integrity": "sha512-g6nQgvb/bUpVUIxJE+ezVN+rYwYmlFyMvMIRSuqpi1dk6ApDD00YNArrk7sPcZnjvxOJ76813Xs2vIN2rgh4lg==", "dev": true, "requires": { "bn.js": "^4.11.9", @@ -32984,9 +32774,9 @@ "dev": true }, "yargs": { - "version": "17.4.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.0.tgz", - "integrity": "sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA==", + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", + "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", "dev": true, "requires": { "cliui": "^7.0.2", From 4574ce45b65c780afea020cdac2c6e99230d8609 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 4 May 2022 18:19:04 -0300 Subject: [PATCH 60/81] Add a cross-chain guide for the documentation (#3325) --- .../crosschain/amb/CrossChainEnabledAMB.sol | 18 +- docs/modules/ROOT/nav.adoc | 2 + docs/modules/ROOT/pages/crosschain.adoc | 210 ++++++++++++++++++ 3 files changed, 221 insertions(+), 9 deletions(-) create mode 100644 docs/modules/ROOT/pages/crosschain.adoc diff --git a/contracts/crosschain/amb/CrossChainEnabledAMB.sol b/contracts/crosschain/amb/CrossChainEnabledAMB.sol index 1ff551705..94e8a1354 100644 --- a/contracts/crosschain/amb/CrossChainEnabledAMB.sol +++ b/contracts/crosschain/amb/CrossChainEnabledAMB.sol @@ -12,15 +12,15 @@ import "./LibAMB.sol"; * * As of february 2020, AMB bridges are available between the following chains: * - * - https://docs.tokenbridge.net/eth-xdai-amb-bridge/about-the-eth-xdai-amb[ETH <> xDai] - * - https://docs.tokenbridge.net/eth-qdai-bridge/about-the-eth-qdai-amb[ETH <> qDai] - * - https://docs.tokenbridge.net/eth-etc-amb-bridge/about-the-eth-etc-amb[ETH <> ETC] - * - https://docs.tokenbridge.net/eth-bsc-amb/about-the-eth-bsc-amb[ETH <> BSC] - * - https://docs.tokenbridge.net/eth-poa-amb-bridge/about-the-eth-poa-amb[ETH <> POA] - * - https://docs.tokenbridge.net/bsc-xdai-amb/about-the-bsc-xdai-amb[BSC <> xDai] - * - https://docs.tokenbridge.net/poa-xdai-amb/about-the-poa-xdai-amb[POA <> xDai] - * - https://docs.tokenbridge.net/rinkeby-xdai-amb-bridge/about-the-rinkeby-xdai-amb[Rinkeby <> xDai] - * - https://docs.tokenbridge.net/kovan-sokol-amb-bridge/about-the-kovan-sokol-amb[Kovan <> Sokol] + * - https://docs.tokenbridge.net/eth-xdai-amb-bridge/about-the-eth-xdai-amb[ETH ⇌ xDai] + * - https://docs.tokenbridge.net/eth-qdai-bridge/about-the-eth-qdai-amb[ETH ⇌ qDai] + * - https://docs.tokenbridge.net/eth-etc-amb-bridge/about-the-eth-etc-amb[ETH ⇌ ETC] + * - https://docs.tokenbridge.net/eth-bsc-amb/about-the-eth-bsc-amb[ETH ⇌ BSC] + * - https://docs.tokenbridge.net/eth-poa-amb-bridge/about-the-eth-poa-amb[ETH ⇌ POA] + * - https://docs.tokenbridge.net/bsc-xdai-amb/about-the-bsc-xdai-amb[BSC ⇌ xDai] + * - https://docs.tokenbridge.net/poa-xdai-amb/about-the-poa-xdai-amb[POA ⇌ xDai] + * - https://docs.tokenbridge.net/rinkeby-xdai-amb-bridge/about-the-rinkeby-xdai-amb[Rinkeby ⇌ xDai] + * - https://docs.tokenbridge.net/kovan-sokol-amb-bridge/about-the-kovan-sokol-amb[Kovan ⇌ Sokol] * * _Available since v4.6._ */ diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 3804c7d94..6604c2de5 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -16,4 +16,6 @@ * xref:governance.adoc[Governance] +* xref:crosschain.adoc[Crosschain] + * xref:utilities.adoc[Utilities] diff --git a/docs/modules/ROOT/pages/crosschain.adoc b/docs/modules/ROOT/pages/crosschain.adoc new file mode 100644 index 000000000..bcf71f175 --- /dev/null +++ b/docs/modules/ROOT/pages/crosschain.adoc @@ -0,0 +1,210 @@ += Adding cross-chain support to contracts + +If your contract is targetting to be used in the context of multichain operations, you may need specific tools to identify and process these cross-chain operations. + +OpenZeppelin provides the xref:api:crosschain.adoc#CrossChainEnabled[`CrossChainEnabled`] abstract contract, that includes dedicated internal functions. + +In this guide, we will go through an example use case: _how to build an upgradeable & mintable ERC20 token controlled by a governor present on a foreign chain_. + +== Starting point, our ERC20 contract + +Let's start with a small ERC20 contract, that we bootstrapped using the https://wizard.openzeppelin.com/[OpenZeppelin Contracts Wizard], and extended with an owner that has the ability to mint. Note that for demonstration purposes we have not used the built-in `Ownable` contract. + +[source,solidity] +---- +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.4; + +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +contract MyToken is Initializable, ERC20Upgradeable, UUPSUpgradeable { + address public owner; + + modifier onlyOwner() { + require(owner == _msgSender(), "Not authorized"); + _; + } + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() initializer {} + + function initialize(address initialOwner) initializer public { + __ERC20_init("MyToken", "MTK"); + __UUPSUpgradeable_init(); + + owner = initialOwner; + } + + function mint(address to, uint256 amount) public onlyOwner { + _mint(to, amount); + } + + function _authorizeUpgrade(address newImplementation) internal override onlyOwner { + } +} +---- + +This token is mintable and upgradeable by the owner of the contract. + +== Preparing our contract for cross-chain operations. + +Let's now imagine that this contract is going to live on one chain, but we want the minting and the upgrading to be performed by a xref:governance.adoc[`governor`] contract on another chain. + +For example, we could have our token on xDai, with our governor on mainnet, or we could have our token on mainnet, with our governor on optimism + +In order to do that, we will start by adding xref:api:crosschain.adoc#CrossChainEnabled[`CrossChainEnabled`] to our contract. You will notice that the contract is now abstract. This is because `CrossChainEnabled` is an abstract contract: it is not tied to any particular chain and it deals with cross-chain interactions in an abstract way. This is what enables us to easily reuse the code for different chains. We will specialize it later by inheriting from a chain-specific implementation of the abstraction. + +```diff + import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; ++import "@openzeppelin/contracts-upgradeable/crosschain/CrossChainEnabled.sol"; + +-contract MyToken is Initializable, ERC20Upgradeable, UUPSUpgradeable { ++abstract contract MyTokenCrossChain is Initializable, ERC20Upgradeable, UUPSUpgradeable, CrossChainEnabled { +``` + +Once that is done, we can use the `onlyCrossChainSender` modifier, provided by `CrossChainEnabled` in order to protect the minting and upgrading operations. + +```diff +- function mint(address to, uint256 amount) public onlyOwner { ++ function mint(address to, uint256 amount) public onlyCrossChainSender(owner) { + +- function _authorizeUpgrade(address newImplementation) internal override onlyOwner { ++ function _authorizeUpgrade(address newImplementation) internal override onlyCrossChainSender(owner) { +``` + +This change will effectively restrict the mint and upgrade operations to the `owner` on the remote chain. + +== Specializing for a specific chain + +Once the abstract cross-chain version of our token is ready we can easily specialize it for the chain we want, or more precisely for the bridge system that we want to rely on. + +This is done using one of the many `CrossChainEnabled` implementations. + +For example, if our token on xDai, and our governor on mainnet, we can use the https://docs.tokenbridge.net/amb-bridge/about-amb-bridge[AMB] bridge available on xDai at https://blockscout.com/xdai/mainnet/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59[0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59] + +[source,solidity] +---- +[...] + +import "@openzeppelin/contracts-upgradeable/crosschain/amb/CrossChainEnabledAMB.sol"; + +contract MyTokenXDAI is + MyTokenCrossChain, + CrossChainEnabledAMB(0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59) +{} +---- + +If the token is on Ethereum mainnet, and our governor on Optimism, we use the Optimism https://community.optimism.io/docs/protocol/protocol-2.0/#l1crossdomainmessenger[CrossDomainMessenger] available on mainnet at https://etherscan.io/address/0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1[0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1]. + +[source,solidity] +---- +[...] + +import "@openzeppelin/contracts-upgradeable/crosschain/optimismCrossChainEnabledOptimism.sol"; + +contract MyTokenOptimism is + MyTokenCrossChain, + CrossChainEnabledOptimism(0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1) +{} +---- + +== Mixing cross domain addresses is dangerous + +When designing a contract with cross-chain support, it is essential to understand possible fallbacks and the security assumption that are being made. + +In this guide, we are particularly focusing on restricting access to a specific caller. This is usually done (as shown above) using `msg.sender` or `_msgSender()`. However, when going cross-chain, it is not just that simple. Even without considering possible bridge issues, it is important to keep in mind that the same address can correspond to very different entities when considering a multi-chain space. EOA wallets can only execute operations if the wallet's private-key signs the transaction. To our knowledge this is the case in all EVM chains, so a cross-chain message coming from such a wallet is arguably equivalent to a non-cross-chain message by the same wallet. The situation is however very different for smart contracts. + +Due to the way smart contract addresses are computed, and the fact that smart contracts on different chains live independent lives, you could have two very different contracts live at the same address on different chains. You could imagine two multisig wallets with different signers use the same address on different chains. You could also see a very basic smart wallet live on one chain at the same address as a full-fledge governor on another chain. Therefore, you should be careful that whenever you give permissions to a specific address, you control with chain this address can act from. + +== Going further with access control + +In previous example, we have both a `onlyOwner()` modifier and the `onlyCrossChainSender(owner)` mechanism. We didn't use the xref:access-control.adoc#ownership-and-ownable[`Ownable`] pattern because the ownership transfer mechanism in includes is not designed to work with the owner being a cross-chain entity. Unlike xref:access-control.adoc#ownership-and-ownable[`Ownable`], xref:access-control.adoc#role-based-access-control[`AccessControl`] is more effective at capturing the nuances and can effectivelly be used to build cross-chain-aware contracts. + +Using xref:api:access.adoc#AccessControlCrossChain[`AccessControlCrossChain`] includes both the xref:api:access.adoc#AccessControl[`AccessControl`] core and the xref:api:crosschain.adoc#CrossChainEnabled[`CrossChainEnabled`] abstraction. It also includes some binding to make role management compatible with cross-chain operations. + +In the case of the `mint` function, the caller must have the `MINTER_ROLE` when the call originates from the same chain. If the caller is on a remote chain, then the caller should not have the `MINTER_ROLE`, but the "aliased" version (`MINTER_ROLE ^ CROSSCHAIN_ALIAS`). This mitigates the danger described in the previous section by strictly separating local accounts from remote accounts from a different chain. See the xref:api:access.adoc#AccessControlCrossChain[`AccessControlCrossChain`] documentation for more details. + + +```diff + import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; + import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; ++import "@openzeppelin/contracts-upgradeable/access/AccessControlCrossChainUpgradeable.sol"; + +-abstract contract MyTokenCrossChain is Initializable, ERC20Upgradeable, UUPSUpgradeable, CrossChainEnabled { ++abstract contract MyTokenCrossChain is Initializable, ERC20Upgradeable, UUPSUpgradeable, AccessControlCrossChainUpgradeable { + +- address public owner; +- modifier onlyOwner() { +- require(owner == _msgSender(), "Not authorized"); +- _; +- } + ++ bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); ++ bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE"); + + function initialize(address initialOwner) initializer public { + __ERC20_init("MyToken", "MTK"); + __UUPSUpgradeable_init(); ++ __AccessControl_init(); ++ _grantRole(_crossChainRoleAlias(DEFAULT_ADMIN_ROLE), initialOwner); // initialOwner is on a remote chain +- owner = initialOwner; + } + +- function mint(address to, uint256 amount) public onlyCrossChainSender(owner) { ++ function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) { + +- function _authorizeUpgrade(address newImplementation) internal override onlyCrossChainSender(owner) { ++ function _authorizeUpgrade(address newImplementation) internal override onlyRole(UPGRADER_ROLE) { +``` + +This results in the following, final, code: + +[source,solidity] +---- +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.4; + +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/access/AccessControlCrossChainUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +abstract contract MyTokenCrossChain is Initializable, ERC20Upgradeable, AccessControlCrossChainUpgradeable, UUPSUpgradeable { + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE"); + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() initializer {} + + function initialize(address initialOwner) initializer public { + __ERC20_init("MyToken", "MTK"); + __AccessControl_init(); + __UUPSUpgradeable_init(); + + _grantRole(_crossChainRoleAlias(DEFAULT_ADMIN_ROLE), initialOwner); // initialOwner is on a remote chain + } + + function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) { + _mint(to, amount); + } + + function _authorizeUpgrade(address newImplementation) internal onlyRole(UPGRADER_ROLE) override { + } +} + +import "@openzeppelin/contracts-upgradeable/crosschain/amb/CrossChainEnabledAMB.sol"; + +contract MyTokenXDAI is + MyTokenCrossChain, + CrossChainEnabledAMB(0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59) +{} + +import "@openzeppelin/contracts-upgradeable/crosschain/optimismCrossChainEnabledOptimism.sol"; + +contract MyTokenOptimism is + MyTokenCrossChain, + CrossChainEnabledOptimism(0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1) +{} +---- From 07b1b472c0ac3e50963c8d52cd2dac6e7e05260c Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 4 May 2022 18:20:59 -0300 Subject: [PATCH 61/81] Improve wording consistency in code/doc (#3365) --- contracts/finance/VestingWallet.sol | 4 ++-- contracts/governance/Governor.sol | 2 +- contracts/governance/IGovernor.sol | 4 ++-- .../interfaces/IERC3156FlashBorrower.sol | 2 +- contracts/security/PullPayment.sol | 4 ++++ contracts/token/ERC1155/ERC1155.sol | 8 +++++++- contracts/token/ERC20/ERC20.sol | 2 +- contracts/token/ERC721/ERC721.sol | 20 +++++++++---------- contracts/token/ERC777/ERC777.sol | 3 ++- contracts/utils/escrow/Escrow.sol | 4 ++++ 10 files changed, 34 insertions(+), 19 deletions(-) diff --git a/contracts/finance/VestingWallet.sol b/contracts/finance/VestingWallet.sol index 0e49ab8d3..120b732cf 100644 --- a/contracts/finance/VestingWallet.sol +++ b/contracts/finance/VestingWallet.sol @@ -84,7 +84,7 @@ contract VestingWallet is Context { /** * @dev Release the native token (ether) that have already vested. * - * Emits a {TokensReleased} event. + * Emits a {EtherReleased} event. */ function release() public virtual { uint256 releasable = vestedAmount(uint64(block.timestamp)) - released(); @@ -96,7 +96,7 @@ contract VestingWallet is Context { /** * @dev Release the tokens that have already vested. * - * Emits a {TokensReleased} event. + * Emits a {ERC20Released} event. */ function release(address token) public virtual { uint256 releasable = vestedAmount(token, uint64(block.timestamp)) - released(token); diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index 239b7fb7c..fd4f5a294 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -217,7 +217,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive ) internal view virtual returns (uint256); /** - * @dev Register a vote with a given support and voting weight. + * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`. * * Note: Support is generic and can represent various things depending on the voting system used. */ diff --git a/contracts/governance/IGovernor.sol b/contracts/governance/IGovernor.sol index 47a831690..a7db9aca4 100644 --- a/contracts/governance/IGovernor.sol +++ b/contracts/governance/IGovernor.sol @@ -237,7 +237,7 @@ abstract contract IGovernor is IERC165 { /** * @dev Cast a vote with a reason and additional encoded parameters * - * Emits a {VoteCast} event. + * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params. */ function castVoteWithReasonAndParams( uint256 proposalId, @@ -262,7 +262,7 @@ abstract contract IGovernor is IERC165 { /** * @dev Cast a vote with a reason and additional encoded parameters using the user's cryptographic signature. * - * Emits a {VoteCast} event. + * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params. */ function castVoteWithReasonAndParamsBySig( uint256 proposalId, diff --git a/contracts/interfaces/IERC3156FlashBorrower.sol b/contracts/interfaces/IERC3156FlashBorrower.sol index 68d0dacf4..28b30edaf 100644 --- a/contracts/interfaces/IERC3156FlashBorrower.sol +++ b/contracts/interfaces/IERC3156FlashBorrower.sol @@ -17,7 +17,7 @@ interface IERC3156FlashBorrower { * @param amount The amount of tokens lent. * @param fee The additional amount of tokens to repay. * @param data Arbitrary data structure, intended to contain user-defined parameters. - * @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan" + * @return The keccak256 hash of "IERC3156FlashBorrower.onFlashLoan" */ function onFlashLoan( address initiator, diff --git a/contracts/security/PullPayment.sol b/contracts/security/PullPayment.sol index 6a50f2cb2..fb0ccffcb 100644 --- a/contracts/security/PullPayment.sol +++ b/contracts/security/PullPayment.sol @@ -43,6 +43,8 @@ abstract contract PullPayment { * checks-effects-interactions pattern or using {ReentrancyGuard}. * * @param payee Whose payments will be withdrawn. + * + * Causes the `escrow` to emits a {Withdrawn} event. */ function withdrawPayments(address payable payee) public virtual { _escrow.withdraw(payee); @@ -63,6 +65,8 @@ abstract contract PullPayment { * * @param dest The destination address of the funds. * @param amount The amount to transfer. + * + * Causes the `escrow` to emits a {Deposited} event. */ function _asyncTransfer(address dest, uint256 amount) internal virtual { _escrow.deposit{value: amount}(dest); diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index ba7eb99cc..573d30456 100644 --- a/contracts/token/ERC1155/ERC1155.sol +++ b/contracts/token/ERC1155/ERC1155.sol @@ -288,6 +288,8 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * + * Emits a {TransferBatch} event. + * * Requirements: * * - `ids` and `amounts` must have the same length. @@ -321,6 +323,8 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { /** * @dev Destroys `amount` tokens of token type `id` from `from` * + * Emits a {TransferSingle} event. + * * Requirements: * * - `from` cannot be the zero address. @@ -353,6 +357,8 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * + * Emits a {TransferBatch} event. + * * Requirements: * * - `ids` and `amounts` must have the same length. @@ -405,7 +411,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single - * transfers, the length of the `id` and `amount` arrays will be 1. + * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 2073a3aa8..f782c90b9 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -210,7 +210,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata { } /** - * @dev Moves `amount` of tokens from `sender` to `recipient`. + * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 27af09ece..3932b4913 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -176,17 +176,17 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { address from, address to, uint256 tokenId, - bytes memory _data + bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); - _safeTransfer(from, to, tokenId, _data); + _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * - * `_data` is additional data, it has no specified format and it is sent in call to `to`. + * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. @@ -204,10 +204,10 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { address from, address to, uint256 tokenId, - bytes memory _data + bytes memory data ) internal virtual { _transfer(from, to, tokenId); - require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); + require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** @@ -256,11 +256,11 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { function _safeMint( address to, uint256 tokenId, - bytes memory _data + bytes memory data ) internal virtual { _mint(to, tokenId); require( - _checkOnERC721Received(address(0), to, tokenId, _data), + _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } @@ -382,17 +382,17 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred - * @param _data bytes optional data to send along with the call + * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, - bytes memory _data + bytes memory data ) private returns (bool) { if (to.isContract()) { - try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { + try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { diff --git a/contracts/token/ERC777/ERC777.sol b/contracts/token/ERC777/ERC777.sol index 348efb983..a6216c904 100644 --- a/contracts/token/ERC777/ERC777.sol +++ b/contracts/token/ERC777/ERC777.sol @@ -288,7 +288,8 @@ contract ERC777 is Context, IERC777, IERC20 { * the total supply. * * If a send hook is registered for `account`, the corresponding function - * will be called with `operator`, `data` and `operatorData`. + * will be called with the caller address as the `operator` and with + * `userData` and `operatorData`. * * See {IERC777Sender} and {IERC777Recipient}. * diff --git a/contracts/utils/escrow/Escrow.sol b/contracts/utils/escrow/Escrow.sol index c90a74618..6d6cfd8eb 100644 --- a/contracts/utils/escrow/Escrow.sol +++ b/contracts/utils/escrow/Escrow.sol @@ -34,6 +34,8 @@ contract Escrow is Ownable { /** * @dev Stores the sent amount as credit to be withdrawn. * @param payee The destination address of the funds. + * + * Emits a {Deposited} event. */ function deposit(address payee) public payable virtual onlyOwner { uint256 amount = msg.value; @@ -50,6 +52,8 @@ contract Escrow is Ownable { * checks-effects-interactions pattern or using {ReentrancyGuard}. * * @param payee The address whose funds will be withdrawn and transferred to. + * + * Emits a {Withdrawn} event. */ function withdraw(address payable payee) public virtual onlyOwner { uint256 payment = _deposits[payee]; From 3b9381dfb196b15a1e6406f52ef0700d29fb5be8 Mon Sep 17 00:00:00 2001 From: Mazen Khalil Date: Sat, 7 May 2022 00:46:23 +0300 Subject: [PATCH 62/81] Add customizable fee receiver to ERC20FlashMint (#3327) Co-authored-by: Mazen Khalil Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + contracts/mocks/ERC20FlashMintMock.sol | 28 ++++++++++ .../token/ERC20/extensions/ERC20FlashMint.sol | 18 +++++- .../ERC20/extensions/ERC20FlashMint.test.js | 56 ++++++++++++++++++- 4 files changed, 101 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f978222ff..b856be6bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * `Clones`: optimize clone creation ([#3329](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3329)) * `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317)) * `CrossChainEnabledPolygonChild`: replace the `require` statement with the custom error `NotCrossChainCall`. ([#3380](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3380)) + * `ERC20FlashMint`: Add customizable flash fee receiver. ([#3327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3327)) ## 4.6.0 (2022-04-26) diff --git a/contracts/mocks/ERC20FlashMintMock.sol b/contracts/mocks/ERC20FlashMintMock.sol index 0bb7871fc..c7772601b 100644 --- a/contracts/mocks/ERC20FlashMintMock.sol +++ b/contracts/mocks/ERC20FlashMintMock.sol @@ -5,6 +5,9 @@ pragma solidity ^0.8.0; import "../token/ERC20/extensions/ERC20FlashMint.sol"; contract ERC20FlashMintMock is ERC20FlashMint { + uint256 _flashFeeAmount; + address _flashFeeReceiverAddress; + constructor( string memory name, string memory symbol, @@ -13,4 +16,29 @@ contract ERC20FlashMintMock is ERC20FlashMint { ) ERC20(name, symbol) { _mint(initialAccount, initialBalance); } + + function mint(address account, uint256 amount) public { + _mint(account, amount); + } + + function setFlashFee(uint256 amount) public { + _flashFeeAmount = amount; + } + + function flashFee(address token, uint256 amount) public view virtual override returns (uint256) { + super.flashFee(token, amount); + return _flashFeeAmount; + } + + function setFlashFeeReceiver(address receiver) public { + _flashFeeReceiverAddress = receiver; + } + + function flashFeeReceiver() public view returns (address) { + return _flashFeeReceiver(); + } + + function _flashFeeReceiver() internal view override returns (address) { + return _flashFeeReceiverAddress; + } } diff --git a/contracts/token/ERC20/extensions/ERC20FlashMint.sol b/contracts/token/ERC20/extensions/ERC20FlashMint.sol index dd124fb46..8c8b88c75 100644 --- a/contracts/token/ERC20/extensions/ERC20FlashMint.sol +++ b/contracts/token/ERC20/extensions/ERC20FlashMint.sol @@ -43,6 +43,16 @@ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { return 0; } + /** + * @dev Returns the receiver address of the flash fee. By default this + * implementation returns the address(0) which means the fee amount will be burnt. + * This function can be overloaded to change the fee receiver. + * @return The address for which the flash fee will be sent to. + */ + function _flashFeeReceiver() internal view virtual returns (address) { + return address(0); + } + /** * @dev Performs a flash loan. New tokens are minted and sent to the * `receiver`, who is required to implement the {IERC3156FlashBorrower} @@ -73,8 +83,14 @@ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { receiver.onFlashLoan(msg.sender, token, amount, fee, data) == _RETURN_VALUE, "ERC20FlashMint: invalid return value" ); + address flashFeeReceiver = _flashFeeReceiver(); _spendAllowance(address(receiver), address(this), amount + fee); - _burn(address(receiver), amount + fee); + if (fee == 0 || flashFeeReceiver == address(0)) { + _burn(address(receiver), amount + fee); + } else { + _burn(address(receiver), amount); + _transfer(address(receiver), flashFeeReceiver, fee); + } return true; } } diff --git a/test/token/ERC20/extensions/ERC20FlashMint.test.js b/test/token/ERC20/extensions/ERC20FlashMint.test.js index 0ecc056d6..01c08db59 100644 --- a/test/token/ERC20/extensions/ERC20FlashMint.test.js +++ b/test/token/ERC20/extensions/ERC20FlashMint.test.js @@ -8,7 +8,7 @@ const ERC20FlashMintMock = artifacts.require('ERC20FlashMintMock'); const ERC3156FlashBorrowerMock = artifacts.require('ERC3156FlashBorrowerMock'); contract('ERC20FlashMint', function (accounts) { - const [ initialHolder, other ] = accounts; + const [ initialHolder, other, anotherAccount ] = accounts; const name = 'My Token'; const symbol = 'MTKN'; @@ -40,6 +40,12 @@ contract('ERC20FlashMint', function (accounts) { }); }); + describe('flashFeeReceiver', function () { + it('default receiver', async function () { + expect(await this.token.flashFeeReceiver()).to.be.eq(ZERO_ADDRESS); + }); + }); + describe('flashLoan', function () { it('success', async function () { const receiver = await ERC3156FlashBorrowerMock.new(true, true); @@ -86,5 +92,53 @@ contract('ERC20FlashMint', function (accounts) { // _mint overflow reverts using a panic code. No reason string. await expectRevert.unspecified(this.token.flashLoan(receiver.address, this.token.address, MAX_UINT256, data)); }); + + describe('custom flash fee & custom fee receiver', function () { + const receiverInitialBalance = new BN(200000); + const flashFee = new BN(5000); + + beforeEach('init reciever balance & set flash fee',async function () { + this.receiver = await ERC3156FlashBorrowerMock.new(true, true); + const receipt = await this.token.mint(this.receiver.address, receiverInitialBalance); + await expectEvent(receipt, 'Transfer', { from: ZERO_ADDRESS, to: this.receiver.address, value: receiverInitialBalance }); + expect(await this.token.balanceOf(this.receiver.address)).to.be.bignumber.equal(receiverInitialBalance); + + await this.token.setFlashFee(flashFee); + expect(await this.token.flashFee(this.token.address, loanAmount)).to.be.bignumber.equal(flashFee); + }); + + it('default flash fee receiver', async function () { + const { tx } = await this.token.flashLoan(this.receiver.address, this.token.address, loanAmount, '0x'); + await expectEvent.inTransaction(tx, this.token, 'Transfer', { from: ZERO_ADDRESS, to: this.receiver.address, value: loanAmount }); + await expectEvent.inTransaction(tx, this.token, 'Transfer', { from: this.receiver.address, to: ZERO_ADDRESS, value: loanAmount.add (flashFee)}); + await expectEvent.inTransaction(tx, this.receiver, 'BalanceOf', { token: this.token.address, account: this.receiver.address, value: receiverInitialBalance.add(loanAmount) }); + await expectEvent.inTransaction(tx, this.receiver, 'TotalSupply', { token: this.token.address, value: initialSupply.add (receiverInitialBalance).add(loanAmount) }); + + expect(await this.token.totalSupply()).to.be.bignumber.equal(initialSupply.add(receiverInitialBalance).sub(flashFee)); + expect(await this.token.balanceOf(this.receiver.address)).to.be.bignumber.equal(receiverInitialBalance.sub(flashFee)); + expect(await this.token.balanceOf(await this.token.flashFeeReceiver())).to.be.bignumber.equal('0'); + expect(await this.token.allowance(this.receiver.address, this.token.address)).to.be.bignumber.equal('0'); + }); + + it('custom flash fee receiver', async function () { + const flashFeeReceiverAddress = anotherAccount; + await this.token.setFlashFeeReceiver(flashFeeReceiverAddress); + expect(await this.token.flashFeeReceiver()).to.be.eq(flashFeeReceiverAddress); + + expect(await this.token.balanceOf(flashFeeReceiverAddress)).to.be.bignumber.equal('0'); + + const { tx } = await this.token.flashLoan(this.receiver.address, this.token.address, loanAmount, '0x'); + await expectEvent.inTransaction(tx, this.token, 'Transfer', { from: ZERO_ADDRESS, to: this.receiver.address, value: loanAmount }); + await expectEvent.inTransaction(tx, this.token, 'Transfer', { from: this.receiver.address, to: ZERO_ADDRESS, value: loanAmount }); + await expectEvent.inTransaction(tx, this.token, 'Transfer', { from: this.receiver.address, to: flashFeeReceiverAddress, value: flashFee }); + await expectEvent.inTransaction(tx, this.receiver, 'BalanceOf', { token: this.token.address, account: this.receiver.address, value: receiverInitialBalance.add(loanAmount) }); + await expectEvent.inTransaction(tx, this.receiver, 'TotalSupply', { token: this.token.address, value: initialSupply.add (receiverInitialBalance).add(loanAmount) }); + + expect(await this.token.totalSupply()).to.be.bignumber.equal(initialSupply.add(receiverInitialBalance)); + expect(await this.token.balanceOf(this.receiver.address)).to.be.bignumber.equal(receiverInitialBalance.sub(flashFee)); + expect(await this.token.balanceOf(flashFeeReceiverAddress)).to.be.bignumber.equal(flashFee); + expect(await this.token.allowance(this.receiver.address, flashFeeReceiverAddress)).to.be.bignumber.equal('0'); + }); + }); }); }); From 3bdf4bfd29b145288ec741bef259a384007ed5cf Mon Sep 17 00:00:00 2001 From: Kartik0099 <102043970+Kartik0099@users.noreply.github.com> Date: Sat, 7 May 2022 04:19:02 +0530 Subject: [PATCH 63/81] Annotate Memory-Safe Assembly (#3392) --- contracts/utils/Create2.sol | 1 + contracts/utils/cryptography/ECDSA.sol | 2 ++ contracts/utils/cryptography/MerkleProof.sol | 1 + 3 files changed, 4 insertions(+) diff --git a/contracts/utils/Create2.sol b/contracts/utils/Create2.sol index 40164c1e2..567914b78 100644 --- a/contracts/utils/Create2.sol +++ b/contracts/utils/Create2.sol @@ -35,6 +35,7 @@ library Create2 { address addr; require(address(this).balance >= amount, "Create2: insufficient balance"); require(bytecode.length != 0, "Create2: bytecode length is zero"); + /// @solidity memory-safe-assembly assembly { addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt) } diff --git a/contracts/utils/cryptography/ECDSA.sol b/contracts/utils/cryptography/ECDSA.sol index b2db6bd77..c7115f27a 100644 --- a/contracts/utils/cryptography/ECDSA.sol +++ b/contracts/utils/cryptography/ECDSA.sol @@ -64,6 +64,7 @@ library ECDSA { uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. + /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) @@ -75,6 +76,7 @@ library ECDSA { bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. + /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) diff --git a/contracts/utils/cryptography/MerkleProof.sol b/contracts/utils/cryptography/MerkleProof.sol index db7d5894a..23ef1f077 100644 --- a/contracts/utils/cryptography/MerkleProof.sol +++ b/contracts/utils/cryptography/MerkleProof.sol @@ -56,6 +56,7 @@ library MerkleProof { } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { + /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) From e633ee9ed3fe45290fb02cdc61eaac3c82b6ba76 Mon Sep 17 00:00:00 2001 From: GitHubPang <61439577+GitHubPang@users.noreply.github.com> Date: Thu, 12 May 2022 05:10:00 +0800 Subject: [PATCH 64/81] Fix spelling and grammar in comments (#3408) --- contracts/proxy/ERC1967/ERC1967Proxy.sol | 2 +- contracts/proxy/beacon/BeaconProxy.sol | 4 ++-- contracts/security/PullPayment.sol | 4 ++-- contracts/token/ERC1155/ERC1155.sol | 2 +- contracts/token/ERC721/ERC721.sol | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/proxy/ERC1967/ERC1967Proxy.sol b/contracts/proxy/ERC1967/ERC1967Proxy.sol index 64e9d9f6f..95a1587f6 100644 --- a/contracts/proxy/ERC1967/ERC1967Proxy.sol +++ b/contracts/proxy/ERC1967/ERC1967Proxy.sol @@ -17,7 +17,7 @@ contract ERC1967Proxy is Proxy, ERC1967Upgrade { * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`. * * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded - * function call, and allows initializating the storage of the proxy like a Solidity constructor. + * function call, and allows initializing the storage of the proxy like a Solidity constructor. */ constructor(address _logic, bytes memory _data) payable { assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); diff --git a/contracts/proxy/beacon/BeaconProxy.sol b/contracts/proxy/beacon/BeaconProxy.sol index 32eaa8e67..e2d192c21 100644 --- a/contracts/proxy/beacon/BeaconProxy.sol +++ b/contracts/proxy/beacon/BeaconProxy.sol @@ -8,7 +8,7 @@ import "../Proxy.sol"; import "../ERC1967/ERC1967Upgrade.sol"; /** - * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}. + * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. @@ -20,7 +20,7 @@ contract BeaconProxy is Proxy, ERC1967Upgrade { * @dev Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This - * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity + * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity * constructor. * * Requirements: diff --git a/contracts/security/PullPayment.sol b/contracts/security/PullPayment.sol index fb0ccffcb..7dee8c905 100644 --- a/contracts/security/PullPayment.sol +++ b/contracts/security/PullPayment.sol @@ -44,7 +44,7 @@ abstract contract PullPayment { * * @param payee Whose payments will be withdrawn. * - * Causes the `escrow` to emits a {Withdrawn} event. + * Causes the `escrow` to emit a {Withdrawn} event. */ function withdrawPayments(address payable payee) public virtual { _escrow.withdraw(payee); @@ -66,7 +66,7 @@ abstract contract PullPayment { * @param dest The destination address of the funds. * @param amount The amount to transfer. * - * Causes the `escrow` to emits a {Deposited} event. + * Causes the `escrow` to emit a {Deposited} event. */ function _asyncTransfer(address dest, uint256 amount) internal virtual { _escrow.deposit{value: amount}(dest); diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index 573d30456..2b9bc885c 100644 --- a/contracts/token/ERC1155/ERC1155.sol +++ b/contracts/token/ERC1155/ERC1155.sol @@ -394,7 +394,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { /** * @dev Approve `operator` to operate on all of `owner` tokens * - * Emits a {ApprovalForAll} event. + * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 3932b4913..9ba761074 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -353,7 +353,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev Approve `to` to operate on `tokenId` * - * Emits a {Approval} event. + * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; @@ -363,7 +363,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev Approve `operator` to operate on all of `owner` tokens * - * Emits a {ApprovalForAll} event. + * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, From cd2da98d4d21f070f56476b40042279f5500fc59 Mon Sep 17 00:00:00 2001 From: onlineSoftwareDevOK <104783768+onlineSoftwareDevOK@users.noreply.github.com> Date: Thu, 12 May 2022 19:23:56 -0300 Subject: [PATCH 65/81] Refactor magic constant in TimelocController test (#3397) --- test/governance/TimelockController.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/governance/TimelockController.test.js b/test/governance/TimelockController.test.js index 4584b2252..12abcac8c 100644 --- a/test/governance/TimelockController.test.js +++ b/test/governance/TimelockController.test.js @@ -15,6 +15,8 @@ const ERC1155Mock = artifacts.require('ERC1155Mock'); const MINDELAY = time.duration.days(1); +const salt = '0x025e7b0be353a74631ad648c667493c0e1cd31caa4cc2d3520fdc171ea0cc726'; // a random value + function genOperation (target, value, data, predecessor, salt) { const id = web3.utils.keccak256(web3.eth.abi.encodeParameters([ 'address', @@ -144,7 +146,7 @@ contract('TimelockController', function (accounts) { 0, '0x3bf92ccc', ZERO_BYTES32, - '0x025e7b0be353a74631ad648c667493c0e1cd31caa4cc2d3520fdc171ea0cc726', + salt, ); }); From 57725120581e27ec469e1c7e497a4008aafff818 Mon Sep 17 00:00:00 2001 From: Pascal Marco Caversaccio Date: Fri, 13 May 2022 20:46:26 +0200 Subject: [PATCH 66/81] Add `address` to `string` conversion (#3403) Co-authored-by: Francisco Giordano --- CHANGELOG.md | 1 + contracts/mocks/StringsMock.sol | 4 ++++ contracts/utils/Strings.sol | 8 ++++++++ test/utils/Strings.test.js | 12 ++++++++++++ 4 files changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b856be6bb..007688e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * `TimelockController`: Migrate `_call` to `_execute` and allow inheritance and overriding similar to `Governor`. ([#3317](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3317)) * `CrossChainEnabledPolygonChild`: replace the `require` statement with the custom error `NotCrossChainCall`. ([#3380](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3380)) * `ERC20FlashMint`: Add customizable flash fee receiver. ([#3327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3327)) + * `Strings`: add a new overloaded function `toHexString` that converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. ([#3403](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3403)) ## 4.6.0 (2022-04-26) diff --git a/contracts/mocks/StringsMock.sol b/contracts/mocks/StringsMock.sol index f257734e7..b8622680b 100644 --- a/contracts/mocks/StringsMock.sol +++ b/contracts/mocks/StringsMock.sol @@ -16,4 +16,8 @@ contract StringsMock { function fromUint256HexFixed(uint256 value, uint256 length) public pure returns (string memory) { return Strings.toHexString(value, length); } + + function fromAddressHexFixed(address addr) public pure returns (string memory) { + return Strings.toHexString(addr); + } } diff --git a/contracts/utils/Strings.sol b/contracts/utils/Strings.sol index d38bbe826..5b3e12d13 100644 --- a/contracts/utils/Strings.sol +++ b/contracts/utils/Strings.sol @@ -8,6 +8,7 @@ pragma solidity ^0.8.0; */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; + uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. @@ -64,4 +65,11 @@ library Strings { require(value == 0, "Strings: hex length insufficient"); return string(buffer); } + + /** + * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. + */ + function toHexString(address addr) internal pure returns (string memory) { + return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); + } } diff --git a/test/utils/Strings.test.js b/test/utils/Strings.test.js index 5128ce577..8dda829ea 100644 --- a/test/utils/Strings.test.js +++ b/test/utils/Strings.test.js @@ -56,4 +56,16 @@ contract('Strings', function (accounts) { .to.equal(web3.utils.toHex(constants.MAX_UINT256)); }); }); + + describe('from address - fixed hex format', function () { + it('converts a random address', async function () { + const addr = '0xa9036907dccae6a1e0033479b12e837e5cf5a02f'; + expect(await this.strings.fromAddressHexFixed(addr)).to.equal(addr); + }); + + it('converts an address with leading zeros', async function () { + const addr = '0x0000e0ca771e21bd00057f54a68c30d400000000'; + expect(await this.strings.fromAddressHexFixed(addr)).to.equal(addr); + }); + }); }); From ee4d8380d31527ff7ed9626477244ab662ffc29a Mon Sep 17 00:00:00 2001 From: harold-nft <102515891+harold-nft@users.noreply.github.com> Date: Wed, 18 May 2022 23:19:41 +1000 Subject: [PATCH 67/81] Fix minor typo in IERC1155 and IERC721 docs (#3419) --- contracts/token/ERC1155/IERC1155.sol | 2 +- contracts/token/ERC721/IERC721.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/token/ERC1155/IERC1155.sol b/contracts/token/ERC1155/IERC1155.sol index f2190a4fa..76c480574 100644 --- a/contracts/token/ERC1155/IERC1155.sol +++ b/contracts/token/ERC1155/IERC1155.sol @@ -91,7 +91,7 @@ interface IERC1155 is IERC165 { * Requirements: * * - `to` cannot be the zero address. - * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. + * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. diff --git a/contracts/token/ERC721/IERC721.sol b/contracts/token/ERC721/IERC721.sol index 2caeabf3a..c7bdbce82 100644 --- a/contracts/token/ERC721/IERC721.sol +++ b/contracts/token/ERC721/IERC721.sol @@ -67,7 +67,7 @@ interface IERC721 is IERC165 { * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. - * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. + * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. From c2077f003403a22a6815d95730555a2c108a3bbd Mon Sep 17 00:00:00 2001 From: Lucas Alonso Date: Wed, 18 May 2022 16:27:33 -0300 Subject: [PATCH 68/81] Add warning about use of delete (#3412) --- contracts/utils/structs/EnumerableMap.sol | 8 ++++++++ contracts/utils/structs/EnumerableSet.sol | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/contracts/utils/structs/EnumerableMap.sol b/contracts/utils/structs/EnumerableMap.sol index f9f239a3d..5ff27433a 100644 --- a/contracts/utils/structs/EnumerableMap.sol +++ b/contracts/utils/structs/EnumerableMap.sol @@ -31,6 +31,14 @@ import "./EnumerableSet.sol"; * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0 * - `bytes32 -> bytes32` (`Bytes32ToBytes32`) since v4.6.0 + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an array of EnumerableMap. + * ==== */ library EnumerableMap { using EnumerableSet for EnumerableSet.Bytes32Set; diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index a6963ef4e..cb7852622 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -26,6 +26,14 @@ pragma solidity ^0.8.0; * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. + * + * [WARNING] + * ==== + * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. + * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. + * + * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. + * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code From 46db8a98b08a5a8fef14be1e9efd7a29150fce56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Triay?= Date: Thu, 19 May 2022 15:52:54 +0200 Subject: [PATCH 69/81] Rename return parameter (#3413) --- contracts/governance/TimelockController.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index b293cd163..382c3a4af 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -131,7 +131,7 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver * @dev Returns whether an id correspond to a registered operation. This * includes both Pending, Ready and Done operations. */ - function isOperation(bytes32 id) public view virtual returns (bool pending) { + function isOperation(bytes32 id) public view virtual returns (bool registered) { return getTimestamp(id) > 0; } From 6339027a7ae783dcb462f6bd6a5be189e46ea449 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 19 May 2022 18:35:42 +0200 Subject: [PATCH 70/81] Add mention of events possibly emitted (#3421) --- contracts/access/AccessControl.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 8274bb55c..2103be914 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -138,6 +138,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * Requirements: * * - the caller must have ``role``'s admin role. + * + * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); @@ -151,6 +153,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * Requirements: * * - the caller must have ``role``'s admin role. + * + * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); @@ -169,6 +173,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * Requirements: * * - the caller must be `account`. + * + * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); @@ -183,6 +189,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * + * May emit a {RoleGranted} event. + * * [WARNING] * ==== * This function should only be called from the constructor when setting @@ -213,6 +221,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * @dev Grants `role` to `account`. * * Internal function without access restriction. + * + * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { @@ -225,6 +235,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * @dev Revokes `role` from `account`. * * Internal function without access restriction. + * + * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { From c4f76cfa155ec28a66bdd9bf24890174fef5b976 Mon Sep 17 00:00:00 2001 From: ashhanai Date: Fri, 20 May 2022 14:31:53 +0100 Subject: [PATCH 71/81] Add uint to uint enumerable map (#3338) --- CHANGELOG.md | 1 + contracts/mocks/EnumerableMapMock.sol | 43 ++++++++++ contracts/utils/structs/EnumerableMap.sol | 95 ++++++++++++++++++++++- test/utils/structs/EnumerableMap.test.js | 14 ++++ 4 files changed, 151 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 007688e53..495fbddd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * `CrossChainEnabledPolygonChild`: replace the `require` statement with the custom error `NotCrossChainCall`. ([#3380](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3380)) * `ERC20FlashMint`: Add customizable flash fee receiver. ([#3327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3327)) * `Strings`: add a new overloaded function `toHexString` that converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. ([#3403](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3403)) + * `EnumerableMap`: add new `UintToUintMap` map type. ([#3338](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3338)) ## 4.6.0 (2022-04-26) diff --git a/contracts/mocks/EnumerableMapMock.sol b/contracts/mocks/EnumerableMapMock.sol index 7cecd0d60..fec07252b 100644 --- a/contracts/mocks/EnumerableMapMock.sol +++ b/contracts/mocks/EnumerableMapMock.sol @@ -131,3 +131,46 @@ contract Bytes32ToBytes32MapMock { return _map.get(key, errorMessage); } } + +// UintToUintMap +contract UintToUintMapMock { + using EnumerableMap for EnumerableMap.UintToUintMap; + + event OperationResult(bool result); + + EnumerableMap.UintToUintMap private _map; + + function contains(uint256 key) public view returns (bool) { + return _map.contains(key); + } + + function set(uint256 key, uint256 value) public { + bool result = _map.set(key, value); + emit OperationResult(result); + } + + function remove(uint256 key) public { + bool result = _map.remove(key); + emit OperationResult(result); + } + + function length() public view returns (uint256) { + return _map.length(); + } + + function at(uint256 index) public view returns (uint256 key, uint256 value) { + return _map.at(index); + } + + function tryGet(uint256 key) public view returns (bool, uint256) { + return _map.tryGet(key); + } + + function get(uint256 key) public view returns (uint256) { + return _map.get(key); + } + + function getWithMessage(uint256 key, string calldata errorMessage) public view returns (uint256) { + return _map.get(key, errorMessage); + } +} diff --git a/contracts/utils/structs/EnumerableMap.sol b/contracts/utils/structs/EnumerableMap.sol index 5ff27433a..7e8f4e902 100644 --- a/contracts/utils/structs/EnumerableMap.sol +++ b/contracts/utils/structs/EnumerableMap.sol @@ -31,6 +31,7 @@ import "./EnumerableSet.sol"; * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0 * - `bytes32 -> bytes32` (`Bytes32ToBytes32`) since v4.6.0 + * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0 * * [WARNING] * ==== @@ -155,6 +156,98 @@ library EnumerableMap { return value; } + // UintToUintMap + + struct UintToUintMap { + Bytes32ToBytes32Map _inner; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set( + UintToUintMap storage map, + uint256 key, + uint256 value + ) internal returns (bool) { + return set(map._inner, bytes32(key), bytes32(value)); + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(UintToUintMap storage map, uint256 key) internal returns (bool) { + return remove(map._inner, bytes32(key)); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) { + return contains(map._inner, bytes32(key)); + } + + /** + * @dev Returns the number of elements in the map. O(1). + */ + function length(UintToUintMap storage map) internal view returns (uint256) { + return length(map._inner); + } + + /** + * @dev Returns the element stored at position `index` in the set. O(1). + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) { + (bytes32 key, bytes32 value) = at(map._inner, index); + return (uint256(key), uint256(value)); + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) { + (bool success, bytes32 value) = tryGet(map._inner, bytes32(key)); + return (success, uint256(value)); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) { + return uint256(get(map._inner, bytes32(key))); + } + + /** + * @dev Same as {get}, with a custom error message when `key` is not in the map. + * + * CAUTION: This function is deprecated because it requires allocating memory for the error + * message unnecessarily. For custom revert reasons use {tryGet}. + */ + function get( + UintToUintMap storage map, + uint256 key, + string memory errorMessage + ) internal view returns (uint256) { + return uint256(get(map._inner, bytes32(key), errorMessage)); + } + // UintToAddressMap struct UintToAddressMap { @@ -310,8 +403,6 @@ library EnumerableMap { /** * @dev Tries to returns the value associated with `key`. O(1). * Does not revert if `key` is not in the map. - * - * _Available since v3.4._ */ function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) { (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key)))); diff --git a/test/utils/structs/EnumerableMap.test.js b/test/utils/structs/EnumerableMap.test.js index 866ff6439..4b800d219 100644 --- a/test/utils/structs/EnumerableMap.test.js +++ b/test/utils/structs/EnumerableMap.test.js @@ -3,6 +3,7 @@ const { BN, constants } = require('@openzeppelin/test-helpers'); const AddressToUintMapMock = artifacts.require('AddressToUintMapMock'); const UintToAddressMapMock = artifacts.require('UintToAddressMapMock'); const Bytes32ToBytes32MapMock = artifacts.require('Bytes32ToBytes32MapMock'); +const UintToUintMapMock = artifacts.require('UintToUintMapMock'); const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); @@ -55,4 +56,17 @@ contract('EnumerableMap', function (accounts) { constants.ZERO_BYTES32, ); }); + + // UintToUintMap + describe('UintToUintMap', function () { + beforeEach(async function () { + this.map = await UintToUintMapMock.new(); + }); + + shouldBehaveLikeMap( + [ keyA, keyB, keyC ], + [ keyA, keyB, keyC ].map(k => k.add(new BN('1332'))), + new BN('0'), + ); + }); }); From b61faf8368f228a00f0b93e55a7e5ece916b431d Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Sat, 21 May 2022 14:38:31 +0200 Subject: [PATCH 72/81] Procedural SafeCast.sol generation (#3245) --- .github/workflows/test.yml | 1 + CHANGELOG.md | 1 + contracts/mocks/SafeCastMock.sol | 200 +++++ contracts/utils/math/SafeCast.sol | 900 +++++++++++++++++++- package.json | 7 +- scripts/checks/generation.sh | 6 + scripts/{ => checks}/inheritanceOrdering.js | 4 +- scripts/generate/format-lines.js | 16 + scripts/generate/run.js | 29 + scripts/generate/templates/SafeCast.js | 168 ++++ scripts/generate/templates/SafeCastMock.js | 50 ++ scripts/helpers.js | 23 + test/utils/math/SafeCast.test.js | 6 +- 13 files changed, 1402 insertions(+), 9 deletions(-) create mode 100755 scripts/checks/generation.sh rename scripts/{ => checks}/inheritanceOrdering.js (97%) mode change 100644 => 100755 create mode 100644 scripts/generate/format-lines.js create mode 100755 scripts/generate/run.js create mode 100755 scripts/generate/templates/SafeCast.js create mode 100755 scripts/generate/templates/SafeCastMock.js create mode 100644 scripts/helpers.js diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db6abf6a2..3a345c050 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,7 @@ jobs: FORCE_COLOR: 1 ENABLE_GAS_REPORT: true - run: npm run test:inheritance + - run: npm run test:generation - name: Print gas report run: cat gas-report.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 495fbddd0..71182a178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * `ERC20FlashMint`: Add customizable flash fee receiver. ([#3327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3327)) * `Strings`: add a new overloaded function `toHexString` that converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. ([#3403](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3403)) * `EnumerableMap`: add new `UintToUintMap` map type. ([#3338](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3338)) + * `SafeCast`: add support for many more types, using procedural code generation. ([#3245](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3245)) ## 4.6.0 (2022-04-26) diff --git a/contracts/mocks/SafeCastMock.sol b/contracts/mocks/SafeCastMock.sol index d1f1aaaba..806ce1274 100644 --- a/contracts/mocks/SafeCastMock.sol +++ b/contracts/mocks/SafeCastMock.sol @@ -12,26 +12,122 @@ contract SafeCastMock { return a.toUint256(); } + function toUint248(uint256 a) public pure returns (uint248) { + return a.toUint248(); + } + + function toUint240(uint256 a) public pure returns (uint240) { + return a.toUint240(); + } + + function toUint232(uint256 a) public pure returns (uint232) { + return a.toUint232(); + } + function toUint224(uint256 a) public pure returns (uint224) { return a.toUint224(); } + function toUint216(uint256 a) public pure returns (uint216) { + return a.toUint216(); + } + + function toUint208(uint256 a) public pure returns (uint208) { + return a.toUint208(); + } + + function toUint200(uint256 a) public pure returns (uint200) { + return a.toUint200(); + } + + function toUint192(uint256 a) public pure returns (uint192) { + return a.toUint192(); + } + + function toUint184(uint256 a) public pure returns (uint184) { + return a.toUint184(); + } + + function toUint176(uint256 a) public pure returns (uint176) { + return a.toUint176(); + } + + function toUint168(uint256 a) public pure returns (uint168) { + return a.toUint168(); + } + + function toUint160(uint256 a) public pure returns (uint160) { + return a.toUint160(); + } + + function toUint152(uint256 a) public pure returns (uint152) { + return a.toUint152(); + } + + function toUint144(uint256 a) public pure returns (uint144) { + return a.toUint144(); + } + + function toUint136(uint256 a) public pure returns (uint136) { + return a.toUint136(); + } + function toUint128(uint256 a) public pure returns (uint128) { return a.toUint128(); } + function toUint120(uint256 a) public pure returns (uint120) { + return a.toUint120(); + } + + function toUint112(uint256 a) public pure returns (uint112) { + return a.toUint112(); + } + + function toUint104(uint256 a) public pure returns (uint104) { + return a.toUint104(); + } + function toUint96(uint256 a) public pure returns (uint96) { return a.toUint96(); } + function toUint88(uint256 a) public pure returns (uint88) { + return a.toUint88(); + } + + function toUint80(uint256 a) public pure returns (uint80) { + return a.toUint80(); + } + + function toUint72(uint256 a) public pure returns (uint72) { + return a.toUint72(); + } + function toUint64(uint256 a) public pure returns (uint64) { return a.toUint64(); } + function toUint56(uint256 a) public pure returns (uint56) { + return a.toUint56(); + } + + function toUint48(uint256 a) public pure returns (uint48) { + return a.toUint48(); + } + + function toUint40(uint256 a) public pure returns (uint40) { + return a.toUint40(); + } + function toUint32(uint256 a) public pure returns (uint32) { return a.toUint32(); } + function toUint24(uint256 a) public pure returns (uint24) { + return a.toUint24(); + } + function toUint16(uint256 a) public pure returns (uint16) { return a.toUint16(); } @@ -44,18 +140,122 @@ contract SafeCastMock { return a.toInt256(); } + function toInt248(int256 a) public pure returns (int248) { + return a.toInt248(); + } + + function toInt240(int256 a) public pure returns (int240) { + return a.toInt240(); + } + + function toInt232(int256 a) public pure returns (int232) { + return a.toInt232(); + } + + function toInt224(int256 a) public pure returns (int224) { + return a.toInt224(); + } + + function toInt216(int256 a) public pure returns (int216) { + return a.toInt216(); + } + + function toInt208(int256 a) public pure returns (int208) { + return a.toInt208(); + } + + function toInt200(int256 a) public pure returns (int200) { + return a.toInt200(); + } + + function toInt192(int256 a) public pure returns (int192) { + return a.toInt192(); + } + + function toInt184(int256 a) public pure returns (int184) { + return a.toInt184(); + } + + function toInt176(int256 a) public pure returns (int176) { + return a.toInt176(); + } + + function toInt168(int256 a) public pure returns (int168) { + return a.toInt168(); + } + + function toInt160(int256 a) public pure returns (int160) { + return a.toInt160(); + } + + function toInt152(int256 a) public pure returns (int152) { + return a.toInt152(); + } + + function toInt144(int256 a) public pure returns (int144) { + return a.toInt144(); + } + + function toInt136(int256 a) public pure returns (int136) { + return a.toInt136(); + } + function toInt128(int256 a) public pure returns (int128) { return a.toInt128(); } + function toInt120(int256 a) public pure returns (int120) { + return a.toInt120(); + } + + function toInt112(int256 a) public pure returns (int112) { + return a.toInt112(); + } + + function toInt104(int256 a) public pure returns (int104) { + return a.toInt104(); + } + + function toInt96(int256 a) public pure returns (int96) { + return a.toInt96(); + } + + function toInt88(int256 a) public pure returns (int88) { + return a.toInt88(); + } + + function toInt80(int256 a) public pure returns (int80) { + return a.toInt80(); + } + + function toInt72(int256 a) public pure returns (int72) { + return a.toInt72(); + } + function toInt64(int256 a) public pure returns (int64) { return a.toInt64(); } + function toInt56(int256 a) public pure returns (int56) { + return a.toInt56(); + } + + function toInt48(int256 a) public pure returns (int48) { + return a.toInt48(); + } + + function toInt40(int256 a) public pure returns (int40) { + return a.toInt40(); + } + function toInt32(int256 a) public pure returns (int32) { return a.toInt32(); } + function toInt24(int256 a) public pure returns (int24) { + return a.toInt24(); + } + function toInt16(int256 a) public pure returns (int16) { return a.toInt16(); } diff --git a/contracts/utils/math/SafeCast.sol b/contracts/utils/math/SafeCast.sol index 3cd647357..2857638bd 100644 --- a/contracts/utils/math/SafeCast.sol +++ b/contracts/utils/math/SafeCast.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) +// OpenZeppelin Contracts (last updated v4.4.1) (utils/math/SafeCast.sol) pragma solidity ^0.8.0; @@ -19,6 +19,57 @@ pragma solidity ^0.8.0; * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { + /** + * @dev Returns the downcasted uint248 from uint256, reverting on + * overflow (when the input is greater than largest uint248). + * + * Counterpart to Solidity's `uint248` operator. + * + * Requirements: + * + * - input must fit into 248 bits + * + * _Available since v4.7._ + */ + function toUint248(uint256 value) internal pure returns (uint248) { + require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits"); + return uint248(value); + } + + /** + * @dev Returns the downcasted uint240 from uint256, reverting on + * overflow (when the input is greater than largest uint240). + * + * Counterpart to Solidity's `uint240` operator. + * + * Requirements: + * + * - input must fit into 240 bits + * + * _Available since v4.7._ + */ + function toUint240(uint256 value) internal pure returns (uint240) { + require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits"); + return uint240(value); + } + + /** + * @dev Returns the downcasted uint232 from uint256, reverting on + * overflow (when the input is greater than largest uint232). + * + * Counterpart to Solidity's `uint232` operator. + * + * Requirements: + * + * - input must fit into 232 bits + * + * _Available since v4.7._ + */ + function toUint232(uint256 value) internal pure returns (uint232) { + require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits"); + return uint232(value); + } + /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). @@ -28,12 +79,201 @@ library SafeCast { * Requirements: * * - input must fit into 224 bits + * + * _Available since v4.2._ */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } + /** + * @dev Returns the downcasted uint216 from uint256, reverting on + * overflow (when the input is greater than largest uint216). + * + * Counterpart to Solidity's `uint216` operator. + * + * Requirements: + * + * - input must fit into 216 bits + * + * _Available since v4.7._ + */ + function toUint216(uint256 value) internal pure returns (uint216) { + require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits"); + return uint216(value); + } + + /** + * @dev Returns the downcasted uint208 from uint256, reverting on + * overflow (when the input is greater than largest uint208). + * + * Counterpart to Solidity's `uint208` operator. + * + * Requirements: + * + * - input must fit into 208 bits + * + * _Available since v4.7._ + */ + function toUint208(uint256 value) internal pure returns (uint208) { + require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits"); + return uint208(value); + } + + /** + * @dev Returns the downcasted uint200 from uint256, reverting on + * overflow (when the input is greater than largest uint200). + * + * Counterpart to Solidity's `uint200` operator. + * + * Requirements: + * + * - input must fit into 200 bits + * + * _Available since v4.7._ + */ + function toUint200(uint256 value) internal pure returns (uint200) { + require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits"); + return uint200(value); + } + + /** + * @dev Returns the downcasted uint192 from uint256, reverting on + * overflow (when the input is greater than largest uint192). + * + * Counterpart to Solidity's `uint192` operator. + * + * Requirements: + * + * - input must fit into 192 bits + * + * _Available since v4.7._ + */ + function toUint192(uint256 value) internal pure returns (uint192) { + require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits"); + return uint192(value); + } + + /** + * @dev Returns the downcasted uint184 from uint256, reverting on + * overflow (when the input is greater than largest uint184). + * + * Counterpart to Solidity's `uint184` operator. + * + * Requirements: + * + * - input must fit into 184 bits + * + * _Available since v4.7._ + */ + function toUint184(uint256 value) internal pure returns (uint184) { + require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits"); + return uint184(value); + } + + /** + * @dev Returns the downcasted uint176 from uint256, reverting on + * overflow (when the input is greater than largest uint176). + * + * Counterpart to Solidity's `uint176` operator. + * + * Requirements: + * + * - input must fit into 176 bits + * + * _Available since v4.7._ + */ + function toUint176(uint256 value) internal pure returns (uint176) { + require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits"); + return uint176(value); + } + + /** + * @dev Returns the downcasted uint168 from uint256, reverting on + * overflow (when the input is greater than largest uint168). + * + * Counterpart to Solidity's `uint168` operator. + * + * Requirements: + * + * - input must fit into 168 bits + * + * _Available since v4.7._ + */ + function toUint168(uint256 value) internal pure returns (uint168) { + require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits"); + return uint168(value); + } + + /** + * @dev Returns the downcasted uint160 from uint256, reverting on + * overflow (when the input is greater than largest uint160). + * + * Counterpart to Solidity's `uint160` operator. + * + * Requirements: + * + * - input must fit into 160 bits + * + * _Available since v4.7._ + */ + function toUint160(uint256 value) internal pure returns (uint160) { + require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits"); + return uint160(value); + } + + /** + * @dev Returns the downcasted uint152 from uint256, reverting on + * overflow (when the input is greater than largest uint152). + * + * Counterpart to Solidity's `uint152` operator. + * + * Requirements: + * + * - input must fit into 152 bits + * + * _Available since v4.7._ + */ + function toUint152(uint256 value) internal pure returns (uint152) { + require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits"); + return uint152(value); + } + + /** + * @dev Returns the downcasted uint144 from uint256, reverting on + * overflow (when the input is greater than largest uint144). + * + * Counterpart to Solidity's `uint144` operator. + * + * Requirements: + * + * - input must fit into 144 bits + * + * _Available since v4.7._ + */ + function toUint144(uint256 value) internal pure returns (uint144) { + require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits"); + return uint144(value); + } + + /** + * @dev Returns the downcasted uint136 from uint256, reverting on + * overflow (when the input is greater than largest uint136). + * + * Counterpart to Solidity's `uint136` operator. + * + * Requirements: + * + * - input must fit into 136 bits + * + * _Available since v4.7._ + */ + function toUint136(uint256 value) internal pure returns (uint136) { + require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits"); + return uint136(value); + } + /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). @@ -43,12 +283,65 @@ library SafeCast { * Requirements: * * - input must fit into 128 bits + * + * _Available since v2.5._ */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } + /** + * @dev Returns the downcasted uint120 from uint256, reverting on + * overflow (when the input is greater than largest uint120). + * + * Counterpart to Solidity's `uint120` operator. + * + * Requirements: + * + * - input must fit into 120 bits + * + * _Available since v4.7._ + */ + function toUint120(uint256 value) internal pure returns (uint120) { + require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits"); + return uint120(value); + } + + /** + * @dev Returns the downcasted uint112 from uint256, reverting on + * overflow (when the input is greater than largest uint112). + * + * Counterpart to Solidity's `uint112` operator. + * + * Requirements: + * + * - input must fit into 112 bits + * + * _Available since v4.7._ + */ + function toUint112(uint256 value) internal pure returns (uint112) { + require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits"); + return uint112(value); + } + + /** + * @dev Returns the downcasted uint104 from uint256, reverting on + * overflow (when the input is greater than largest uint104). + * + * Counterpart to Solidity's `uint104` operator. + * + * Requirements: + * + * - input must fit into 104 bits + * + * _Available since v4.7._ + */ + function toUint104(uint256 value) internal pure returns (uint104) { + require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits"); + return uint104(value); + } + /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). @@ -58,12 +351,65 @@ library SafeCast { * Requirements: * * - input must fit into 96 bits + * + * _Available since v4.2._ */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } + /** + * @dev Returns the downcasted uint88 from uint256, reverting on + * overflow (when the input is greater than largest uint88). + * + * Counterpart to Solidity's `uint88` operator. + * + * Requirements: + * + * - input must fit into 88 bits + * + * _Available since v4.7._ + */ + function toUint88(uint256 value) internal pure returns (uint88) { + require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits"); + return uint88(value); + } + + /** + * @dev Returns the downcasted uint80 from uint256, reverting on + * overflow (when the input is greater than largest uint80). + * + * Counterpart to Solidity's `uint80` operator. + * + * Requirements: + * + * - input must fit into 80 bits + * + * _Available since v4.7._ + */ + function toUint80(uint256 value) internal pure returns (uint80) { + require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits"); + return uint80(value); + } + + /** + * @dev Returns the downcasted uint72 from uint256, reverting on + * overflow (when the input is greater than largest uint72). + * + * Counterpart to Solidity's `uint72` operator. + * + * Requirements: + * + * - input must fit into 72 bits + * + * _Available since v4.7._ + */ + function toUint72(uint256 value) internal pure returns (uint72) { + require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits"); + return uint72(value); + } + /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). @@ -73,12 +419,65 @@ library SafeCast { * Requirements: * * - input must fit into 64 bits + * + * _Available since v2.5._ */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } + /** + * @dev Returns the downcasted uint56 from uint256, reverting on + * overflow (when the input is greater than largest uint56). + * + * Counterpart to Solidity's `uint56` operator. + * + * Requirements: + * + * - input must fit into 56 bits + * + * _Available since v4.7._ + */ + function toUint56(uint256 value) internal pure returns (uint56) { + require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits"); + return uint56(value); + } + + /** + * @dev Returns the downcasted uint48 from uint256, reverting on + * overflow (when the input is greater than largest uint48). + * + * Counterpart to Solidity's `uint48` operator. + * + * Requirements: + * + * - input must fit into 48 bits + * + * _Available since v4.7._ + */ + function toUint48(uint256 value) internal pure returns (uint48) { + require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits"); + return uint48(value); + } + + /** + * @dev Returns the downcasted uint40 from uint256, reverting on + * overflow (when the input is greater than largest uint40). + * + * Counterpart to Solidity's `uint40` operator. + * + * Requirements: + * + * - input must fit into 40 bits + * + * _Available since v4.7._ + */ + function toUint40(uint256 value) internal pure returns (uint40) { + require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits"); + return uint40(value); + } + /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). @@ -88,12 +487,31 @@ library SafeCast { * Requirements: * * - input must fit into 32 bits + * + * _Available since v2.5._ */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } + /** + * @dev Returns the downcasted uint24 from uint256, reverting on + * overflow (when the input is greater than largest uint24). + * + * Counterpart to Solidity's `uint24` operator. + * + * Requirements: + * + * - input must fit into 24 bits + * + * _Available since v4.7._ + */ + function toUint24(uint256 value) internal pure returns (uint24) { + require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits"); + return uint24(value); + } + /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). @@ -103,6 +521,8 @@ library SafeCast { * Requirements: * * - input must fit into 16 bits + * + * _Available since v2.5._ */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); @@ -117,7 +537,9 @@ library SafeCast { * * Requirements: * - * - input must fit into 8 bits. + * - input must fit into 8 bits + * + * _Available since v2.5._ */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); @@ -130,12 +552,284 @@ library SafeCast { * Requirements: * * - input must be greater than or equal to 0. + * + * _Available since v3.0._ */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } + /** + * @dev Returns the downcasted int248 from int256, reverting on + * overflow (when the input is less than smallest int248 or + * greater than largest int248). + * + * Counterpart to Solidity's `int248` operator. + * + * Requirements: + * + * - input must fit into 248 bits + * + * _Available since v4.7._ + */ + function toInt248(int256 value) internal pure returns (int248) { + require(value >= type(int248).min && value <= type(int248).max, "SafeCast: value doesn't fit in 248 bits"); + return int248(value); + } + + /** + * @dev Returns the downcasted int240 from int256, reverting on + * overflow (when the input is less than smallest int240 or + * greater than largest int240). + * + * Counterpart to Solidity's `int240` operator. + * + * Requirements: + * + * - input must fit into 240 bits + * + * _Available since v4.7._ + */ + function toInt240(int256 value) internal pure returns (int240) { + require(value >= type(int240).min && value <= type(int240).max, "SafeCast: value doesn't fit in 240 bits"); + return int240(value); + } + + /** + * @dev Returns the downcasted int232 from int256, reverting on + * overflow (when the input is less than smallest int232 or + * greater than largest int232). + * + * Counterpart to Solidity's `int232` operator. + * + * Requirements: + * + * - input must fit into 232 bits + * + * _Available since v4.7._ + */ + function toInt232(int256 value) internal pure returns (int232) { + require(value >= type(int232).min && value <= type(int232).max, "SafeCast: value doesn't fit in 232 bits"); + return int232(value); + } + + /** + * @dev Returns the downcasted int224 from int256, reverting on + * overflow (when the input is less than smallest int224 or + * greater than largest int224). + * + * Counterpart to Solidity's `int224` operator. + * + * Requirements: + * + * - input must fit into 224 bits + * + * _Available since v4.7._ + */ + function toInt224(int256 value) internal pure returns (int224) { + require(value >= type(int224).min && value <= type(int224).max, "SafeCast: value doesn't fit in 224 bits"); + return int224(value); + } + + /** + * @dev Returns the downcasted int216 from int256, reverting on + * overflow (when the input is less than smallest int216 or + * greater than largest int216). + * + * Counterpart to Solidity's `int216` operator. + * + * Requirements: + * + * - input must fit into 216 bits + * + * _Available since v4.7._ + */ + function toInt216(int256 value) internal pure returns (int216) { + require(value >= type(int216).min && value <= type(int216).max, "SafeCast: value doesn't fit in 216 bits"); + return int216(value); + } + + /** + * @dev Returns the downcasted int208 from int256, reverting on + * overflow (when the input is less than smallest int208 or + * greater than largest int208). + * + * Counterpart to Solidity's `int208` operator. + * + * Requirements: + * + * - input must fit into 208 bits + * + * _Available since v4.7._ + */ + function toInt208(int256 value) internal pure returns (int208) { + require(value >= type(int208).min && value <= type(int208).max, "SafeCast: value doesn't fit in 208 bits"); + return int208(value); + } + + /** + * @dev Returns the downcasted int200 from int256, reverting on + * overflow (when the input is less than smallest int200 or + * greater than largest int200). + * + * Counterpart to Solidity's `int200` operator. + * + * Requirements: + * + * - input must fit into 200 bits + * + * _Available since v4.7._ + */ + function toInt200(int256 value) internal pure returns (int200) { + require(value >= type(int200).min && value <= type(int200).max, "SafeCast: value doesn't fit in 200 bits"); + return int200(value); + } + + /** + * @dev Returns the downcasted int192 from int256, reverting on + * overflow (when the input is less than smallest int192 or + * greater than largest int192). + * + * Counterpart to Solidity's `int192` operator. + * + * Requirements: + * + * - input must fit into 192 bits + * + * _Available since v4.7._ + */ + function toInt192(int256 value) internal pure returns (int192) { + require(value >= type(int192).min && value <= type(int192).max, "SafeCast: value doesn't fit in 192 bits"); + return int192(value); + } + + /** + * @dev Returns the downcasted int184 from int256, reverting on + * overflow (when the input is less than smallest int184 or + * greater than largest int184). + * + * Counterpart to Solidity's `int184` operator. + * + * Requirements: + * + * - input must fit into 184 bits + * + * _Available since v4.7._ + */ + function toInt184(int256 value) internal pure returns (int184) { + require(value >= type(int184).min && value <= type(int184).max, "SafeCast: value doesn't fit in 184 bits"); + return int184(value); + } + + /** + * @dev Returns the downcasted int176 from int256, reverting on + * overflow (when the input is less than smallest int176 or + * greater than largest int176). + * + * Counterpart to Solidity's `int176` operator. + * + * Requirements: + * + * - input must fit into 176 bits + * + * _Available since v4.7._ + */ + function toInt176(int256 value) internal pure returns (int176) { + require(value >= type(int176).min && value <= type(int176).max, "SafeCast: value doesn't fit in 176 bits"); + return int176(value); + } + + /** + * @dev Returns the downcasted int168 from int256, reverting on + * overflow (when the input is less than smallest int168 or + * greater than largest int168). + * + * Counterpart to Solidity's `int168` operator. + * + * Requirements: + * + * - input must fit into 168 bits + * + * _Available since v4.7._ + */ + function toInt168(int256 value) internal pure returns (int168) { + require(value >= type(int168).min && value <= type(int168).max, "SafeCast: value doesn't fit in 168 bits"); + return int168(value); + } + + /** + * @dev Returns the downcasted int160 from int256, reverting on + * overflow (when the input is less than smallest int160 or + * greater than largest int160). + * + * Counterpart to Solidity's `int160` operator. + * + * Requirements: + * + * - input must fit into 160 bits + * + * _Available since v4.7._ + */ + function toInt160(int256 value) internal pure returns (int160) { + require(value >= type(int160).min && value <= type(int160).max, "SafeCast: value doesn't fit in 160 bits"); + return int160(value); + } + + /** + * @dev Returns the downcasted int152 from int256, reverting on + * overflow (when the input is less than smallest int152 or + * greater than largest int152). + * + * Counterpart to Solidity's `int152` operator. + * + * Requirements: + * + * - input must fit into 152 bits + * + * _Available since v4.7._ + */ + function toInt152(int256 value) internal pure returns (int152) { + require(value >= type(int152).min && value <= type(int152).max, "SafeCast: value doesn't fit in 152 bits"); + return int152(value); + } + + /** + * @dev Returns the downcasted int144 from int256, reverting on + * overflow (when the input is less than smallest int144 or + * greater than largest int144). + * + * Counterpart to Solidity's `int144` operator. + * + * Requirements: + * + * - input must fit into 144 bits + * + * _Available since v4.7._ + */ + function toInt144(int256 value) internal pure returns (int144) { + require(value >= type(int144).min && value <= type(int144).max, "SafeCast: value doesn't fit in 144 bits"); + return int144(value); + } + + /** + * @dev Returns the downcasted int136 from int256, reverting on + * overflow (when the input is less than smallest int136 or + * greater than largest int136). + * + * Counterpart to Solidity's `int136` operator. + * + * Requirements: + * + * - input must fit into 136 bits + * + * _Available since v4.7._ + */ + function toInt136(int256 value) internal pure returns (int136) { + require(value >= type(int136).min && value <= type(int136).max, "SafeCast: value doesn't fit in 136 bits"); + return int136(value); + } + /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or @@ -154,6 +848,132 @@ library SafeCast { return int128(value); } + /** + * @dev Returns the downcasted int120 from int256, reverting on + * overflow (when the input is less than smallest int120 or + * greater than largest int120). + * + * Counterpart to Solidity's `int120` operator. + * + * Requirements: + * + * - input must fit into 120 bits + * + * _Available since v4.7._ + */ + function toInt120(int256 value) internal pure returns (int120) { + require(value >= type(int120).min && value <= type(int120).max, "SafeCast: value doesn't fit in 120 bits"); + return int120(value); + } + + /** + * @dev Returns the downcasted int112 from int256, reverting on + * overflow (when the input is less than smallest int112 or + * greater than largest int112). + * + * Counterpart to Solidity's `int112` operator. + * + * Requirements: + * + * - input must fit into 112 bits + * + * _Available since v4.7._ + */ + function toInt112(int256 value) internal pure returns (int112) { + require(value >= type(int112).min && value <= type(int112).max, "SafeCast: value doesn't fit in 112 bits"); + return int112(value); + } + + /** + * @dev Returns the downcasted int104 from int256, reverting on + * overflow (when the input is less than smallest int104 or + * greater than largest int104). + * + * Counterpart to Solidity's `int104` operator. + * + * Requirements: + * + * - input must fit into 104 bits + * + * _Available since v4.7._ + */ + function toInt104(int256 value) internal pure returns (int104) { + require(value >= type(int104).min && value <= type(int104).max, "SafeCast: value doesn't fit in 104 bits"); + return int104(value); + } + + /** + * @dev Returns the downcasted int96 from int256, reverting on + * overflow (when the input is less than smallest int96 or + * greater than largest int96). + * + * Counterpart to Solidity's `int96` operator. + * + * Requirements: + * + * - input must fit into 96 bits + * + * _Available since v4.7._ + */ + function toInt96(int256 value) internal pure returns (int96) { + require(value >= type(int96).min && value <= type(int96).max, "SafeCast: value doesn't fit in 96 bits"); + return int96(value); + } + + /** + * @dev Returns the downcasted int88 from int256, reverting on + * overflow (when the input is less than smallest int88 or + * greater than largest int88). + * + * Counterpart to Solidity's `int88` operator. + * + * Requirements: + * + * - input must fit into 88 bits + * + * _Available since v4.7._ + */ + function toInt88(int256 value) internal pure returns (int88) { + require(value >= type(int88).min && value <= type(int88).max, "SafeCast: value doesn't fit in 88 bits"); + return int88(value); + } + + /** + * @dev Returns the downcasted int80 from int256, reverting on + * overflow (when the input is less than smallest int80 or + * greater than largest int80). + * + * Counterpart to Solidity's `int80` operator. + * + * Requirements: + * + * - input must fit into 80 bits + * + * _Available since v4.7._ + */ + function toInt80(int256 value) internal pure returns (int80) { + require(value >= type(int80).min && value <= type(int80).max, "SafeCast: value doesn't fit in 80 bits"); + return int80(value); + } + + /** + * @dev Returns the downcasted int72 from int256, reverting on + * overflow (when the input is less than smallest int72 or + * greater than largest int72). + * + * Counterpart to Solidity's `int72` operator. + * + * Requirements: + * + * - input must fit into 72 bits + * + * _Available since v4.7._ + */ + function toInt72(int256 value) internal pure returns (int72) { + require(value >= type(int72).min && value <= type(int72).max, "SafeCast: value doesn't fit in 72 bits"); + return int72(value); + } + /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or @@ -172,6 +992,60 @@ library SafeCast { return int64(value); } + /** + * @dev Returns the downcasted int56 from int256, reverting on + * overflow (when the input is less than smallest int56 or + * greater than largest int56). + * + * Counterpart to Solidity's `int56` operator. + * + * Requirements: + * + * - input must fit into 56 bits + * + * _Available since v4.7._ + */ + function toInt56(int256 value) internal pure returns (int56) { + require(value >= type(int56).min && value <= type(int56).max, "SafeCast: value doesn't fit in 56 bits"); + return int56(value); + } + + /** + * @dev Returns the downcasted int48 from int256, reverting on + * overflow (when the input is less than smallest int48 or + * greater than largest int48). + * + * Counterpart to Solidity's `int48` operator. + * + * Requirements: + * + * - input must fit into 48 bits + * + * _Available since v4.7._ + */ + function toInt48(int256 value) internal pure returns (int48) { + require(value >= type(int48).min && value <= type(int48).max, "SafeCast: value doesn't fit in 48 bits"); + return int48(value); + } + + /** + * @dev Returns the downcasted int40 from int256, reverting on + * overflow (when the input is less than smallest int40 or + * greater than largest int40). + * + * Counterpart to Solidity's `int40` operator. + * + * Requirements: + * + * - input must fit into 40 bits + * + * _Available since v4.7._ + */ + function toInt40(int256 value) internal pure returns (int40) { + require(value >= type(int40).min && value <= type(int40).max, "SafeCast: value doesn't fit in 40 bits"); + return int40(value); + } + /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or @@ -190,6 +1064,24 @@ library SafeCast { return int32(value); } + /** + * @dev Returns the downcasted int24 from int256, reverting on + * overflow (when the input is less than smallest int24 or + * greater than largest int24). + * + * Counterpart to Solidity's `int24` operator. + * + * Requirements: + * + * - input must fit into 24 bits + * + * _Available since v4.7._ + */ + function toInt24(int256 value) internal pure returns (int24) { + require(value >= type(int24).min && value <= type(int24).max, "SafeCast: value doesn't fit in 24 bits"); + return int24(value); + } + /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or @@ -217,7 +1109,7 @@ library SafeCast { * * Requirements: * - * - input must fit into 8 bits. + * - input must fit into 8 bits * * _Available since v3.1._ */ @@ -232,6 +1124,8 @@ library SafeCast { * Requirements: * * - input must be less than or equal to maxInt256. + * + * _Available since v3.0._ */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive diff --git a/package.json b/package.json index 8f2f10c87..cb1ac5571 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,14 @@ "clean": "hardhat clean && rimraf build contracts/build", "prepare": "npm run clean && env COMPILE_MODE=production npm run compile", "prepack": "scripts/prepack.sh", + "generate": "scripts/generate/run.js", "release": "scripts/release/release.sh", "version": "scripts/release/version.sh", "test": "hardhat test", - "test:inheritance": "node scripts/inheritanceOrdering artifacts/build-info/*", - "gas-report": "env ENABLE_GAS_REPORT=true npm run test" + "test:inheritance": "scripts/checks/inheritanceOrdering.js artifacts/build-info/*", + "test:generation": "scripts/checks/generation.sh", + "gas-report": "env ENABLE_GAS_REPORT=true npm run test", + "slither": "npm run clean && slither . --detect reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas" }, "repository": { "type": "git", diff --git a/scripts/checks/generation.sh b/scripts/checks/generation.sh new file mode 100755 index 000000000..165c35a06 --- /dev/null +++ b/scripts/checks/generation.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euo pipefail + +npm run generate +git diff --quiet --exit-code diff --git a/scripts/inheritanceOrdering.js b/scripts/checks/inheritanceOrdering.js old mode 100644 new mode 100755 similarity index 97% rename from scripts/inheritanceOrdering.js rename to scripts/checks/inheritanceOrdering.js index 2d285895c..9d332cba3 --- a/scripts/inheritanceOrdering.js +++ b/scripts/checks/inheritanceOrdering.js @@ -1,10 +1,12 @@ +#!/usr/bin/env node + const path = require('path'); const graphlib = require('graphlib'); const { findAll } = require('solidity-ast/utils'); const { _: artifacts } = require('yargs').argv; for (const artifact of artifacts) { - const { output: solcOutput } = require(path.resolve(__dirname, '..', artifact)); + const { output: solcOutput } = require(path.resolve(__dirname, '../..', artifact)); const graph = new graphlib.Graph({ directed: true }); const names = {}; diff --git a/scripts/generate/format-lines.js b/scripts/generate/format-lines.js new file mode 100644 index 000000000..e1f1823e8 --- /dev/null +++ b/scripts/generate/format-lines.js @@ -0,0 +1,16 @@ +function formatLines (...lines) { + return [...indentEach(0, lines)].join('\n') + '\n'; +} + +function *indentEach (indent, lines) { + for (const line of lines) { + if (Array.isArray(line)) { + yield * indentEach(indent + 1, line); + } else { + const padding = ' '.repeat(indent); + yield * line.split('\n').map(subline => subline === '' ? '' : padding + subline); + } + } +} + +module.exports = formatLines; diff --git a/scripts/generate/run.js b/scripts/generate/run.js new file mode 100755 index 000000000..5ebb1b37a --- /dev/null +++ b/scripts/generate/run.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const format = require('./format-lines'); + +function getVersion (path) { + try { + return fs + .readFileSync(path, 'utf8') + .match(/\/\/ OpenZeppelin Contracts \(last updated v\d+\.\d+\.\d+\)/)[0]; + } catch (err) { + return null; + } +} + +for (const [ file, template ] of Object.entries({ + 'utils/math/SafeCast.sol': './templates/SafeCast', + 'mocks/SafeCastMock.sol': './templates/SafeCastMock', +})) { + const path = `./contracts/${file}`; + const version = getVersion(path); + const content = format( + '// SPDX-License-Identifier: MIT', + (version ? version + ` (${file})\n` : ''), + require(template).trimEnd(), + ); + + fs.writeFileSync(path, content); +} diff --git a/scripts/generate/templates/SafeCast.js b/scripts/generate/templates/SafeCast.js new file mode 100755 index 000000000..ce36c26c4 --- /dev/null +++ b/scripts/generate/templates/SafeCast.js @@ -0,0 +1,168 @@ +const assert = require('assert'); +const format = require('../format-lines'); +const { range } = require('../../helpers'); + +const LENGTHS = range(8, 256, 8).reverse(); // 248 → 8 (in steps of 8) + +// Returns the version of OpenZeppelin Contracts in which a particular function was introduced. +// This is used in the docs for each function. +const version = (selector, length) => { + switch (selector) { + case 'toUint(uint)': { + switch (length) { + case 8: + case 16: + case 32: + case 64: + case 128: + return '2.5'; + case 96: + case 224: + return '4.2'; + default: + assert(LENGTHS.includes(length)); + return '4.7'; + } + } + case 'toInt(int)': { + switch (length) { + case 8: + case 16: + case 32: + case 64: + case 128: + return '3.1'; + default: + assert(LENGTHS.includes(length)); + return '4.7'; + } + } + case 'toUint(int)': { + switch (length) { + case 256: + return '3.0'; + default: + assert(false); + return; + } + } + case 'toInt(uint)': { + switch (length) { + case 256: + return '3.0'; + default: + assert(false); + return; + } + } + default: + assert(false); + } +}; + +const header = `\ +pragma solidity ^0.8.0; + +/** + * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow + * checks. + * + * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can + * easily result in undesired exploitation or bugs, since developers usually + * assume that overflows raise errors. \`SafeCast\` restores this intuition by + * reverting the transaction when such an operation overflows. + * + * Using this library instead of the unchecked operations eliminates an entire + * class of bugs, so it's recommended to use it always. + * + * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing + * all math on \`uint256\` and \`int256\` and then downcasting. + */ +`; + +const toUintDownCast = length => `\ +/** + * @dev Returns the downcasted uint${length} from uint256, reverting on + * overflow (when the input is greater than largest uint${length}). + * + * Counterpart to Solidity's \`uint${length}\` operator. + * + * Requirements: + * + * - input must fit into ${length} bits + * + * _Available since v${version('toUint(uint)', length)}._ + */ +function toUint${length}(uint256 value) internal pure returns (uint${length}) { + require(value <= type(uint${length}).max, "SafeCast: value doesn't fit in ${length} bits"); + return uint${length}(value); +} +`; + +/* eslint-disable max-len */ +const toIntDownCast = length => `\ +/** + * @dev Returns the downcasted int${length} from int256, reverting on + * overflow (when the input is less than smallest int${length} or + * greater than largest int${length}). + * + * Counterpart to Solidity's \`int${length}\` operator. + * + * Requirements: + * + * - input must fit into ${length} bits + * + * _Available since v${version('toInt(int)', length)}._ + */ +function toInt${length}(int256 value) internal pure returns (int${length}) { + require(value >= type(int${length}).min && value <= type(int${length}).max, "SafeCast: value doesn't fit in ${length} bits"); + return int${length}(value); +} +`; +/* eslint-enable max-len */ + +const toInt = length => `\ +/** + * @dev Converts an unsigned uint${length} into a signed int${length}. + * + * Requirements: + * + * - input must be less than or equal to maxInt${length}. + * + * _Available since v${version('toInt(uint)', length)}._ + */ +function toInt${length}(uint${length} value) internal pure returns (int${length}) { + // Note: Unsafe cast below is okay because \`type(int${length}).max\` is guaranteed to be positive + require(value <= uint${length}(type(int${length}).max), "SafeCast: value doesn't fit in an int${length}"); + return int${length}(value); +} +`; + +const toUint = length => `\ +/** + * @dev Converts a signed int${length} into an unsigned uint${length}. + * + * Requirements: + * + * - input must be greater than or equal to 0. + * + * _Available since v${version('toUint(int)', length)}._ + */ +function toUint${length}(int${length} value) internal pure returns (uint${length}) { + require(value >= 0, "SafeCast: value must be positive"); + return uint${length}(value); +} +`; + +// GENERATE +module.exports = format( + header.trimEnd(), + 'library SafeCast {', + [ + ...LENGTHS.map(size => toUintDownCast(size)), + toUint(256), + ...LENGTHS.map(size => toIntDownCast(size)), + toInt(256).trimEnd(), + ], + '}', +); diff --git a/scripts/generate/templates/SafeCastMock.js b/scripts/generate/templates/SafeCastMock.js new file mode 100755 index 000000000..9bb64d2c7 --- /dev/null +++ b/scripts/generate/templates/SafeCastMock.js @@ -0,0 +1,50 @@ +const format = require('../format-lines'); +const { range } = require('../../helpers'); + +const LENGTHS = range(8, 256, 8).reverse(); // 248 → 8 (in steps of 8) + +const header = `\ +pragma solidity ^0.8.0; + +import "../utils/math/SafeCast.sol"; +`; + +const toInt = length => `\ +function toInt${length}(uint${length} a) public pure returns (int${length}) { + return a.toInt${length}(); +} +`; + +const toUint = length => `\ +function toUint${length}(int${length} a) public pure returns (uint${length}) { + return a.toUint${length}(); +} +`; + +const toIntDownCast = length => `\ +function toInt${length}(int256 a) public pure returns (int${length}) { + return a.toInt${length}(); +} +`; + +const toUintDownCast = length => `\ +function toUint${length}(uint256 a) public pure returns (uint${length}) { + return a.toUint${length}(); +} +`; + +// GENERATE +module.exports = format( + header, + 'contract SafeCastMock {', + [ + 'using SafeCast for uint256;', + 'using SafeCast for int256;', + '', + toUint(256), + ...LENGTHS.map(size => toUintDownCast(size)), + toInt(256), + ...LENGTHS.map(size => toIntDownCast(size)), + ].flatMap(fn => fn.split('\n')).slice(0, -1), + '}', +); diff --git a/scripts/helpers.js b/scripts/helpers.js new file mode 100644 index 000000000..cbd0e01e3 --- /dev/null +++ b/scripts/helpers.js @@ -0,0 +1,23 @@ +function chunk (array, size = 1) { + return Array.range(Math.ceil(array.length / size)).map(i => array.slice(i * size, i * size + size)); +} + +function range (start, stop = undefined, step = 1) { + if (!stop) { stop = start; start = 0; } + return start < stop ? Array(Math.ceil((stop - start) / step)).fill().map((_, i) => start + i * step) : []; +} + +function unique (array, op = x => x) { + return array.filter((obj, i) => array.findIndex(entry => op(obj) === op(entry)) === i); +} + +function zip (...args) { + return Array(Math.max(...args.map(arg => arg.length))).fill(null).map((_, i) => args.map(arg => arg[i])); +} + +module.exports = { + chunk, + range, + unique, + zip, +}; diff --git a/test/utils/math/SafeCast.test.js b/test/utils/math/SafeCast.test.js index 09c7a3f1a..97fc22e92 100644 --- a/test/utils/math/SafeCast.test.js +++ b/test/utils/math/SafeCast.test.js @@ -1,6 +1,6 @@ const { BN, expectRevert } = require('@openzeppelin/test-helpers'); - const { expect } = require('chai'); +const { range } = require('../../../scripts/helpers'); const SafeCastMock = artifacts.require('SafeCastMock'); @@ -41,7 +41,7 @@ contract('SafeCast', async (accounts) => { }); } - [8, 16, 32, 64, 96, 128, 224].forEach(bits => testToUint(bits)); + range(8, 256, 8).forEach(bits => testToUint(bits)); describe('toUint256', () => { const maxInt256 = new BN('2').pow(new BN(255)).subn(1); @@ -129,7 +129,7 @@ contract('SafeCast', async (accounts) => { }); } - [8, 16, 32, 64, 128].forEach(bits => testToInt(bits)); + range(8, 256, 8).forEach(bits => testToInt(bits)); describe('toInt256', () => { const maxUint256 = new BN('2').pow(new BN(256)).subn(1); From de74c8c62ce0eeae80cb9af27d70ede30f09fa22 Mon Sep 17 00:00:00 2001 From: Artur <1930175+arturictus@users.noreply.github.com> Date: Mon, 23 May 2022 09:02:27 +0100 Subject: [PATCH 73/81] Add bytes32 to uint enumerable map (#3416) --- CHANGELOG.md | 1 + contracts/mocks/EnumerableMapMock.sol | 43 +++++++++++ contracts/utils/structs/EnumerableMap.sol | 93 +++++++++++++++++++++++ test/utils/structs/EnumerableMap.test.js | 26 +++++-- 4 files changed, 157 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71182a178..fbaecfb1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * `ERC20FlashMint`: Add customizable flash fee receiver. ([#3327](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3327)) * `Strings`: add a new overloaded function `toHexString` that converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. ([#3403](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3403)) * `EnumerableMap`: add new `UintToUintMap` map type. ([#3338](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3338)) + * `EnumerableMap`: add new `Bytes32ToUintMap` map type. ([#3416](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3416)) * `SafeCast`: add support for many more types, using procedural code generation. ([#3245](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3245)) ## 4.6.0 (2022-04-26) diff --git a/contracts/mocks/EnumerableMapMock.sol b/contracts/mocks/EnumerableMapMock.sol index fec07252b..dbdf2b249 100644 --- a/contracts/mocks/EnumerableMapMock.sol +++ b/contracts/mocks/EnumerableMapMock.sol @@ -174,3 +174,46 @@ contract UintToUintMapMock { return _map.get(key, errorMessage); } } + +// Bytes32ToUintMap +contract Bytes32ToUintMapMock { + using EnumerableMap for EnumerableMap.Bytes32ToUintMap; + + event OperationResult(bool result); + + EnumerableMap.Bytes32ToUintMap private _map; + + function contains(bytes32 key) public view returns (bool) { + return _map.contains(key); + } + + function set(bytes32 key, uint256 value) public { + bool result = _map.set(key, value); + emit OperationResult(result); + } + + function remove(bytes32 key) public { + bool result = _map.remove(key); + emit OperationResult(result); + } + + function length() public view returns (uint256) { + return _map.length(); + } + + function at(uint256 index) public view returns (bytes32 key, uint256 value) { + return _map.at(index); + } + + function tryGet(bytes32 key) public view returns (bool, uint256) { + return _map.tryGet(key); + } + + function get(bytes32 key) public view returns (uint256) { + return _map.get(key); + } + + function getWithMessage(bytes32 key, string calldata errorMessage) public view returns (uint256) { + return _map.get(key, errorMessage); + } +} diff --git a/contracts/utils/structs/EnumerableMap.sol b/contracts/utils/structs/EnumerableMap.sol index 7e8f4e902..7c09231f2 100644 --- a/contracts/utils/structs/EnumerableMap.sol +++ b/contracts/utils/structs/EnumerableMap.sol @@ -32,6 +32,7 @@ import "./EnumerableSet.sol"; * - `address -> uint256` (`AddressToUintMap`) since v4.6.0 * - `bytes32 -> bytes32` (`Bytes32ToBytes32`) since v4.6.0 * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0 + * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0 * * [WARNING] * ==== @@ -433,4 +434,96 @@ library EnumerableMap { ) internal view returns (uint256) { return uint256(get(map._inner, bytes32(uint256(uint160(key))), errorMessage)); } + + // Bytes32ToUintMap + + struct Bytes32ToUintMap { + Bytes32ToBytes32Map _inner; + } + + /** + * @dev Adds a key-value pair to a map, or updates the value for an existing + * key. O(1). + * + * Returns true if the key was added to the map, that is if it was not + * already present. + */ + function set( + Bytes32ToUintMap storage map, + bytes32 key, + uint256 value + ) internal returns (bool) { + return set(map._inner, key, bytes32(value)); + } + + /** + * @dev Removes a value from a set. O(1). + * + * Returns true if the key was removed from the map, that is if it was present. + */ + function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) { + return remove(map._inner, key); + } + + /** + * @dev Returns true if the key is in the map. O(1). + */ + function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) { + return contains(map._inner, key); + } + + /** + * @dev Returns the number of elements in the map. O(1). + */ + function length(Bytes32ToUintMap storage map) internal view returns (uint256) { + return length(map._inner); + } + + /** + * @dev Returns the element stored at position `index` in the set. O(1). + * Note that there are no guarantees on the ordering of values inside the + * array, and it may change when more values are added or removed. + * + * Requirements: + * + * - `index` must be strictly less than {length}. + */ + function at(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) { + (bytes32 key, bytes32 value) = at(map._inner, index); + return (key, uint256(value)); + } + + /** + * @dev Tries to returns the value associated with `key`. O(1). + * Does not revert if `key` is not in the map. + */ + function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) { + (bool success, bytes32 value) = tryGet(map._inner, key); + return (success, uint256(value)); + } + + /** + * @dev Returns the value associated with `key`. O(1). + * + * Requirements: + * + * - `key` must be in the map. + */ + function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) { + return uint256(get(map._inner, key)); + } + + /** + * @dev Same as {get}, with a custom error message when `key` is not in the map. + * + * CAUTION: This function is deprecated because it requires allocating memory for the error + * message unnecessarily. For custom revert reasons use {tryGet}. + */ + function get( + Bytes32ToUintMap storage map, + bytes32 key, + string memory errorMessage + ) internal view returns (uint256) { + return uint256(get(map._inner, key, errorMessage)); + } } diff --git a/test/utils/structs/EnumerableMap.test.js b/test/utils/structs/EnumerableMap.test.js index 4b800d219..58f4eb861 100644 --- a/test/utils/structs/EnumerableMap.test.js +++ b/test/utils/structs/EnumerableMap.test.js @@ -4,6 +4,7 @@ const AddressToUintMapMock = artifacts.require('AddressToUintMapMock'); const UintToAddressMapMock = artifacts.require('UintToAddressMapMock'); const Bytes32ToBytes32MapMock = artifacts.require('Bytes32ToBytes32MapMock'); const UintToUintMapMock = artifacts.require('UintToUintMapMock'); +const Bytes32ToUintMapMock = artifacts.require('Bytes32ToUintMapMock'); const { shouldBehaveLikeMap } = require('./EnumerableMap.behavior'); @@ -25,8 +26,8 @@ contract('EnumerableMap', function (accounts) { }); shouldBehaveLikeMap( - [accountA, accountB, accountC], - [keyA, keyB, keyC], + [ accountA, accountB, accountC ], + [ keyA, keyB, keyC ], new BN('0'), ); }); @@ -38,8 +39,8 @@ contract('EnumerableMap', function (accounts) { }); shouldBehaveLikeMap( - [keyA, keyB, keyC], - [accountA, accountB, accountC], + [ keyA, keyB, keyC ], + [ accountA, accountB, accountC ], constants.ZERO_ADDRESS, ); }); @@ -51,8 +52,8 @@ contract('EnumerableMap', function (accounts) { }); shouldBehaveLikeMap( - [keyA, keyB, keyC].map(k => ('0x' + k.toString(16)).padEnd(66, '0')), - [bytesA, bytesB, bytesC], + [ keyA, keyB, keyC ].map(k => '0x' + k.toString(16).padEnd(64, '0')), + [ bytesA, bytesB, bytesC ], constants.ZERO_BYTES32, ); }); @@ -69,4 +70,17 @@ contract('EnumerableMap', function (accounts) { new BN('0'), ); }); + + // Bytes32ToUintMap + describe('Bytes32ToUintMap', function () { + beforeEach(async function () { + this.map = await Bytes32ToUintMapMock.new(); + }); + + shouldBehaveLikeMap( + [ bytesA, bytesB, bytesC ], + [ keyA, keyB, keyC ], + new BN('0'), + ); + }); }); From c019e7c5bb28c7fceb6d0678580c07e8833b1dc1 Mon Sep 17 00:00:00 2001 From: silencio <87545449+silencioanon@users.noreply.github.com> Date: Mon, 23 May 2022 19:57:57 +0200 Subject: [PATCH 74/81] Fix typo causing broken URL in ERC20Snapshot comment (#3428) --- contracts/token/ERC20/extensions/ERC20Snapshot.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/ERC20/extensions/ERC20Snapshot.sol b/contracts/token/ERC20/extensions/ERC20Snapshot.sol index d5acaa2f0..a28b638b9 100644 --- a/contracts/token/ERC20/extensions/ERC20Snapshot.sol +++ b/contracts/token/ERC20/extensions/ERC20Snapshot.sol @@ -41,7 +41,7 @@ import "../../../utils/Counters.sol"; abstract contract ERC20Snapshot is ERC20 { // Inspired by Jordi Baylina's MiniMeToken to record historical balances: - // https://github.com/Giveth/minimd/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol + // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol using Arrays for uint256[]; using Counters for Counters.Counter; From 65b45726b34dafe8fc3ef78c3d4b7b3f404f61ad Mon Sep 17 00:00:00 2001 From: Nate Lapinski Date: Tue, 24 May 2022 03:37:08 +0900 Subject: [PATCH 75/81] Add memory safe assembly annotations (#3384) Co-authored-by: Nate --- contracts/metatx/ERC2771Context.sol | 1 + contracts/metatx/MinimalForwarder.sol | 1 + contracts/proxy/Clones.sol | 3 +++ contracts/token/ERC721/ERC721.sol | 1 + contracts/utils/Address.sol | 2 +- contracts/utils/Base64.sol | 1 + contracts/utils/StorageSlot.sol | 4 ++++ contracts/utils/structs/EnumerableSet.sol | 2 ++ 8 files changed, 14 insertions(+), 1 deletion(-) diff --git a/contracts/metatx/ERC2771Context.sol b/contracts/metatx/ERC2771Context.sol index b5d16e560..896b8bf3b 100644 --- a/contracts/metatx/ERC2771Context.sol +++ b/contracts/metatx/ERC2771Context.sol @@ -24,6 +24,7 @@ abstract contract ERC2771Context is Context { function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. + /// @solidity memory-safe-assembly assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } diff --git a/contracts/metatx/MinimalForwarder.sol b/contracts/metatx/MinimalForwarder.sol index a7a1899f4..085f0bb09 100644 --- a/contracts/metatx/MinimalForwarder.sol +++ b/contracts/metatx/MinimalForwarder.sol @@ -57,6 +57,7 @@ contract MinimalForwarder is EIP712 { // We explicitly trigger invalid opcode to consume all gas and bubble-up the effects, since // neither revert or assert consume all gas since Solidity 0.8.0 // https://docs.soliditylang.org/en/v0.8.0/control-structures.html#panic-via-assert-and-error-via-require + /// @solidity memory-safe-assembly assembly { invalid() } diff --git a/contracts/proxy/Clones.sol b/contracts/proxy/Clones.sol index 81c956c80..642cb1f1e 100644 --- a/contracts/proxy/Clones.sol +++ b/contracts/proxy/Clones.sol @@ -23,6 +23,7 @@ library Clones { * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { + /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x602d8060093d393df3363d3d373d3d3d363d7300000000000000000000000000) @@ -41,6 +42,7 @@ library Clones { * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { + /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x602d8060093d393df3363d3d373d3d3d363d7300000000000000000000000000) @@ -59,6 +61,7 @@ library Clones { bytes32 salt, address deployer ) internal pure returns (address predicted) { + /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, 0x602d8060093d393df3363d3d373d3d3d363d7300000000000000000000000000) diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index 9ba761074..140095d04 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -398,6 +398,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { + /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } diff --git a/contracts/utils/Address.sol b/contracts/utils/Address.sol index daea7f31e..eae89956e 100644 --- a/contracts/utils/Address.sol +++ b/contracts/utils/Address.sol @@ -209,7 +209,7 @@ library Address { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly - + /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) diff --git a/contracts/utils/Base64.sol b/contracts/utils/Base64.sol index 2de471d1d..d7b01000a 100644 --- a/contracts/utils/Base64.sol +++ b/contracts/utils/Base64.sol @@ -35,6 +35,7 @@ library Base64 { // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); + /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) diff --git a/contracts/utils/StorageSlot.sol b/contracts/utils/StorageSlot.sol index 28239dbc3..ec07fb2aa 100644 --- a/contracts/utils/StorageSlot.sol +++ b/contracts/utils/StorageSlot.sol @@ -50,6 +50,7 @@ library StorageSlot { * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { + /// @solidity memory-safe-assembly assembly { r.slot := slot } @@ -59,6 +60,7 @@ library StorageSlot { * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { + /// @solidity memory-safe-assembly assembly { r.slot := slot } @@ -68,6 +70,7 @@ library StorageSlot { * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { + /// @solidity memory-safe-assembly assembly { r.slot := slot } @@ -77,6 +80,7 @@ library StorageSlot { * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { + /// @solidity memory-safe-assembly assembly { r.slot := slot } diff --git a/contracts/utils/structs/EnumerableSet.sol b/contracts/utils/structs/EnumerableSet.sol index cb7852622..d6adb14cd 100644 --- a/contracts/utils/structs/EnumerableSet.sol +++ b/contracts/utils/structs/EnumerableSet.sol @@ -283,6 +283,7 @@ library EnumerableSet { bytes32[] memory store = _values(set._inner); address[] memory result; + /// @solidity memory-safe-assembly assembly { result := store } @@ -356,6 +357,7 @@ library EnumerableSet { bytes32[] memory store = _values(set._inner); uint256[] memory result; + /// @solidity memory-safe-assembly assembly { result := store } From f8157ac854f0967e173622180902cc15230d5570 Mon Sep 17 00:00:00 2001 From: Colin Hicks <80708120+colinjhicks@users.noreply.github.com> Date: Wed, 25 May 2022 01:39:15 -0600 Subject: [PATCH 76/81] Add multiProofVerify (#3276) --- CHANGELOG.md | 1 + contracts/mocks/MerkleProofWrapper.sol | 17 +++++ contracts/utils/cryptography/MerkleProof.sol | 73 +++++++++++++++++--- docs/modules/ROOT/pages/utilities.adoc | 6 +- test/utils/cryptography/MerkleProof.test.js | 66 ++++++++++++++++++ 5 files changed, 154 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbaecfb1b..5d73a30d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * `EnumerableMap`: add new `UintToUintMap` map type. ([#3338](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3338)) * `EnumerableMap`: add new `Bytes32ToUintMap` map type. ([#3416](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3416)) * `SafeCast`: add support for many more types, using procedural code generation. ([#3245](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3245)) + * `MerkleProof`: add `multiProofVerify` to prove multiple values are part of a Merkle tree. ([#3276](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3276)) ## 4.6.0 (2022-04-26) diff --git a/contracts/mocks/MerkleProofWrapper.sol b/contracts/mocks/MerkleProofWrapper.sol index 1e188df36..a58e69f3b 100644 --- a/contracts/mocks/MerkleProofWrapper.sol +++ b/contracts/mocks/MerkleProofWrapper.sol @@ -16,4 +16,21 @@ contract MerkleProofWrapper { function processProof(bytes32[] memory proof, bytes32 leaf) public pure returns (bytes32) { return MerkleProof.processProof(proof, leaf); } + + function multiProofVerify( + bytes32 root, + bytes32[] memory leafs, + bytes32[] memory proofs, + bool[] memory proofFlag + ) public pure returns (bool) { + return MerkleProof.multiProofVerify(root, leafs, proofs, proofFlag); + } + + function processMultiProof( + bytes32[] memory leafs, + bytes32[] memory proofs, + bool[] memory proofFlag + ) public pure returns (bytes32) { + return MerkleProof.processMultiProof(leafs, proofs, proofFlag); + } } diff --git a/contracts/utils/cryptography/MerkleProof.sol b/contracts/utils/cryptography/MerkleProof.sol index 23ef1f077..ea4217c8e 100644 --- a/contracts/utils/cryptography/MerkleProof.sol +++ b/contracts/utils/cryptography/MerkleProof.sol @@ -43,18 +43,75 @@ library MerkleProof { function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { - bytes32 proofElement = proof[i]; - if (computedHash <= proofElement) { - // Hash(current computed hash + current element of the proof) - computedHash = _efficientHash(computedHash, proofElement); - } else { - // Hash(current element of the proof + current computed hash) - computedHash = _efficientHash(proofElement, computedHash); - } + computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } + /** + * @dev Returns true if a `leafs` can be proved to be a part of a Merkle tree + * defined by `root`. For this, `proofs` for each leaf must be provided, containing + * sibling hashes on the branch from the leaf to the root of the tree. Then + * 'proofFlag' designates the nodes needed for the multi proof. + * + * _Available since v4.7._ + */ + function multiProofVerify( + bytes32 root, + bytes32[] memory leafs, + bytes32[] memory proofs, + bool[] memory proofFlag + ) internal pure returns (bool) { + return processMultiProof(leafs, proofs, proofFlag) == root; + } + + /** + * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up + * from `leaf` using the multi proof as `proofFlag`. A multi proof is + * valid if the final hash matches the root of the tree. + * + * _Available since v4.7._ + */ + function processMultiProof( + bytes32[] memory leafs, + bytes32[] memory proofs, + bool[] memory proofFlag + ) internal pure returns (bytes32 merkleRoot) { + // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by + // consuming and producing values on a queue. The queue starts with the `leafs` array, then goes onto the + // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of + // the merkle tree. + uint256 leafsLen = leafs.length; + uint256 proofsLen = proofs.length; + uint256 totalHashes = proofFlag.length; + + // Check proof validity. + require(leafsLen + proofsLen - 1 == totalHashes, "MerkleProof: invalid multiproof"); + + // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using + // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". + bytes32[] memory hashes = new bytes32[](totalHashes); + uint256 leafPos = 0; + uint256 hashPos = 0; + uint256 proofPos = 0; + // At each step, we compute the next hash using two values: + // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we + // get the next hash. + // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the + // `proofs` array. + for (uint256 i = 0; i < totalHashes; i++) { + bytes32 a = leafPos < leafsLen ? leafs[leafPos++] : hashes[hashPos++]; + bytes32 b = proofFlag[i] ? leafPos < leafsLen ? leafs[leafPos++] : hashes[hashPos++] : proofs[proofPos++]; + hashes[i] = _hashPair(a, b); + } + + return hashes[totalHashes - 1]; + } + + function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { + return a < b ? _efficientHash(a, b) : _efficientHash(b, a); + } + function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { diff --git a/docs/modules/ROOT/pages/utilities.adoc b/docs/modules/ROOT/pages/utilities.adoc index 81839c16b..e2649098c 100644 --- a/docs/modules/ROOT/pages/utilities.adoc +++ b/docs/modules/ROOT/pages/utilities.adoc @@ -26,7 +26,11 @@ WARNING: Getting signature verification right is not trivial: make sure you full === Verifying Merkle Proofs -xref:api:cryptography.adoc#MerkleProof[`MerkleProof`] provides xref:api:cryptography.adoc#MerkleProof-verify-bytes32---bytes32-bytes32-[`verify`], which can prove that some value is part of a https://en.wikipedia.org/wiki/Merkle_tree[Merkle tree]. +xref:api:cryptography.adoc#MerkleProof[`MerkleProof`] provides: + +* xref:api:cryptography.adoc#MerkleProof-verify-bytes32---bytes32-bytes32-[`verify`] - can prove that some value is part of a https://en.wikipedia.org/wiki/Merkle_tree[Merkle tree]. + +* xref:api:cryptography.adoc#MerkleProof-multiProofVerify-bytes32-bytes32---bytes32---bool---[`multiProofVerify`] - can prove multiple values are part of a Merkle tree. [[introspection]] == Introspection diff --git a/test/utils/cryptography/MerkleProof.test.js b/test/utils/cryptography/MerkleProof.test.js index 61fa45c3e..069d79221 100644 --- a/test/utils/cryptography/MerkleProof.test.js +++ b/test/utils/cryptography/MerkleProof.test.js @@ -1,5 +1,6 @@ require('@openzeppelin/test-helpers'); +const { expectRevert } = require('@openzeppelin/test-helpers'); const { MerkleTree } = require('merkletreejs'); const keccak256 = require('keccak256'); @@ -62,4 +63,69 @@ contract('MerkleProof', function (accounts) { expect(await this.merkleProof.verify(badProof, root, leaf)).to.equal(false); }); }); + + describe('multiProofVerify', function () { + it('returns true for a valid Merkle multi proof', async function () { + const leaves = ['a', 'b', 'c', 'd', 'e', 'f'].map(keccak256).sort(Buffer.compare); + const merkleTree = new MerkleTree(leaves, keccak256, { sort: true }); + + const root = merkleTree.getRoot(); + const proofLeaves = ['b', 'f', 'd'].map(keccak256).sort(Buffer.compare); + const proof = merkleTree.getMultiProof(proofLeaves); + const proofFlags = merkleTree.getProofFlags(proofLeaves, proof); + + expect(await this.merkleProof.multiProofVerify(root, proofLeaves, proof, proofFlags)).to.equal(true); + }); + + it('returns false for an invalid Merkle multi proof', async function () { + const leaves = ['a', 'b', 'c', 'd', 'e', 'f'].map(keccak256).sort(Buffer.compare); + const merkleTree = new MerkleTree(leaves, keccak256, { sort: true }); + + const root = merkleTree.getRoot(); + const badProofLeaves = ['g', 'h', 'i'].map(keccak256).sort(Buffer.compare); + const badMerkleTree = new MerkleTree(badProofLeaves); + const badProof = badMerkleTree.getMultiProof(badProofLeaves); + const badProofFlags = badMerkleTree.getProofFlags(badProofLeaves, badProof); + + expect(await this.merkleProof.multiProofVerify(root, badProofLeaves, badProof, badProofFlags)).to.equal(false); + }); + + it('revert with invalid multi proof #1', async function () { + const fill = Buffer.alloc(32); // This could be anything, we are reconstructing a fake branch + const leaves = ['a', 'b', 'c', 'd'].map(keccak256).sort(Buffer.compare); + const badLeave = keccak256('e'); + const merkleTree = new MerkleTree(leaves, keccak256, { sort: true }); + + const root = merkleTree.getRoot(); + + await expectRevert( + this.merkleProof.multiProofVerify( + root, + [ leaves[0], badLeave ], // A, E + [ leaves[1], fill, merkleTree.layers[1][1] ], + [ false, false, false ], + ), + 'MerkleProof: invalid multiproof', + ); + }); + + it('revert with invalid multi proof #2', async function () { + const fill = Buffer.alloc(32); // This could be anything, we are reconstructing a fake branch + const leaves = ['a', 'b', 'c', 'd'].map(keccak256).sort(Buffer.compare); + const badLeave = keccak256('e'); + const merkleTree = new MerkleTree(leaves, keccak256, { sort: true }); + + const root = merkleTree.getRoot(); + + await expectRevert( + this.merkleProof.multiProofVerify( + root, + [ badLeave, leaves[0] ], // A, E + [ leaves[1], fill, merkleTree.layers[1][1] ], + [ false, false, false, false ], + ), + 'reverted with panic code 0x32', + ); + }); + }); }); From 61294a62af210e5880314489c5e8dcfde218b83b Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Wed, 25 May 2022 20:01:45 +0200 Subject: [PATCH 77/81] Restore previous behavior of initializer during construction (#3344) --- contracts/mocks/InitializableMock.sol | 12 ++++++++++++ contracts/proxy/utils/Initializable.sol | 22 +++++++++++++--------- test/proxy/utils/Initializable.test.js | 9 +++++++++ 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/contracts/mocks/InitializableMock.sol b/contracts/mocks/InitializableMock.sol index bdf53991f..91ceabe91 100644 --- a/contracts/mocks/InitializableMock.sol +++ b/contracts/mocks/InitializableMock.sol @@ -60,6 +60,18 @@ contract ConstructorInitializableMock is Initializable { } } +contract ChildConstructorInitializableMock is ConstructorInitializableMock { + bool public childInitializerRan; + + constructor() initializer { + childInitialize(); + } + + function childInitialize() public initializer { + childInitializerRan = true; + } +} + contract ReinitializerMock is Initializable { uint256 public counter; diff --git a/contracts/proxy/utils/Initializable.sol b/contracts/proxy/utils/Initializable.sol index fc9461d86..9e8bb6e67 100644 --- a/contracts/proxy/utils/Initializable.sol +++ b/contracts/proxy/utils/Initializable.sol @@ -134,16 +134,20 @@ abstract contract Initializable { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level // of initializers, because in other contexts the contract may have been reentered. - if (_initializing) { - require( - version == 1 && !Address.isContract(address(this)), - "Initializable: contract is already initialized" - ); - return false; - } else { - require(_initialized < version, "Initializable: contract is already initialized"); + + bool isTopLevelCall = !_initializing; // cache sload + uint8 currentVersion = _initialized; // cache sload + + require( + (isTopLevelCall && version > currentVersion) || // not nested with increasing version or + (!Address.isContract(address(this)) && (version == 1 || version == type(uint8).max)), // contract being constructed + "Initializable: contract is already initialized" + ); + + if (isTopLevelCall) { _initialized = version; - return true; } + + return isTopLevelCall; } } diff --git a/test/proxy/utils/Initializable.test.js b/test/proxy/utils/Initializable.test.js index 9879b4820..28f272adc 100644 --- a/test/proxy/utils/Initializable.test.js +++ b/test/proxy/utils/Initializable.test.js @@ -3,6 +3,7 @@ const { expect } = require('chai'); const InitializableMock = artifacts.require('InitializableMock'); const ConstructorInitializableMock = artifacts.require('ConstructorInitializableMock'); +const ChildConstructorInitializableMock = artifacts.require('ChildConstructorInitializableMock'); const ReinitializerMock = artifacts.require('ReinitializerMock'); const SampleChild = artifacts.require('SampleChild'); @@ -54,6 +55,13 @@ contract('Initializable', function (accounts) { expect(await contract2.onlyInitializingRan()).to.equal(true); }); + it('multiple constructor levels can be initializers', async function () { + const contract2 = await ChildConstructorInitializableMock.new(); + expect(await contract2.initializerRan()).to.equal(true); + expect(await contract2.childInitializerRan()).to.equal(true); + expect(await contract2.onlyInitializingRan()).to.equal(true); + }); + describe('reinitialization', function () { beforeEach('deploying', async function () { this.contract = await ReinitializerMock.new(); @@ -79,6 +87,7 @@ contract('Initializable', function (accounts) { it('cannot nest reinitializers', async function () { expect(await this.contract.counter()).to.be.bignumber.equal('0'); + await expectRevert(this.contract.nestedReinitialize(2, 2), 'Initializable: contract is already initialized'); await expectRevert(this.contract.nestedReinitialize(2, 3), 'Initializable: contract is already initialized'); await expectRevert(this.contract.nestedReinitialize(3, 2), 'Initializable: contract is already initialized'); }); From 94eba740161e64c5c9f4574c16422ad7eb1f273d Mon Sep 17 00:00:00 2001 From: Michael George Date: Wed, 25 May 2022 16:06:34 -0400 Subject: [PATCH 78/81] removed some patch cruft --- certora/applyHarness.patch | 1992 +----------------------------------- 1 file changed, 12 insertions(+), 1980 deletions(-) diff --git a/certora/applyHarness.patch b/certora/applyHarness.patch index 9dbbc8e43..833d550dc 100644 --- a/certora/applyHarness.patch +++ b/certora/applyHarness.patch @@ -1,6 +1,6 @@ diff -ruN access/AccessControl.sol access/AccessControl.sol --- access/AccessControl.sol 2022-05-25 15:36:58.849363940 -0400 -+++ access/AccessControl.sol 2022-05-25 15:37:51.040083904 -0400 ++++ access/AccessControl.sol 2022-05-25 16:04:57.725255723 -0400 @@ -93,7 +93,7 @@ * * _Available since v4.6._ @@ -12,7 +12,7 @@ diff -ruN access/AccessControl.sol access/AccessControl.sol diff -ruN governance/extensions/GovernorPreventLateQuorum.sol governance/extensions/GovernorPreventLateQuorum.sol --- governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 15:37:51.044083806 -0400 ++++ governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 16:04:57.725255723 -0400 @@ -21,8 +21,8 @@ using SafeCast for uint256; using Timers for Timers.BlockNumber; @@ -26,7 +26,7 @@ diff -ruN governance/extensions/GovernorPreventLateQuorum.sol governance/extensi event ProposalExtended(uint256 indexed proposalId, uint64 extendedDeadline); diff -ruN governance/Governor.sol governance/Governor.sol --- governance/Governor.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/Governor.sol 2022-05-25 15:37:51.040083904 -0400 ++++ governance/Governor.sol 2022-05-25 16:04:57.725255723 -0400 @@ -44,7 +44,7 @@ string private _name; @@ -36,609 +36,9 @@ diff -ruN governance/Governor.sol governance/Governor.sol // This queue keeps track of the governor operating on itself. Calls to functions protected by the // {onlyGovernance} modifier needs to be whitelisted in this queue. Whitelisting is set in {_beforeExecute}, -diff -ruN governance/Governor.sol.orig governance/Governor.sol.orig ---- governance/Governor.sol.orig 1969-12-31 19:00:00.000000000 -0500 -+++ governance/Governor.sol.orig 2022-05-25 15:37:51.036084000 -0400 -@@ -0,0 +1,596 @@ -+// SPDX-License-Identifier: MIT -+// OpenZeppelin Contracts (last updated v4.6.0) (governance/Governor.sol) -+ -+pragma solidity ^0.8.0; -+ -+import "../token/ERC721/IERC721Receiver.sol"; -+import "../token/ERC1155/IERC1155Receiver.sol"; -+import "../utils/cryptography/ECDSA.sol"; -+import "../utils/cryptography/draft-EIP712.sol"; -+import "../utils/introspection/ERC165.sol"; -+import "../utils/math/SafeCast.sol"; -+import "../utils/structs/DoubleEndedQueue.sol"; -+import "../utils/Address.sol"; -+import "../utils/Context.sol"; -+import "../utils/Timers.sol"; -+import "./IGovernor.sol"; -+ -+/** -+ * @dev Core of the governance system, designed to be extended though various modules. -+ * -+ * This contract is abstract and requires several function to be implemented in various modules: -+ * -+ * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote} -+ * - A voting module must implement {_getVotes} -+ * - Additionanly, the {votingPeriod} must also be implemented -+ * -+ * _Available since v4.3._ -+ */ -+abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receiver, IERC1155Receiver { -+ using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque; -+ using SafeCast for uint256; -+ using Timers for Timers.BlockNumber; -+ -+ bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,uint8 support)"); -+ bytes32 public constant EXTENDED_BALLOT_TYPEHASH = -+ keccak256("ExtendedBallot(uint256 proposalId,uint8 support,string reason,bytes params)"); -+ -+ struct ProposalCore { -+ Timers.BlockNumber voteStart; -+ Timers.BlockNumber voteEnd; -+ bool executed; -+ bool canceled; -+ } -+ -+ string private _name; -+ -+ mapping(uint256 => ProposalCore) private _proposals; -+ -+ // This queue keeps track of the governor operating on itself. Calls to functions protected by the -+ // {onlyGovernance} modifier needs to be whitelisted in this queue. Whitelisting is set in {_beforeExecute}, -+ // consumed by the {onlyGovernance} modifier and eventually reset in {_afterExecute}. This ensures that the -+ // execution of {onlyGovernance} protected calls can only be achieved through successful proposals. -+ DoubleEndedQueue.Bytes32Deque private _governanceCall; -+ -+ /** -+ * @dev Restricts a function so it can only be executed through governance proposals. For example, governance -+ * parameter setters in {GovernorSettings} are protected using this modifier. -+ * -+ * The governance executing address may be different from the Governor's own address, for example it could be a -+ * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these -+ * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus, -+ * for example, additional timelock proposers are not able to change governance parameters without going through the -+ * governance protocol (since v4.6). -+ */ -+ modifier onlyGovernance() { -+ require(_msgSender() == _executor(), "Governor: onlyGovernance"); -+ if (_executor() != address(this)) { -+ bytes32 msgDataHash = keccak256(_msgData()); -+ // loop until popping the expected operation - throw if deque is empty (operation not authorized) -+ while (_governanceCall.popFront() != msgDataHash) {} -+ } -+ _; -+ } -+ -+ /** -+ * @dev Sets the value for {name} and {version} -+ */ -+ constructor(string memory name_) EIP712(name_, version()) { -+ _name = name_; -+ } -+ -+ /** -+ * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract) -+ */ -+ receive() external payable virtual { -+ require(_executor() == address(this)); -+ } -+ -+ /** -+ * @dev See {IERC165-supportsInterface}. -+ */ -+ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { -+ // In addition to the current interfaceId, also support previous version of the interfaceId that did not -+ // include the castVoteWithReasonAndParams() function as standard -+ return -+ interfaceId == -+ (type(IGovernor).interfaceId ^ -+ this.castVoteWithReasonAndParams.selector ^ -+ this.castVoteWithReasonAndParamsBySig.selector ^ -+ this.getVotesWithParams.selector) || -+ interfaceId == type(IGovernor).interfaceId || -+ interfaceId == type(IERC1155Receiver).interfaceId || -+ super.supportsInterface(interfaceId); -+ } -+ -+ /** -+ * @dev See {IGovernor-name}. -+ */ -+ function name() public view virtual override returns (string memory) { -+ return _name; -+ } -+ -+ /** -+ * @dev See {IGovernor-version}. -+ */ -+ function version() public view virtual override returns (string memory) { -+ return "1"; -+ } -+ -+ /** -+ * @dev See {IGovernor-hashProposal}. -+ * -+ * The proposal id is produced by hashing the RLC encoded `targets` array, the `values` array, the `calldatas` array -+ * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id -+ * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in -+ * advance, before the proposal is submitted. -+ * -+ * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the -+ * same proposal (with same operation and same description) will have the same id if submitted on multiple governors -+ * across multiple networks. This also means that in order to execute the same operation twice (on the same -+ * governor) the proposer will have to change the description in order to avoid proposal id conflicts. -+ */ -+ function hashProposal( -+ address[] memory targets, -+ uint256[] memory values, -+ bytes[] memory calldatas, -+ bytes32 descriptionHash -+ ) public pure virtual override returns (uint256) { -+ return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash))); -+ } -+ -+ /** -+ * @dev See {IGovernor-state}. -+ */ -+ function state(uint256 proposalId) public view virtual override returns (ProposalState) { -+ ProposalCore storage proposal = _proposals[proposalId]; -+ -+ if (proposal.executed) { -+ return ProposalState.Executed; -+ } -+ -+ if (proposal.canceled) { -+ return ProposalState.Canceled; -+ } -+ -+ uint256 snapshot = proposalSnapshot(proposalId); -+ -+ if (snapshot == 0) { -+ revert("Governor: unknown proposal id"); -+ } -+ -+ if (snapshot >= block.number) { -+ return ProposalState.Pending; -+ } -+ -+ uint256 deadline = proposalDeadline(proposalId); -+ -+ if (deadline >= block.number) { -+ return ProposalState.Active; -+ } -+ -+ if (_quorumReached(proposalId) && _voteSucceeded(proposalId)) { -+ return ProposalState.Succeeded; -+ } else { -+ return ProposalState.Defeated; -+ } -+ } -+ -+ /** -+ * @dev See {IGovernor-proposalSnapshot}. -+ */ -+ function proposalSnapshot(uint256 proposalId) public view virtual override returns (uint256) { -+ return _proposals[proposalId].voteStart.getDeadline(); -+ } -+ -+ /** -+ * @dev See {IGovernor-proposalDeadline}. -+ */ -+ function proposalDeadline(uint256 proposalId) public view virtual override returns (uint256) { -+ return _proposals[proposalId].voteEnd.getDeadline(); -+ } -+ -+ /** -+ * @dev Part of the Governor Bravo's interface: _"The number of votes required in order for a voter to become a proposer"_. -+ */ -+ function proposalThreshold() public view virtual returns (uint256) { -+ return 0; -+ } -+ -+ /** -+ * @dev Amount of votes already cast passes the threshold limit. -+ */ -+ function _quorumReached(uint256 proposalId) internal view virtual returns (bool); -+ -+ /** -+ * @dev Is the proposal successful or not. -+ */ -+ function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool); -+ -+ /** -+ * @dev Get the voting weight of `account` at a specific `blockNumber`, for a vote as described by `params`. -+ */ -+ function _getVotes( -+ address account, -+ uint256 blockNumber, -+ bytes memory params -+ ) internal view virtual returns (uint256); -+ -+ /** -+ * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`. -+ * -+ * Note: Support is generic and can represent various things depending on the voting system used. -+ */ -+ function _countVote( -+ uint256 proposalId, -+ address account, -+ uint8 support, -+ uint256 weight, -+ bytes memory params -+ ) internal virtual; -+ -+ /** -+ * @dev Default additional encoded parameters used by castVote methods that don't include them -+ * -+ * Note: Should be overridden by specific implementations to use an appropriate value, the -+ * meaning of the additional params, in the context of that implementation -+ */ -+ function _defaultParams() internal view virtual returns (bytes memory) { -+ return ""; -+ } -+ -+ /** -+ * @dev See {IGovernor-propose}. -+ */ -+ function propose( -+ address[] memory targets, -+ uint256[] memory values, -+ bytes[] memory calldatas, -+ string memory description -+ ) public virtual override returns (uint256) { -+ require( -+ getVotes(_msgSender(), block.number - 1) >= proposalThreshold(), -+ "Governor: proposer votes below proposal threshold" -+ ); -+ -+ uint256 proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description))); -+ -+ require(targets.length == values.length, "Governor: invalid proposal length"); -+ require(targets.length == calldatas.length, "Governor: invalid proposal length"); -+ require(targets.length > 0, "Governor: empty proposal"); -+ -+ ProposalCore storage proposal = _proposals[proposalId]; -+ require(proposal.voteStart.isUnset(), "Governor: proposal already exists"); -+ -+ uint64 snapshot = block.number.toUint64() + votingDelay().toUint64(); -+ uint64 deadline = snapshot + votingPeriod().toUint64(); -+ -+ proposal.voteStart.setDeadline(snapshot); -+ proposal.voteEnd.setDeadline(deadline); -+ -+ emit ProposalCreated( -+ proposalId, -+ _msgSender(), -+ targets, -+ values, -+ new string[](targets.length), -+ calldatas, -+ snapshot, -+ deadline, -+ description -+ ); -+ -+ return proposalId; -+ } -+ -+ /** -+ * @dev See {IGovernor-execute}. -+ */ -+ function execute( -+ address[] memory targets, -+ uint256[] memory values, -+ bytes[] memory calldatas, -+ bytes32 descriptionHash -+ ) public payable virtual override returns (uint256) { -+ uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash); -+ -+ ProposalState status = state(proposalId); -+ require( -+ status == ProposalState.Succeeded || status == ProposalState.Queued, -+ "Governor: proposal not successful" -+ ); -+ _proposals[proposalId].executed = true; -+ -+ emit ProposalExecuted(proposalId); -+ -+ _beforeExecute(proposalId, targets, values, calldatas, descriptionHash); -+ _execute(proposalId, targets, values, calldatas, descriptionHash); -+ _afterExecute(proposalId, targets, values, calldatas, descriptionHash); -+ -+ return proposalId; -+ } -+ -+ /** -+ * @dev Internal execution mechanism. Can be overridden to implement different execution mechanism -+ */ -+ function _execute( -+ uint256, /* proposalId */ -+ address[] memory targets, -+ uint256[] memory values, -+ bytes[] memory calldatas, -+ bytes32 /*descriptionHash*/ -+ ) internal virtual { -+ string memory errorMessage = "Governor: call reverted without message"; -+ for (uint256 i = 0; i < targets.length; ++i) { -+ (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]); -+ Address.verifyCallResult(success, returndata, errorMessage); -+ } -+ } -+ -+ /** -+ * @dev Hook before execution is triggered. -+ */ -+ function _beforeExecute( -+ uint256, /* proposalId */ -+ address[] memory targets, -+ uint256[] memory, /* values */ -+ bytes[] memory calldatas, -+ bytes32 /*descriptionHash*/ -+ ) internal virtual { -+ if (_executor() != address(this)) { -+ for (uint256 i = 0; i < targets.length; ++i) { -+ if (targets[i] == address(this)) { -+ _governanceCall.pushBack(keccak256(calldatas[i])); -+ } -+ } -+ } -+ } -+ -+ /** -+ * @dev Hook after execution is triggered. -+ */ -+ function _afterExecute( -+ uint256, /* proposalId */ -+ address[] memory, /* targets */ -+ uint256[] memory, /* values */ -+ bytes[] memory, /* calldatas */ -+ bytes32 /*descriptionHash*/ -+ ) internal virtual { -+ if (_executor() != address(this)) { -+ if (!_governanceCall.empty()) { -+ _governanceCall.clear(); -+ } -+ } -+ } -+ -+ /** -+ * @dev Internal cancel mechanism: locks up the proposal timer, preventing it from being re-submitted. Marks it as -+ * canceled to allow distinguishing it from executed proposals. -+ * -+ * Emits a {IGovernor-ProposalCanceled} event. -+ */ -+ function _cancel( -+ address[] memory targets, -+ uint256[] memory values, -+ bytes[] memory calldatas, -+ bytes32 descriptionHash -+ ) internal virtual returns (uint256) { -+ uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash); -+ ProposalState status = state(proposalId); -+ -+ require( -+ status != ProposalState.Canceled && status != ProposalState.Expired && status != ProposalState.Executed, -+ "Governor: proposal not active" -+ ); -+ _proposals[proposalId].canceled = true; -+ -+ emit ProposalCanceled(proposalId); -+ -+ return proposalId; -+ } -+ -+ /** -+ * @dev See {IGovernor-getVotes}. -+ */ -+ function getVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) { -+ return _getVotes(account, blockNumber, _defaultParams()); -+ } -+ -+ /** -+ * @dev See {IGovernor-getVotesWithParams}. -+ */ -+ function getVotesWithParams( -+ address account, -+ uint256 blockNumber, -+ bytes memory params -+ ) public view virtual override returns (uint256) { -+ return _getVotes(account, blockNumber, params); -+ } -+ -+ /** -+ * @dev See {IGovernor-castVote}. -+ */ -+ function castVote(uint256 proposalId, uint8 support) public virtual override returns (uint256) { -+ address voter = _msgSender(); -+ return _castVote(proposalId, voter, support, ""); -+ } -+ -+ /** -+ * @dev See {IGovernor-castVoteWithReason}. -+ */ -+ function castVoteWithReason( -+ uint256 proposalId, -+ uint8 support, -+ string calldata reason -+ ) public virtual override returns (uint256) { -+ address voter = _msgSender(); -+ return _castVote(proposalId, voter, support, reason); -+ } -+ -+ /** -+ * @dev See {IGovernor-castVoteWithReasonAndParams}. -+ */ -+ function castVoteWithReasonAndParams( -+ uint256 proposalId, -+ uint8 support, -+ string calldata reason, -+ bytes memory params -+ ) public virtual override returns (uint256) { -+ address voter = _msgSender(); -+ return _castVote(proposalId, voter, support, reason, params); -+ } -+ -+ /** -+ * @dev See {IGovernor-castVoteBySig}. -+ */ -+ function castVoteBySig( -+ uint256 proposalId, -+ uint8 support, -+ uint8 v, -+ bytes32 r, -+ bytes32 s -+ ) public virtual override returns (uint256) { -+ address voter = ECDSA.recover( -+ _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support))), -+ v, -+ r, -+ s -+ ); -+ return _castVote(proposalId, voter, support, ""); -+ } -+ -+ /** -+ * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}. -+ */ -+ function castVoteWithReasonAndParamsBySig( -+ uint256 proposalId, -+ uint8 support, -+ string calldata reason, -+ bytes memory params, -+ uint8 v, -+ bytes32 r, -+ bytes32 s -+ ) public virtual override returns (uint256) { -+ address voter = ECDSA.recover( -+ _hashTypedDataV4( -+ keccak256( -+ abi.encode( -+ EXTENDED_BALLOT_TYPEHASH, -+ proposalId, -+ support, -+ keccak256(bytes(reason)), -+ keccak256(params) -+ ) -+ ) -+ ), -+ v, -+ r, -+ s -+ ); -+ -+ return _castVote(proposalId, voter, support, reason, params); -+ } -+ -+ /** -+ * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve -+ * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams(). -+ * -+ * Emits a {IGovernor-VoteCast} event. -+ */ -+ function _castVote( -+ uint256 proposalId, -+ address account, -+ uint8 support, -+ string memory reason -+ ) internal virtual returns (uint256) { -+ return _castVote(proposalId, account, support, reason, _defaultParams()); -+ } -+ -+ /** -+ * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve -+ * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. -+ * -+ * Emits a {IGovernor-VoteCast} event. -+ */ -+ function _castVote( -+ uint256 proposalId, -+ address account, -+ uint8 support, -+ string memory reason, -+ bytes memory params -+ ) internal virtual returns (uint256) { -+ ProposalCore storage proposal = _proposals[proposalId]; -+ require(state(proposalId) == ProposalState.Active, "Governor: vote not currently active"); -+ -+ uint256 weight = _getVotes(account, proposal.voteStart.getDeadline(), params); -+ _countVote(proposalId, account, support, weight, params); -+ -+ if (params.length == 0) { -+ emit VoteCast(account, proposalId, support, weight, reason); -+ } else { -+ emit VoteCastWithParams(account, proposalId, support, weight, reason, params); -+ } -+ -+ return weight; -+ } -+ -+ /** -+ * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor -+ * is some contract other than the governor itself, like when using a timelock, this function can be invoked -+ * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. -+ * Note that if the executor is simply the governor itself, use of `relay` is redundant. -+ */ -+ function relay( -+ address target, -+ uint256 value, -+ bytes calldata data -+ ) external virtual onlyGovernance { -+ Address.functionCallWithValue(target, data, value); -+ } -+ -+ /** -+ * @dev Address through which the governor executes action. Will be overloaded by module that execute actions -+ * through another contract such as a timelock. -+ */ -+ function _executor() internal view virtual returns (address) { -+ return address(this); -+ } -+ -+ /** -+ * @dev See {IERC721Receiver-onERC721Received}. -+ */ -+ function onERC721Received( -+ address, -+ address, -+ uint256, -+ bytes memory -+ ) public virtual override returns (bytes4) { -+ return this.onERC721Received.selector; -+ } -+ -+ /** -+ * @dev See {IERC1155Receiver-onERC1155Received}. -+ */ -+ function onERC1155Received( -+ address, -+ address, -+ uint256, -+ uint256, -+ bytes memory -+ ) public virtual override returns (bytes4) { -+ return this.onERC1155Received.selector; -+ } -+ -+ /** -+ * @dev See {IERC1155Receiver-onERC1155BatchReceived}. -+ */ -+ function onERC1155BatchReceived( -+ address, -+ address, -+ uint256[] memory, -+ uint256[] memory, -+ bytes memory -+ ) public virtual override returns (bytes4) { -+ return this.onERC1155BatchReceived.selector; -+ } -+} diff -ruN governance/TimelockController.sol governance/TimelockController.sol --- governance/TimelockController.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/TimelockController.sol 2022-05-25 15:52:28.134311018 -0400 ++++ governance/TimelockController.sol 2022-05-25 16:04:57.725255723 -0400 @@ -28,10 +28,10 @@ bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); @@ -652,430 +52,9 @@ diff -ruN governance/TimelockController.sol governance/TimelockController.sol /** * @dev Emitted when a call is scheduled as part of operation `id`. -diff -ruN governance/TimelockController.sol.orig governance/TimelockController.sol.orig ---- governance/TimelockController.sol.orig 1969-12-31 19:00:00.000000000 -0500 -+++ governance/TimelockController.sol.orig 2022-05-25 15:37:51.036084000 -0400 -@@ -0,0 +1,417 @@ -+// SPDX-License-Identifier: MIT -+// OpenZeppelin Contracts (last updated v4.6.0) (governance/TimelockController.sol) -+ -+pragma solidity ^0.8.0; -+ -+import "../access/AccessControl.sol"; -+import "../token/ERC721/IERC721Receiver.sol"; -+import "../token/ERC1155/IERC1155Receiver.sol"; -+import "../utils/Address.sol"; -+ -+/** -+ * @dev Contract module which acts as a timelocked controller. When set as the -+ * owner of an `Ownable` smart contract, it enforces a timelock on all -+ * `onlyOwner` maintenance operations. This gives time for users of the -+ * controlled contract to exit before a potentially dangerous maintenance -+ * operation is applied. -+ * -+ * By default, this contract is self administered, meaning administration tasks -+ * have to go through the timelock process. The proposer (resp executor) role -+ * is in charge of proposing (resp executing) operations. A common use case is -+ * to position this {TimelockController} as the owner of a smart contract, with -+ * a multisig or a DAO as the sole proposer. -+ * -+ * _Available since v3.3._ -+ */ -+contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver { -+ bytes32 public constant TIMELOCK_ADMIN_ROLE = keccak256("TIMELOCK_ADMIN_ROLE"); -+ bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); -+ bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); -+ bytes32 public constant CANCELLER_ROLE = keccak256("CANCELLER_ROLE"); -+ uint256 internal constant _DONE_TIMESTAMP = uint256(1); -+ -+ mapping(bytes32 => uint256) private _timestamps; -+ uint256 private _minDelay; -+ -+ /** -+ * @dev Emitted when a call is scheduled as part of operation `id`. -+ */ -+ event CallScheduled( -+ bytes32 indexed id, -+ uint256 indexed index, -+ address target, -+ uint256 value, -+ bytes data, -+ bytes32 predecessor, -+ uint256 delay -+ ); -+ -+ /** -+ * @dev Emitted when a call is performed as part of operation `id`. -+ */ -+ event CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data); -+ -+ /** -+ * @dev Emitted when operation `id` is cancelled. -+ */ -+ event Cancelled(bytes32 indexed id); -+ -+ /** -+ * @dev Emitted when the minimum delay for future operations is modified. -+ */ -+ event MinDelayChange(uint256 oldDuration, uint256 newDuration); -+ -+ /** -+ * @dev Initializes the contract with a given `minDelay`, and a list of -+ * initial proposers and executors. The proposers receive both the -+ * proposer and the canceller role (for backward compatibility). The -+ * executors receive the executor role. -+ * -+ * NOTE: At construction, both the deployer and the timelock itself are -+ * administrators. This helps further configuration of the timelock by the -+ * deployer. After configuration is done, it is recommended that the -+ * deployer renounces its admin position and relies on timelocked -+ * operations to perform future maintenance. -+ */ -+ constructor( -+ uint256 minDelay, -+ address[] memory proposers, -+ address[] memory executors -+ ) { -+ _setRoleAdmin(TIMELOCK_ADMIN_ROLE, TIMELOCK_ADMIN_ROLE); -+ _setRoleAdmin(PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE); -+ _setRoleAdmin(EXECUTOR_ROLE, TIMELOCK_ADMIN_ROLE); -+ _setRoleAdmin(CANCELLER_ROLE, TIMELOCK_ADMIN_ROLE); -+ -+ // deployer + self administration -+ _setupRole(TIMELOCK_ADMIN_ROLE, _msgSender()); -+ _setupRole(TIMELOCK_ADMIN_ROLE, address(this)); -+ -+ // register proposers and cancellers -+ for (uint256 i = 0; i < proposers.length; ++i) { -+ _setupRole(PROPOSER_ROLE, proposers[i]); -+ _setupRole(CANCELLER_ROLE, proposers[i]); -+ } -+ -+ // register executors -+ for (uint256 i = 0; i < executors.length; ++i) { -+ _setupRole(EXECUTOR_ROLE, executors[i]); -+ } -+ -+ _minDelay = minDelay; -+ emit MinDelayChange(0, minDelay); -+ } -+ -+ /** -+ * @dev Modifier to make a function callable only by a certain role. In -+ * addition to checking the sender's role, `address(0)` 's role is also -+ * considered. Granting a role to `address(0)` is equivalent to enabling -+ * this role for everyone. -+ */ -+ modifier onlyRoleOrOpenRole(bytes32 role) { -+ if (!hasRole(role, address(0))) { -+ _checkRole(role, _msgSender()); -+ } -+ _; -+ } -+ -+ /** -+ * @dev Contract might receive/hold ETH as part of the maintenance process. -+ */ -+ receive() external payable {} -+ -+ /** -+ * @dev See {IERC165-supportsInterface}. -+ */ -+ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, AccessControl) returns (bool) { -+ return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); -+ } -+ -+ /** -+ * @dev Returns whether an id correspond to a registered operation. This -+ * includes both Pending, Ready and Done operations. -+ */ -+ function isOperation(bytes32 id) public view virtual returns (bool registered) { -+ return getTimestamp(id) > 0; -+ } -+ -+ /** -+ * @dev Returns whether an operation is pending or not. -+ */ -+ function isOperationPending(bytes32 id) public view virtual returns (bool pending) { -+ return getTimestamp(id) > _DONE_TIMESTAMP; -+ } -+ -+ /** -+ * @dev Returns whether an operation is ready or not. -+ */ -+ function isOperationReady(bytes32 id) public view virtual returns (bool ready) { -+ uint256 timestamp = getTimestamp(id); -+ return timestamp > _DONE_TIMESTAMP && timestamp <= block.timestamp; -+ } -+ -+ /** -+ * @dev Returns whether an operation is done or not. -+ */ -+ function isOperationDone(bytes32 id) public view virtual returns (bool done) { -+ return getTimestamp(id) == _DONE_TIMESTAMP; -+ } -+ -+ /** -+ * @dev Returns the timestamp at with an operation becomes ready (0 for -+ * unset operations, 1 for done operations). -+ */ -+ function getTimestamp(bytes32 id) public view virtual returns (uint256 timestamp) { -+ return _timestamps[id]; -+ } -+ -+ /** -+ * @dev Returns the minimum delay for an operation to become valid. -+ * -+ * This value can be changed by executing an operation that calls `updateDelay`. -+ */ -+ function getMinDelay() public view virtual returns (uint256 duration) { -+ return _minDelay; -+ } -+ -+ /** -+ * @dev Returns the identifier of an operation containing a single -+ * transaction. -+ */ -+ function hashOperation( -+ address target, -+ uint256 value, -+ bytes calldata data, -+ bytes32 predecessor, -+ bytes32 salt -+ ) public pure virtual returns (bytes32 hash) { -+ return keccak256(abi.encode(target, value, data, predecessor, salt)); -+ } -+ -+ /** -+ * @dev Returns the identifier of an operation containing a batch of -+ * transactions. -+ */ -+ function hashOperationBatch( -+ address[] calldata targets, -+ uint256[] calldata values, -+ bytes[] calldata payloads, -+ bytes32 predecessor, -+ bytes32 salt -+ ) public pure virtual returns (bytes32 hash) { -+ return keccak256(abi.encode(targets, values, payloads, predecessor, salt)); -+ } -+ -+ /** -+ * @dev Schedule an operation containing a single transaction. -+ * -+ * Emits a {CallScheduled} event. -+ * -+ * Requirements: -+ * -+ * - the caller must have the 'proposer' role. -+ */ -+ function schedule( -+ address target, -+ uint256 value, -+ bytes calldata data, -+ bytes32 predecessor, -+ bytes32 salt, -+ uint256 delay -+ ) public virtual onlyRole(PROPOSER_ROLE) { -+ bytes32 id = hashOperation(target, value, data, predecessor, salt); -+ _schedule(id, delay); -+ emit CallScheduled(id, 0, target, value, data, predecessor, delay); -+ } -+ -+ /** -+ * @dev Schedule an operation containing a batch of transactions. -+ * -+ * Emits one {CallScheduled} event per transaction in the batch. -+ * -+ * Requirements: -+ * -+ * - the caller must have the 'proposer' role. -+ */ -+ function scheduleBatch( -+ address[] calldata targets, -+ uint256[] calldata values, -+ bytes[] calldata payloads, -+ bytes32 predecessor, -+ bytes32 salt, -+ uint256 delay -+ ) public virtual onlyRole(PROPOSER_ROLE) { -+ require(targets.length == values.length, "TimelockController: length mismatch"); -+ require(targets.length == payloads.length, "TimelockController: length mismatch"); -+ -+ bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt); -+ _schedule(id, delay); -+ for (uint256 i = 0; i < targets.length; ++i) { -+ emit CallScheduled(id, i, targets[i], values[i], payloads[i], predecessor, delay); -+ } -+ } -+ -+ /** -+ * @dev Schedule an operation that is to becomes valid after a given delay. -+ */ -+ function _schedule(bytes32 id, uint256 delay) private { -+ require(!isOperation(id), "TimelockController: operation already scheduled"); -+ require(delay >= getMinDelay(), "TimelockController: insufficient delay"); -+ _timestamps[id] = block.timestamp + delay; -+ } -+ -+ /** -+ * @dev Cancel an operation. -+ * -+ * Requirements: -+ * -+ * - the caller must have the 'canceller' role. -+ */ -+ function cancel(bytes32 id) public virtual onlyRole(CANCELLER_ROLE) { -+ require(isOperationPending(id), "TimelockController: operation cannot be cancelled"); -+ delete _timestamps[id]; -+ -+ emit Cancelled(id); -+ } -+ -+ /** -+ * @dev Execute an (ready) operation containing a single transaction. -+ * -+ * Emits a {CallExecuted} event. -+ * -+ * Requirements: -+ * -+ * - the caller must have the 'executor' role. -+ */ -+ // This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending, -+ // thus any modifications to the operation during reentrancy should be caught. -+ // slither-disable-next-line reentrancy-eth -+ function execute( -+ address target, -+ uint256 value, -+ bytes calldata payload, -+ bytes32 predecessor, -+ bytes32 salt -+ ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { -+ bytes32 id = hashOperation(target, value, payload, predecessor, salt); -+ -+ _beforeCall(id, predecessor); -+ _execute(target, value, payload); -+ emit CallExecuted(id, 0, target, value, payload); -+ _afterCall(id); -+ } -+ -+ /** -+ * @dev Execute an (ready) operation containing a batch of transactions. -+ * -+ * Emits one {CallExecuted} event per transaction in the batch. -+ * -+ * Requirements: -+ * -+ * - the caller must have the 'executor' role. -+ */ -+ function executeBatch( -+ address[] calldata targets, -+ uint256[] calldata values, -+ bytes[] calldata payloads, -+ bytes32 predecessor, -+ bytes32 salt -+ ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { -+ require(targets.length == values.length, "TimelockController: length mismatch"); -+ require(targets.length == payloads.length, "TimelockController: length mismatch"); -+ -+ bytes32 id = hashOperationBatch(targets, values, payloads, predecessor, salt); -+ -+ _beforeCall(id, predecessor); -+ for (uint256 i = 0; i < targets.length; ++i) { -+ address target = targets[i]; -+ uint256 value = values[i]; -+ bytes calldata payload = payloads[i]; -+ _execute(target, value, payload); -+ emit CallExecuted(id, i, target, value, payload); -+ } -+ _afterCall(id); -+ } -+ -+ /** -+ * @dev Execute an operation's call. -+ */ -+ function _execute( -+ address target, -+ uint256 value, -+ bytes calldata data -+ ) internal virtual { -+ (bool success, ) = target.call{value: value}(data); -+ require(success, "TimelockController: underlying transaction reverted"); -+ } -+ -+ /** -+ * @dev Checks before execution of an operation's calls. -+ */ -+ function _beforeCall(bytes32 id, bytes32 predecessor) private view { -+ require(isOperationReady(id), "TimelockController: operation is not ready"); -+ require(predecessor == bytes32(0) || isOperationDone(predecessor), "TimelockController: missing dependency"); -+ } -+ -+ /** -+ * @dev Checks after execution of an operation's calls. -+ */ -+ function _afterCall(bytes32 id) private { -+ require(isOperationReady(id), "TimelockController: operation is not ready"); -+ _timestamps[id] = _DONE_TIMESTAMP; -+ } -+ -+ /** -+ * @dev Changes the minimum timelock duration for future operations. -+ * -+ * Emits a {MinDelayChange} event. -+ * -+ * Requirements: -+ * -+ * - the caller must be the timelock itself. This can only be achieved by scheduling and later executing -+ * an operation where the timelock is the target and the data is the ABI-encoded call to this function. -+ */ -+ function updateDelay(uint256 newDelay) external virtual { -+ require(msg.sender == address(this), "TimelockController: caller must be timelock"); -+ emit MinDelayChange(_minDelay, newDelay); -+ _minDelay = newDelay; -+ } -+ -+ /** -+ * @dev See {IERC721Receiver-onERC721Received}. -+ */ -+ function onERC721Received( -+ address, -+ address, -+ uint256, -+ bytes memory -+ ) public virtual override returns (bytes4) { -+ return this.onERC721Received.selector; -+ } -+ -+ /** -+ * @dev See {IERC1155Receiver-onERC1155Received}. -+ */ -+ function onERC1155Received( -+ address, -+ address, -+ uint256, -+ uint256, -+ bytes memory -+ ) public virtual override returns (bytes4) { -+ return this.onERC1155Received.selector; -+ } -+ -+ /** -+ * @dev See {IERC1155Receiver-onERC1155BatchReceived}. -+ */ -+ function onERC1155BatchReceived( -+ address, -+ address, -+ uint256[] memory, -+ uint256[] memory, -+ bytes memory -+ ) public virtual override returns (bytes4) { -+ return this.onERC1155BatchReceived.selector; -+ } -+} diff -ruN governance/utils/Votes.sol governance/utils/Votes.sol --- governance/utils/Votes.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/utils/Votes.sol 2022-05-25 15:49:40.913370387 -0400 ++++ governance/utils/Votes.sol 2022-05-25 16:04:57.725255723 -0400 @@ -35,7 +35,25 @@ bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); @@ -1148,224 +127,9 @@ diff -ruN governance/utils/Votes.sol governance/utils/Votes.sol - function _getVotingUnits(address) internal view virtual returns (uint256); + function _getVotingUnits(address) public virtual returns (uint256); // HARNESS: internal -> public } -diff -ruN governance/utils/Votes.sol.orig governance/utils/Votes.sol.orig ---- governance/utils/Votes.sol.orig 1969-12-31 19:00:00.000000000 -0500 -+++ governance/utils/Votes.sol.orig 2022-05-25 15:37:51.036084000 -0400 -@@ -0,0 +1,211 @@ -+// SPDX-License-Identifier: MIT -+// OpenZeppelin Contracts (last updated v4.6.0) (governance/utils/Votes.sol) -+pragma solidity ^0.8.0; -+ -+import "../../utils/Context.sol"; -+import "../../utils/Counters.sol"; -+import "../../utils/Checkpoints.sol"; -+import "../../utils/cryptography/draft-EIP712.sol"; -+import "./IVotes.sol"; -+ -+/** -+ * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be -+ * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of -+ * "representative" that will pool delegated voting units from different accounts and can then use it to vote in -+ * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to -+ * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative. -+ * -+ * This contract is often combined with a token contract such that voting units correspond to token units. For an -+ * example, see {ERC721Votes}. -+ * -+ * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed -+ * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the -+ * cost of this history tracking optional. -+ * -+ * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return -+ * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the -+ * previous example, it would be included in {ERC721-_beforeTokenTransfer}). -+ * -+ * _Available since v4.5._ -+ */ -+abstract contract Votes is IVotes, Context, EIP712 { -+ using Checkpoints for Checkpoints.History; -+ using Counters for Counters.Counter; -+ -+ bytes32 private constant _DELEGATION_TYPEHASH = -+ keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); -+ -+ mapping(address => address) private _delegation; -+ mapping(address => Checkpoints.History) private _delegateCheckpoints; -+ Checkpoints.History private _totalCheckpoints; -+ -+ mapping(address => Counters.Counter) private _nonces; -+ -+ /** -+ * @dev Returns the current amount of votes that `account` has. -+ */ -+ function getVotes(address account) public view virtual override returns (uint256) { -+ return _delegateCheckpoints[account].latest(); -+ } -+ -+ /** -+ * @dev Returns the amount of votes that `account` had at the end of a past block (`blockNumber`). -+ * -+ * Requirements: -+ * -+ * - `blockNumber` must have been already mined -+ */ -+ function getPastVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) { -+ return _delegateCheckpoints[account].getAtBlock(blockNumber); -+ } -+ -+ /** -+ * @dev Returns the total supply of votes available at the end of a past block (`blockNumber`). -+ * -+ * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. -+ * Votes that have not been delegated are still part of total supply, even though they would not participate in a -+ * vote. -+ * -+ * Requirements: -+ * -+ * - `blockNumber` must have been already mined -+ */ -+ function getPastTotalSupply(uint256 blockNumber) public view virtual override returns (uint256) { -+ require(blockNumber < block.number, "Votes: block not yet mined"); -+ return _totalCheckpoints.getAtBlock(blockNumber); -+ } -+ -+ /** -+ * @dev Returns the current total supply of votes. -+ */ -+ function _getTotalSupply() internal view virtual returns (uint256) { -+ return _totalCheckpoints.latest(); -+ } -+ -+ /** -+ * @dev Returns the delegate that `account` has chosen. -+ */ -+ function delegates(address account) public view virtual override returns (address) { -+ return _delegation[account]; -+ } -+ -+ /** -+ * @dev Delegates votes from the sender to `delegatee`. -+ */ -+ function delegate(address delegatee) public virtual override { -+ address account = _msgSender(); -+ _delegate(account, delegatee); -+ } -+ -+ /** -+ * @dev Delegates votes from signer to `delegatee`. -+ */ -+ function delegateBySig( -+ address delegatee, -+ uint256 nonce, -+ uint256 expiry, -+ uint8 v, -+ bytes32 r, -+ bytes32 s -+ ) public virtual override { -+ require(block.timestamp <= expiry, "Votes: signature expired"); -+ address signer = ECDSA.recover( -+ _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))), -+ v, -+ r, -+ s -+ ); -+ require(nonce == _useNonce(signer), "Votes: invalid nonce"); -+ _delegate(signer, delegatee); -+ } -+ -+ /** -+ * @dev Delegate all of `account`'s voting units to `delegatee`. -+ * -+ * Emits events {DelegateChanged} and {DelegateVotesChanged}. -+ */ -+ function _delegate(address account, address delegatee) internal virtual { -+ address oldDelegate = delegates(account); -+ _delegation[account] = delegatee; -+ -+ emit DelegateChanged(account, oldDelegate, delegatee); -+ _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account)); -+ } -+ -+ /** -+ * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to` -+ * should be zero. Total supply of voting units will be adjusted with mints and burns. -+ */ -+ function _transferVotingUnits( -+ address from, -+ address to, -+ uint256 amount -+ ) internal virtual { -+ if (from == address(0)) { -+ _totalCheckpoints.push(_add, amount); -+ } -+ if (to == address(0)) { -+ _totalCheckpoints.push(_subtract, amount); -+ } -+ _moveDelegateVotes(delegates(from), delegates(to), amount); -+ } -+ -+ /** -+ * @dev Moves delegated votes from one delegate to another. -+ */ -+ function _moveDelegateVotes( -+ address from, -+ address to, -+ uint256 amount -+ ) private { -+ if (from != to && amount > 0) { -+ if (from != address(0)) { -+ (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[from].push(_subtract, amount); -+ emit DelegateVotesChanged(from, oldValue, newValue); -+ } -+ if (to != address(0)) { -+ (uint256 oldValue, uint256 newValue) = _delegateCheckpoints[to].push(_add, amount); -+ emit DelegateVotesChanged(to, oldValue, newValue); -+ } -+ } -+ } -+ -+ function _add(uint256 a, uint256 b) private pure returns (uint256) { -+ return a + b; -+ } -+ -+ function _subtract(uint256 a, uint256 b) private pure returns (uint256) { -+ return a - b; -+ } -+ -+ /** -+ * @dev Consumes a nonce. -+ * -+ * Returns the current value and increments nonce. -+ */ -+ function _useNonce(address owner) internal virtual returns (uint256 current) { -+ Counters.Counter storage nonce = _nonces[owner]; -+ current = nonce.current(); -+ nonce.increment(); -+ } -+ -+ /** -+ * @dev Returns an address nonce. -+ */ -+ function nonces(address owner) public view virtual returns (uint256) { -+ return _nonces[owner].current(); -+ } -+ -+ /** -+ * @dev Returns the contract's {EIP712} domain separator. -+ */ -+ // solhint-disable-next-line func-name-mixedcase -+ function DOMAIN_SEPARATOR() external view returns (bytes32) { -+ return _domainSeparatorV4(); -+ } -+ -+ /** -+ * @dev Must return the voting units held by an account. -+ */ -+ function _getVotingUnits(address) internal view virtual returns (uint256); -+} diff -ruN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol --- token/ERC1155/ERC1155.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC1155/ERC1155.sol 2022-05-25 15:37:51.044083806 -0400 ++++ token/ERC1155/ERC1155.sol 2022-05-25 16:04:57.725255723 -0400 @@ -268,7 +268,7 @@ uint256 id, uint256 amount, @@ -1420,530 +184,9 @@ diff -ruN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response -diff -ruN token/ERC1155/ERC1155.sol.orig token/ERC1155/ERC1155.sol.orig ---- token/ERC1155/ERC1155.sol.orig 1969-12-31 19:00:00.000000000 -0500 -+++ token/ERC1155/ERC1155.sol.orig 2022-05-25 15:37:51.036084000 -0400 -@@ -0,0 +1,517 @@ -+// SPDX-License-Identifier: MIT -+// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/ERC1155.sol) -+ -+pragma solidity ^0.8.0; -+ -+import "./IERC1155.sol"; -+import "./IERC1155Receiver.sol"; -+import "./extensions/IERC1155MetadataURI.sol"; -+import "../../utils/Address.sol"; -+import "../../utils/Context.sol"; -+import "../../utils/introspection/ERC165.sol"; -+ -+/** -+ * @dev Implementation of the basic standard multi-token. -+ * See https://eips.ethereum.org/EIPS/eip-1155 -+ * Originally based on code by Enjin: https://github.com/enjin/erc-1155 -+ * -+ * _Available since v3.1._ -+ */ -+contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { -+ using Address for address; -+ -+ // Mapping from token ID to account balances -+ mapping(uint256 => mapping(address => uint256)) private _balances; -+ -+ // Mapping from account to operator approvals -+ mapping(address => mapping(address => bool)) private _operatorApprovals; -+ -+ // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json -+ string private _uri; -+ -+ /** -+ * @dev See {_setURI}. -+ */ -+ constructor(string memory uri_) { -+ _setURI(uri_); -+ } -+ -+ /** -+ * @dev See {IERC165-supportsInterface}. -+ */ -+ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { -+ return -+ interfaceId == type(IERC1155).interfaceId || -+ interfaceId == type(IERC1155MetadataURI).interfaceId || -+ super.supportsInterface(interfaceId); -+ } -+ -+ /** -+ * @dev See {IERC1155MetadataURI-uri}. -+ * -+ * This implementation returns the same URI for *all* token types. It relies -+ * on the token type ID substitution mechanism -+ * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. -+ * -+ * Clients calling this function must replace the `\{id\}` substring with the -+ * actual token type ID. -+ */ -+ function uri(uint256) public view virtual override returns (string memory) { -+ return _uri; -+ } -+ -+ /** -+ * @dev See {IERC1155-balanceOf}. -+ * -+ * Requirements: -+ * -+ * - `account` cannot be the zero address. -+ */ -+ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { -+ require(account != address(0), "ERC1155: address zero is not a valid owner"); -+ return _balances[id][account]; -+ } -+ -+ /** -+ * @dev See {IERC1155-balanceOfBatch}. -+ * -+ * Requirements: -+ * -+ * - `accounts` and `ids` must have the same length. -+ */ -+ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) -+ public -+ view -+ virtual -+ override -+ returns (uint256[] memory) -+ { -+ require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); -+ -+ uint256[] memory batchBalances = new uint256[](accounts.length); -+ -+ for (uint256 i = 0; i < accounts.length; ++i) { -+ batchBalances[i] = balanceOf(accounts[i], ids[i]); -+ } -+ -+ return batchBalances; -+ } -+ -+ /** -+ * @dev See {IERC1155-setApprovalForAll}. -+ */ -+ function setApprovalForAll(address operator, bool approved) public virtual override { -+ _setApprovalForAll(_msgSender(), operator, approved); -+ } -+ -+ /** -+ * @dev See {IERC1155-isApprovedForAll}. -+ */ -+ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { -+ return _operatorApprovals[account][operator]; -+ } -+ -+ /** -+ * @dev See {IERC1155-safeTransferFrom}. -+ */ -+ function safeTransferFrom( -+ address from, -+ address to, -+ uint256 id, -+ uint256 amount, -+ bytes memory data -+ ) public virtual override { -+ require( -+ from == _msgSender() || isApprovedForAll(from, _msgSender()), -+ "ERC1155: caller is not owner nor approved" -+ ); -+ _safeTransferFrom(from, to, id, amount, data); -+ } -+ -+ /** -+ * @dev See {IERC1155-safeBatchTransferFrom}. -+ */ -+ function safeBatchTransferFrom( -+ address from, -+ address to, -+ uint256[] memory ids, -+ uint256[] memory amounts, -+ bytes memory data -+ ) public virtual override { -+ require( -+ from == _msgSender() || isApprovedForAll(from, _msgSender()), -+ "ERC1155: transfer caller is not owner nor approved" -+ ); -+ _safeBatchTransferFrom(from, to, ids, amounts, data); -+ } -+ -+ /** -+ * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. -+ * -+ * Emits a {TransferSingle} event. -+ * -+ * Requirements: -+ * -+ * - `to` cannot be the zero address. -+ * - `from` must have a balance of tokens of type `id` of at least `amount`. -+ * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the -+ * acceptance magic value. -+ */ -+ function _safeTransferFrom( -+ address from, -+ address to, -+ uint256 id, -+ uint256 amount, -+ bytes memory data -+ ) internal virtual { -+ require(to != address(0), "ERC1155: transfer to the zero address"); -+ -+ address operator = _msgSender(); -+ uint256[] memory ids = _asSingletonArray(id); -+ uint256[] memory amounts = _asSingletonArray(amount); -+ -+ _beforeTokenTransfer(operator, from, to, ids, amounts, data); -+ -+ uint256 fromBalance = _balances[id][from]; -+ require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); -+ unchecked { -+ _balances[id][from] = fromBalance - amount; -+ } -+ _balances[id][to] += amount; -+ -+ emit TransferSingle(operator, from, to, id, amount); -+ -+ _afterTokenTransfer(operator, from, to, ids, amounts, data); -+ -+ _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); -+ } -+ -+ /** -+ * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. -+ * -+ * Emits a {TransferBatch} event. -+ * -+ * Requirements: -+ * -+ * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the -+ * acceptance magic value. -+ */ -+ function _safeBatchTransferFrom( -+ address from, -+ address to, -+ uint256[] memory ids, -+ uint256[] memory amounts, -+ bytes memory data -+ ) internal virtual { -+ require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); -+ require(to != address(0), "ERC1155: transfer to the zero address"); -+ -+ address operator = _msgSender(); -+ -+ _beforeTokenTransfer(operator, from, to, ids, amounts, data); -+ -+ for (uint256 i = 0; i < ids.length; ++i) { -+ uint256 id = ids[i]; -+ uint256 amount = amounts[i]; -+ -+ uint256 fromBalance = _balances[id][from]; -+ require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); -+ unchecked { -+ _balances[id][from] = fromBalance - amount; -+ } -+ _balances[id][to] += amount; -+ } -+ -+ emit TransferBatch(operator, from, to, ids, amounts); -+ -+ _afterTokenTransfer(operator, from, to, ids, amounts, data); -+ -+ _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); -+ } -+ -+ /** -+ * @dev Sets a new URI for all token types, by relying on the token type ID -+ * substitution mechanism -+ * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. -+ * -+ * By this mechanism, any occurrence of the `\{id\}` substring in either the -+ * URI or any of the amounts in the JSON file at said URI will be replaced by -+ * clients with the token type ID. -+ * -+ * For example, the `https://token-cdn-domain/\{id\}.json` URI would be -+ * interpreted by clients as -+ * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` -+ * for token type ID 0x4cce0. -+ * -+ * See {uri}. -+ * -+ * Because these URIs cannot be meaningfully represented by the {URI} event, -+ * this function emits no events. -+ */ -+ function _setURI(string memory newuri) internal virtual { -+ _uri = newuri; -+ } -+ -+ /** -+ * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. -+ * -+ * Emits a {TransferSingle} event. -+ * -+ * Requirements: -+ * -+ * - `to` cannot be the zero address. -+ * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the -+ * acceptance magic value. -+ */ -+ function _mint( -+ address to, -+ uint256 id, -+ uint256 amount, -+ bytes memory data -+ ) internal virtual { -+ require(to != address(0), "ERC1155: mint to the zero address"); -+ -+ address operator = _msgSender(); -+ uint256[] memory ids = _asSingletonArray(id); -+ uint256[] memory amounts = _asSingletonArray(amount); -+ -+ _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); -+ -+ _balances[id][to] += amount; -+ emit TransferSingle(operator, address(0), to, id, amount); -+ -+ _afterTokenTransfer(operator, address(0), to, ids, amounts, data); -+ -+ _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); -+ } -+ -+ /** -+ * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. -+ * -+ * Emits a {TransferBatch} event. -+ * -+ * Requirements: -+ * -+ * - `ids` and `amounts` must have the same length. -+ * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the -+ * acceptance magic value. -+ */ -+ function _mintBatch( -+ address to, -+ uint256[] memory ids, -+ uint256[] memory amounts, -+ bytes memory data -+ ) internal virtual { -+ require(to != address(0), "ERC1155: mint to the zero address"); -+ require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); -+ -+ address operator = _msgSender(); -+ -+ _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); -+ -+ for (uint256 i = 0; i < ids.length; i++) { -+ _balances[ids[i]][to] += amounts[i]; -+ } -+ -+ emit TransferBatch(operator, address(0), to, ids, amounts); -+ -+ _afterTokenTransfer(operator, address(0), to, ids, amounts, data); -+ -+ _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); -+ } -+ -+ /** -+ * @dev Destroys `amount` tokens of token type `id` from `from` -+ * -+ * Emits a {TransferSingle} event. -+ * -+ * Requirements: -+ * -+ * - `from` cannot be the zero address. -+ * - `from` must have at least `amount` tokens of token type `id`. -+ */ -+ function _burn( -+ address from, -+ uint256 id, -+ uint256 amount -+ ) internal virtual { -+ require(from != address(0), "ERC1155: burn from the zero address"); -+ -+ address operator = _msgSender(); -+ uint256[] memory ids = _asSingletonArray(id); -+ uint256[] memory amounts = _asSingletonArray(amount); -+ -+ _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); -+ -+ uint256 fromBalance = _balances[id][from]; -+ require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); -+ unchecked { -+ _balances[id][from] = fromBalance - amount; -+ } -+ -+ emit TransferSingle(operator, from, address(0), id, amount); -+ -+ _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); -+ } -+ -+ /** -+ * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. -+ * -+ * Emits a {TransferBatch} event. -+ * -+ * Requirements: -+ * -+ * - `ids` and `amounts` must have the same length. -+ */ -+ function _burnBatch( -+ address from, -+ uint256[] memory ids, -+ uint256[] memory amounts -+ ) internal virtual { -+ require(from != address(0), "ERC1155: burn from the zero address"); -+ require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); -+ -+ address operator = _msgSender(); -+ -+ _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); -+ -+ for (uint256 i = 0; i < ids.length; i++) { -+ uint256 id = ids[i]; -+ uint256 amount = amounts[i]; -+ -+ uint256 fromBalance = _balances[id][from]; -+ require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); -+ unchecked { -+ _balances[id][from] = fromBalance - amount; -+ } -+ } -+ -+ emit TransferBatch(operator, from, address(0), ids, amounts); -+ -+ _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); -+ } -+ -+ /** -+ * @dev Approve `operator` to operate on all of `owner` tokens -+ * -+ * Emits an {ApprovalForAll} event. -+ */ -+ function _setApprovalForAll( -+ address owner, -+ address operator, -+ bool approved -+ ) internal virtual { -+ require(owner != operator, "ERC1155: setting approval status for self"); -+ _operatorApprovals[owner][operator] = approved; -+ emit ApprovalForAll(owner, operator, approved); -+ } -+ -+ /** -+ * @dev Hook that is called before any token transfer. This includes minting -+ * and burning, as well as batched variants. -+ * -+ * The same hook is called on both single and batched variants. For single -+ * transfers, the length of the `ids` and `amounts` arrays will be 1. -+ * -+ * Calling conditions (for each `id` and `amount` pair): -+ * -+ * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens -+ * of token type `id` will be transferred to `to`. -+ * - When `from` is zero, `amount` tokens of token type `id` will be minted -+ * for `to`. -+ * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` -+ * will be burned. -+ * - `from` and `to` are never both zero. -+ * - `ids` and `amounts` have the same, non-zero length. -+ * -+ * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. -+ */ -+ function _beforeTokenTransfer( -+ address operator, -+ address from, -+ address to, -+ uint256[] memory ids, -+ uint256[] memory amounts, -+ bytes memory data -+ ) internal virtual {} -+ -+ /** -+ * @dev Hook that is called after any token transfer. This includes minting -+ * and burning, as well as batched variants. -+ * -+ * The same hook is called on both single and batched variants. For single -+ * transfers, the length of the `id` and `amount` arrays will be 1. -+ * -+ * Calling conditions (for each `id` and `amount` pair): -+ * -+ * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens -+ * of token type `id` will be transferred to `to`. -+ * - When `from` is zero, `amount` tokens of token type `id` will be minted -+ * for `to`. -+ * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` -+ * will be burned. -+ * - `from` and `to` are never both zero. -+ * - `ids` and `amounts` have the same, non-zero length. -+ * -+ * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. -+ */ -+ function _afterTokenTransfer( -+ address operator, -+ address from, -+ address to, -+ uint256[] memory ids, -+ uint256[] memory amounts, -+ bytes memory data -+ ) internal virtual {} -+ -+ function _doSafeTransferAcceptanceCheck( -+ address operator, -+ address from, -+ address to, -+ uint256 id, -+ uint256 amount, -+ bytes memory data -+ ) private { -+ if (to.isContract()) { -+ try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { -+ if (response != IERC1155Receiver.onERC1155Received.selector) { -+ revert("ERC1155: ERC1155Receiver rejected tokens"); -+ } -+ } catch Error(string memory reason) { -+ revert(reason); -+ } catch { -+ revert("ERC1155: transfer to non ERC1155Receiver implementer"); -+ } -+ } -+ } -+ -+ function _doSafeBatchTransferAcceptanceCheck( -+ address operator, -+ address from, -+ address to, -+ uint256[] memory ids, -+ uint256[] memory amounts, -+ bytes memory data -+ ) private { -+ if (to.isContract()) { -+ try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( -+ bytes4 response -+ ) { -+ if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { -+ revert("ERC1155: ERC1155Receiver rejected tokens"); -+ } -+ } catch Error(string memory reason) { -+ revert(reason); -+ } catch { -+ revert("ERC1155: transfer to non ERC1155Receiver implementer"); -+ } -+ } -+ } -+ -+ function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { -+ uint256[] memory array = new uint256[](1); -+ array[0] = element; -+ -+ return array; -+ } -+} diff -ruN token/ERC20/ERC20.sol token/ERC20/ERC20.sol --- token/ERC20/ERC20.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/ERC20.sol 2022-05-25 15:37:51.044083806 -0400 ++++ token/ERC20/ERC20.sol 2022-05-25 16:04:57.725255723 -0400 @@ -277,7 +277,7 @@ * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. @@ -1964,7 +207,7 @@ diff -ruN token/ERC20/ERC20.sol token/ERC20/ERC20.sol /** diff -ruN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20FlashMint.sol --- token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 15:37:51.044083806 -0400 ++++ token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 16:04:57.725255723 -0400 @@ -40,9 +40,11 @@ require(token == address(this), "ERC20FlashMint: wrong token"); // silence warning about unused variable without the addition of bytecode. @@ -1978,109 +221,9 @@ diff -ruN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20 /** * @dev Returns the receiver address of the flash fee. By default this * implementation returns the address(0) which means the fee amount will be burnt. -diff -ruN token/ERC20/extensions/ERC20FlashMint.sol.orig token/ERC20/extensions/ERC20FlashMint.sol.orig ---- token/ERC20/extensions/ERC20FlashMint.sol.orig 1969-12-31 19:00:00.000000000 -0500 -+++ token/ERC20/extensions/ERC20FlashMint.sol.orig 2022-05-25 15:37:51.036084000 -0400 -@@ -0,0 +1,96 @@ -+// SPDX-License-Identifier: MIT -+// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/extensions/ERC20FlashMint.sol) -+ -+pragma solidity ^0.8.0; -+ -+import "../../../interfaces/IERC3156FlashBorrower.sol"; -+import "../../../interfaces/IERC3156FlashLender.sol"; -+import "../ERC20.sol"; -+ -+/** -+ * @dev Implementation of the ERC3156 Flash loans extension, as defined in -+ * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. -+ * -+ * Adds the {flashLoan} method, which provides flash loan support at the token -+ * level. By default there is no fee, but this can be changed by overriding {flashFee}. -+ * -+ * _Available since v4.1._ -+ */ -+abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { -+ bytes32 private constant _RETURN_VALUE = keccak256("ERC3156FlashBorrower.onFlashLoan"); -+ -+ /** -+ * @dev Returns the maximum amount of tokens available for loan. -+ * @param token The address of the token that is requested. -+ * @return The amount of token that can be loaned. -+ */ -+ function maxFlashLoan(address token) public view virtual override returns (uint256) { -+ return token == address(this) ? type(uint256).max - ERC20.totalSupply() : 0; -+ } -+ -+ /** -+ * @dev Returns the fee applied when doing flash loans. By default this -+ * implementation has 0 fees. This function can be overloaded to make -+ * the flash loan mechanism deflationary. -+ * @param token The token to be flash loaned. -+ * @param amount The amount of tokens to be loaned. -+ * @return The fees applied to the corresponding flash loan. -+ */ -+ function flashFee(address token, uint256 amount) public view virtual override returns (uint256) { -+ require(token == address(this), "ERC20FlashMint: wrong token"); -+ // silence warning about unused variable without the addition of bytecode. -+ amount; -+ return 0; -+ } -+ -+ /** -+ * @dev Returns the receiver address of the flash fee. By default this -+ * implementation returns the address(0) which means the fee amount will be burnt. -+ * This function can be overloaded to change the fee receiver. -+ * @return The address for which the flash fee will be sent to. -+ */ -+ function _flashFeeReceiver() internal view virtual returns (address) { -+ return address(0); -+ } -+ -+ /** -+ * @dev Performs a flash loan. New tokens are minted and sent to the -+ * `receiver`, who is required to implement the {IERC3156FlashBorrower} -+ * interface. By the end of the flash loan, the receiver is expected to own -+ * amount + fee tokens and have them approved back to the token contract itself so -+ * they can be burned. -+ * @param receiver The receiver of the flash loan. Should implement the -+ * {IERC3156FlashBorrower.onFlashLoan} interface. -+ * @param token The token to be flash loaned. Only `address(this)` is -+ * supported. -+ * @param amount The amount of tokens to be loaned. -+ * @param data An arbitrary datafield that is passed to the receiver. -+ * @return `true` if the flash loan was successful. -+ */ -+ // This function can reenter, but it doesn't pose a risk because it always preserves the property that the amount -+ // minted at the beginning is always recovered and burned at the end, or else the entire function will revert. -+ // slither-disable-next-line reentrancy-no-eth -+ function flashLoan( -+ IERC3156FlashBorrower receiver, -+ address token, -+ uint256 amount, -+ bytes calldata data -+ ) public virtual override returns (bool) { -+ require(amount <= maxFlashLoan(token), "ERC20FlashMint: amount exceeds maxFlashLoan"); -+ uint256 fee = flashFee(token, amount); -+ _mint(address(receiver), amount); -+ require( -+ receiver.onFlashLoan(msg.sender, token, amount, fee, data) == _RETURN_VALUE, -+ "ERC20FlashMint: invalid return value" -+ ); -+ address flashFeeReceiver = _flashFeeReceiver(); -+ _spendAllowance(address(receiver), address(this), amount + fee); -+ if (fee == 0 || flashFeeReceiver == address(0)) { -+ _burn(address(receiver), amount + fee); -+ } else { -+ _burn(address(receiver), amount); -+ _transfer(address(receiver), flashFeeReceiver, fee); -+ } -+ return true; -+ } -+} diff -ruN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Votes.sol --- token/ERC20/extensions/ERC20Votes.sol 2022-03-02 13:56:14.831535075 -0500 -+++ token/ERC20/extensions/ERC20Votes.sol 2022-05-25 15:37:51.044083806 -0400 ++++ token/ERC20/extensions/ERC20Votes.sol 2022-05-25 16:04:57.725255723 -0400 @@ -33,8 +33,8 @@ bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); @@ -2094,7 +237,7 @@ diff -ruN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Vote /** diff -ruN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wrapper.sol --- token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 15:37:51.044083806 -0400 ++++ token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 16:04:57.733255587 -0400 @@ -55,7 +55,7 @@ * @dev Mint wrapped token to cover any underlyingTokens that would have been transferred by mistake. Internal * function that can be exposed with access control if desired. @@ -2104,76 +247,9 @@ diff -ruN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wr uint256 value = underlying.balanceOf(address(this)) - totalSupply(); _mint(account, value); return value; -diff -ruN token/ERC20/extensions/ERC20Wrapper.sol.orig token/ERC20/extensions/ERC20Wrapper.sol.orig ---- token/ERC20/extensions/ERC20Wrapper.sol.orig 1969-12-31 19:00:00.000000000 -0500 -+++ token/ERC20/extensions/ERC20Wrapper.sol.orig 2022-05-25 15:37:51.036084000 -0400 -@@ -0,0 +1,63 @@ -+// SPDX-License-Identifier: MIT -+// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/extensions/ERC20Wrapper.sol) -+ -+pragma solidity ^0.8.0; -+ -+import "../ERC20.sol"; -+import "../utils/SafeERC20.sol"; -+ -+/** -+ * @dev Extension of the ERC20 token contract to support token wrapping. -+ * -+ * Users can deposit and withdraw "underlying tokens" and receive a matching number of "wrapped tokens". This is useful -+ * in conjunction with other modules. For example, combining this wrapping mechanism with {ERC20Votes} will allow the -+ * wrapping of an existing "basic" ERC20 into a governance token. -+ * -+ * _Available since v4.2._ -+ */ -+abstract contract ERC20Wrapper is ERC20 { -+ IERC20 public immutable underlying; -+ -+ constructor(IERC20 underlyingToken) { -+ underlying = underlyingToken; -+ } -+ -+ /** -+ * @dev See {ERC20-decimals}. -+ */ -+ function decimals() public view virtual override returns (uint8) { -+ try IERC20Metadata(address(underlying)).decimals() returns (uint8 value) { -+ return value; -+ } catch { -+ return super.decimals(); -+ } -+ } -+ -+ /** -+ * @dev Allow a user to deposit underlying tokens and mint the corresponding number of wrapped tokens. -+ */ -+ function depositFor(address account, uint256 amount) public virtual returns (bool) { -+ SafeERC20.safeTransferFrom(underlying, _msgSender(), address(this), amount); -+ _mint(account, amount); -+ return true; -+ } -+ -+ /** -+ * @dev Allow a user to burn a number of wrapped tokens and withdraw the corresponding number of underlying tokens. -+ */ -+ function withdrawTo(address account, uint256 amount) public virtual returns (bool) { -+ _burn(_msgSender(), amount); -+ SafeERC20.safeTransfer(underlying, account, amount); -+ return true; -+ } -+ -+ /** -+ * @dev Mint wrapped token to cover any underlyingTokens that would have been transferred by mistake. Internal -+ * function that can be exposed with access control if desired. -+ */ -+ function _recover(address account) internal virtual returns (uint256) { -+ uint256 value = underlying.balanceOf(address(this)) - totalSupply(); -+ _mint(account, value); -+ return value; -+ } -+} diff -ruN token/ERC721/extensions/draft-ERC721Votes.sol token/ERC721/extensions/draft-ERC721Votes.sol --- token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 15:59:49.842532468 -0400 ++++ token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 16:04:57.733255587 -0400 @@ -34,7 +34,7 @@ /** * @dev Returns the balance of `account`. @@ -2183,53 +259,9 @@ diff -ruN token/ERC721/extensions/draft-ERC721Votes.sol token/ERC721/extensions/ return balanceOf(account); } } -diff -ruN token/ERC721/extensions/draft-ERC721Votes.sol.orig token/ERC721/extensions/draft-ERC721Votes.sol.orig ---- token/ERC721/extensions/draft-ERC721Votes.sol.orig 1969-12-31 19:00:00.000000000 -0500 -+++ token/ERC721/extensions/draft-ERC721Votes.sol.orig 2022-05-25 15:37:51.044083806 -0400 -@@ -0,0 +1,40 @@ -+// SPDX-License-Identifier: MIT -+// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/extensions/draft-ERC721Votes.sol) -+ -+pragma solidity ^0.8.0; -+ -+import "../ERC721.sol"; -+import "../../../governance/utils/Votes.sol"; -+ -+/** -+ * @dev Extension of ERC721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts -+ * as 1 vote unit. -+ * -+ * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost -+ * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of -+ * the votes in governance decisions, or they can delegate to themselves to be their own representative. -+ * -+ * _Available since v4.5._ -+ */ -+abstract contract ERC721Votes is ERC721, Votes { -+ /** -+ * @dev Adjusts votes when tokens are transferred. -+ * -+ * Emits a {Votes-DelegateVotesChanged} event. -+ */ -+ function _afterTokenTransfer( -+ address from, -+ address to, -+ uint256 tokenId -+ ) internal virtual override { -+ _transferVotingUnits(from, to, 1); -+ super._afterTokenTransfer(from, to, tokenId); -+ } -+ -+ /** -+ * @dev Returns the balance of `account`. -+ */ -+ function _getVotingUnits(address account) internal view virtual override returns (uint256) { -+ return balanceOf(account); -+ } -+} diff -ruN utils/Address.sol utils/Address.sol --- utils/Address.sol 2022-05-25 15:36:58.853363841 -0400 -+++ utils/Address.sol 2022-05-25 15:37:51.044083806 -0400 ++++ utils/Address.sol 2022-05-25 16:04:57.733255587 -0400 @@ -131,6 +131,7 @@ uint256 value, string memory errorMessage From d01f3ba925cea8d874a83f50a43ded91794fb069 Mon Sep 17 00:00:00 2001 From: Michael George Date: Wed, 25 May 2022 16:07:55 -0400 Subject: [PATCH 79/81] unclobbered gitignore file --- certora/applyHarness.patch | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/certora/applyHarness.patch b/certora/applyHarness.patch index 833d550dc..1c137a57b 100644 --- a/certora/applyHarness.patch +++ b/certora/applyHarness.patch @@ -1,6 +1,6 @@ diff -ruN access/AccessControl.sol access/AccessControl.sol --- access/AccessControl.sol 2022-05-25 15:36:58.849363940 -0400 -+++ access/AccessControl.sol 2022-05-25 16:04:57.725255723 -0400 ++++ access/AccessControl.sol 2022-05-25 16:06:40.279512790 -0400 @@ -93,7 +93,7 @@ * * _Available since v4.6._ @@ -10,9 +10,15 @@ diff -ruN access/AccessControl.sol access/AccessControl.sol _checkRole(role, _msgSender()); } +diff -ruN .gitignore .gitignore +--- .gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ .gitignore 2022-05-25 16:07:01.911145854 -0400 +@@ -0,0 +1,2 @@ ++* ++!.gitignore diff -ruN governance/extensions/GovernorPreventLateQuorum.sol governance/extensions/GovernorPreventLateQuorum.sol --- governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 16:04:57.725255723 -0400 ++++ governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 16:06:40.279512790 -0400 @@ -21,8 +21,8 @@ using SafeCast for uint256; using Timers for Timers.BlockNumber; @@ -26,7 +32,7 @@ diff -ruN governance/extensions/GovernorPreventLateQuorum.sol governance/extensi event ProposalExtended(uint256 indexed proposalId, uint64 extendedDeadline); diff -ruN governance/Governor.sol governance/Governor.sol --- governance/Governor.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/Governor.sol 2022-05-25 16:04:57.725255723 -0400 ++++ governance/Governor.sol 2022-05-25 16:06:40.279512790 -0400 @@ -44,7 +44,7 @@ string private _name; @@ -38,7 +44,7 @@ diff -ruN governance/Governor.sol governance/Governor.sol // {onlyGovernance} modifier needs to be whitelisted in this queue. Whitelisting is set in {_beforeExecute}, diff -ruN governance/TimelockController.sol governance/TimelockController.sol --- governance/TimelockController.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/TimelockController.sol 2022-05-25 16:04:57.725255723 -0400 ++++ governance/TimelockController.sol 2022-05-25 16:06:40.279512790 -0400 @@ -28,10 +28,10 @@ bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); @@ -54,7 +60,7 @@ diff -ruN governance/TimelockController.sol governance/TimelockController.sol * @dev Emitted when a call is scheduled as part of operation `id`. diff -ruN governance/utils/Votes.sol governance/utils/Votes.sol --- governance/utils/Votes.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/utils/Votes.sol 2022-05-25 16:04:57.725255723 -0400 ++++ governance/utils/Votes.sol 2022-05-25 16:06:40.279512790 -0400 @@ -35,7 +35,25 @@ bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); @@ -129,7 +135,7 @@ diff -ruN governance/utils/Votes.sol governance/utils/Votes.sol } diff -ruN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol --- token/ERC1155/ERC1155.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC1155/ERC1155.sol 2022-05-25 16:04:57.725255723 -0400 ++++ token/ERC1155/ERC1155.sol 2022-05-25 16:06:40.279512790 -0400 @@ -268,7 +268,7 @@ uint256 id, uint256 amount, @@ -186,7 +192,7 @@ diff -ruN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol bytes4 response diff -ruN token/ERC20/ERC20.sol token/ERC20/ERC20.sol --- token/ERC20/ERC20.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/ERC20.sol 2022-05-25 16:04:57.725255723 -0400 ++++ token/ERC20/ERC20.sol 2022-05-25 16:06:40.279512790 -0400 @@ -277,7 +277,7 @@ * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. @@ -207,7 +213,7 @@ diff -ruN token/ERC20/ERC20.sol token/ERC20/ERC20.sol /** diff -ruN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20FlashMint.sol --- token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 16:04:57.725255723 -0400 ++++ token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 16:06:40.279512790 -0400 @@ -40,9 +40,11 @@ require(token == address(this), "ERC20FlashMint: wrong token"); // silence warning about unused variable without the addition of bytecode. @@ -223,7 +229,7 @@ diff -ruN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20 * implementation returns the address(0) which means the fee amount will be burnt. diff -ruN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Votes.sol --- token/ERC20/extensions/ERC20Votes.sol 2022-03-02 13:56:14.831535075 -0500 -+++ token/ERC20/extensions/ERC20Votes.sol 2022-05-25 16:04:57.725255723 -0400 ++++ token/ERC20/extensions/ERC20Votes.sol 2022-05-25 16:06:40.279512790 -0400 @@ -33,8 +33,8 @@ bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); @@ -237,7 +243,7 @@ diff -ruN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Vote /** diff -ruN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wrapper.sol --- token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 16:04:57.733255587 -0400 ++++ token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 16:06:40.311512247 -0400 @@ -55,7 +55,7 @@ * @dev Mint wrapped token to cover any underlyingTokens that would have been transferred by mistake. Internal * function that can be exposed with access control if desired. @@ -249,7 +255,7 @@ diff -ruN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wr return value; diff -ruN token/ERC721/extensions/draft-ERC721Votes.sol token/ERC721/extensions/draft-ERC721Votes.sol --- token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 16:04:57.733255587 -0400 ++++ token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 16:06:40.311512247 -0400 @@ -34,7 +34,7 @@ /** * @dev Returns the balance of `account`. @@ -261,7 +267,7 @@ diff -ruN token/ERC721/extensions/draft-ERC721Votes.sol token/ERC721/extensions/ } diff -ruN utils/Address.sol utils/Address.sol --- utils/Address.sol 2022-05-25 15:36:58.853363841 -0400 -+++ utils/Address.sol 2022-05-25 16:04:57.733255587 -0400 ++++ utils/Address.sol 2022-05-25 16:06:40.311512247 -0400 @@ -131,6 +131,7 @@ uint256 value, string memory errorMessage From 04382cd1d30e77528f9206b2ada2778753704c99 Mon Sep 17 00:00:00 2001 From: Michael George Date: Wed, 25 May 2022 16:20:28 -0400 Subject: [PATCH 80/81] fixed a munging merge problem --- certora/applyHarness.patch | 46 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/certora/applyHarness.patch b/certora/applyHarness.patch index 1c137a57b..6e9067725 100644 --- a/certora/applyHarness.patch +++ b/certora/applyHarness.patch @@ -1,6 +1,6 @@ diff -ruN access/AccessControl.sol access/AccessControl.sol --- access/AccessControl.sol 2022-05-25 15:36:58.849363940 -0400 -+++ access/AccessControl.sol 2022-05-25 16:06:40.279512790 -0400 ++++ access/AccessControl.sol 2022-05-25 16:07:31.897814961 -0400 @@ -93,7 +93,7 @@ * * _Available since v4.6._ @@ -12,13 +12,13 @@ diff -ruN access/AccessControl.sol access/AccessControl.sol diff -ruN .gitignore .gitignore --- .gitignore 1969-12-31 19:00:00.000000000 -0500 -+++ .gitignore 2022-05-25 16:07:01.911145854 -0400 ++++ .gitignore 2022-05-25 16:07:31.901816357 -0400 @@ -0,0 +1,2 @@ +* +!.gitignore diff -ruN governance/extensions/GovernorPreventLateQuorum.sol governance/extensions/GovernorPreventLateQuorum.sol --- governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 16:06:40.279512790 -0400 ++++ governance/extensions/GovernorPreventLateQuorum.sol 2022-05-25 16:07:31.901816357 -0400 @@ -21,8 +21,8 @@ using SafeCast for uint256; using Timers for Timers.BlockNumber; @@ -32,7 +32,7 @@ diff -ruN governance/extensions/GovernorPreventLateQuorum.sol governance/extensi event ProposalExtended(uint256 indexed proposalId, uint64 extendedDeadline); diff -ruN governance/Governor.sol governance/Governor.sol --- governance/Governor.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/Governor.sol 2022-05-25 16:06:40.279512790 -0400 ++++ governance/Governor.sol 2022-05-25 16:07:31.901816357 -0400 @@ -44,7 +44,7 @@ string private _name; @@ -44,7 +44,7 @@ diff -ruN governance/Governor.sol governance/Governor.sol // {onlyGovernance} modifier needs to be whitelisted in this queue. Whitelisting is set in {_beforeExecute}, diff -ruN governance/TimelockController.sol governance/TimelockController.sol --- governance/TimelockController.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/TimelockController.sol 2022-05-25 16:06:40.279512790 -0400 ++++ governance/TimelockController.sol 2022-05-25 16:07:31.901816357 -0400 @@ -28,10 +28,10 @@ bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); bytes32 public constant EXECUTOR_ROLE = keccak256("EXECUTOR_ROLE"); @@ -60,7 +60,7 @@ diff -ruN governance/TimelockController.sol governance/TimelockController.sol * @dev Emitted when a call is scheduled as part of operation `id`. diff -ruN governance/utils/Votes.sol governance/utils/Votes.sol --- governance/utils/Votes.sol 2022-05-25 15:36:58.849363940 -0400 -+++ governance/utils/Votes.sol 2022-05-25 16:06:40.279512790 -0400 ++++ governance/utils/Votes.sol 2022-05-25 16:07:31.901816357 -0400 @@ -35,7 +35,25 @@ bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); @@ -135,7 +135,7 @@ diff -ruN governance/utils/Votes.sol governance/utils/Votes.sol } diff -ruN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol --- token/ERC1155/ERC1155.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC1155/ERC1155.sol 2022-05-25 16:06:40.279512790 -0400 ++++ token/ERC1155/ERC1155.sol 2022-05-25 16:07:31.901816357 -0400 @@ -268,7 +268,7 @@ uint256 id, uint256 amount, @@ -192,28 +192,19 @@ diff -ruN token/ERC1155/ERC1155.sol token/ERC1155/ERC1155.sol bytes4 response diff -ruN token/ERC20/ERC20.sol token/ERC20/ERC20.sol --- token/ERC20/ERC20.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/ERC20.sol 2022-05-25 16:06:40.279512790 -0400 ++++ token/ERC20/ERC20.sol 2022-05-25 16:19:02.895813907 -0400 @@ -277,7 +277,7 @@ * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ - function _burn(address account, uint256 amount) internal virtual { -+ function _burn(address account, uint256 amount) public virtual returns (bool) { // HARNESS: internal -> public ++ function _burn(address account, uint256 amount) public virtual { // HARNESS: internal -> public require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); -@@ -292,6 +292,8 @@ - emit Transfer(account, address(0), amount); - - _afterTokenTransfer(account, address(0), amount); -+ -+ return true; - } - - /** diff -ruN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20FlashMint.sol --- token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 16:06:40.279512790 -0400 ++++ token/ERC20/extensions/ERC20FlashMint.sol 2022-05-25 16:07:31.901816357 -0400 @@ -40,9 +40,11 @@ require(token == address(this), "ERC20FlashMint: wrong token"); // silence warning about unused variable without the addition of bytecode. @@ -229,7 +220,7 @@ diff -ruN token/ERC20/extensions/ERC20FlashMint.sol token/ERC20/extensions/ERC20 * implementation returns the address(0) which means the fee amount will be burnt. diff -ruN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Votes.sol --- token/ERC20/extensions/ERC20Votes.sol 2022-03-02 13:56:14.831535075 -0500 -+++ token/ERC20/extensions/ERC20Votes.sol 2022-05-25 16:06:40.279512790 -0400 ++++ token/ERC20/extensions/ERC20Votes.sol 2022-05-25 16:14:01.137717224 -0400 @@ -33,8 +33,8 @@ bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); @@ -241,9 +232,18 @@ diff -ruN token/ERC20/extensions/ERC20Votes.sol token/ERC20/extensions/ERC20Vote Checkpoint[] private _totalSupplyCheckpoints; /** +@@ -169,7 +169,7 @@ + /** + * @dev Snapshots the totalSupply after it has been decreased. + */ +- function _burn(address account, uint256 amount) internal virtual override { ++ function _burn(address account, uint256 amount) public virtual override { + super._burn(account, amount); + + _writeCheckpoint(_totalSupplyCheckpoints, _subtract, amount); diff -ruN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wrapper.sol --- token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 16:06:40.311512247 -0400 ++++ token/ERC20/extensions/ERC20Wrapper.sol 2022-05-25 16:07:31.909819153 -0400 @@ -55,7 +55,7 @@ * @dev Mint wrapped token to cover any underlyingTokens that would have been transferred by mistake. Internal * function that can be exposed with access control if desired. @@ -255,7 +255,7 @@ diff -ruN token/ERC20/extensions/ERC20Wrapper.sol token/ERC20/extensions/ERC20Wr return value; diff -ruN token/ERC721/extensions/draft-ERC721Votes.sol token/ERC721/extensions/draft-ERC721Votes.sol --- token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 15:36:58.853363841 -0400 -+++ token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 16:06:40.311512247 -0400 ++++ token/ERC721/extensions/draft-ERC721Votes.sol 2022-05-25 16:07:31.909819153 -0400 @@ -34,7 +34,7 @@ /** * @dev Returns the balance of `account`. @@ -267,7 +267,7 @@ diff -ruN token/ERC721/extensions/draft-ERC721Votes.sol token/ERC721/extensions/ } diff -ruN utils/Address.sol utils/Address.sol --- utils/Address.sol 2022-05-25 15:36:58.853363841 -0400 -+++ utils/Address.sol 2022-05-25 16:06:40.311512247 -0400 ++++ utils/Address.sol 2022-05-25 16:07:31.909819153 -0400 @@ -131,6 +131,7 @@ uint256 value, string memory errorMessage From 5e69b54af1c2bef06ff22f6e19f7a86b4660385a Mon Sep 17 00:00:00 2001 From: Michael George Date: Wed, 25 May 2022 16:20:45 -0400 Subject: [PATCH 81/81] added solc version --- certora/scripts/verifyGovernorPreventLateQuorum.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/certora/scripts/verifyGovernorPreventLateQuorum.sh b/certora/scripts/verifyGovernorPreventLateQuorum.sh index 72b7fa651..f15e67219 100644 --- a/certora/scripts/verifyGovernorPreventLateQuorum.sh +++ b/certora/scripts/verifyGovernorPreventLateQuorum.sh @@ -1,13 +1,12 @@ certoraRun \ certora/harnesses/ERC721VotesHarness.sol certora/munged/governance/TimelockController.sol certora/harnesses/GovernorPreventLateQuorumHarness.sol \ --verify GovernorPreventLateQuorumHarness:certora/specs/GovernorPreventLateQuorum.spec \ - --solc solc \ + --solc solc8.13 \ --optimistic_loop \ --disable_auto_cache_key_gen \ --staging \ --send_only \ --loop_iter 1 \ - --rule $1 \ --msg "$1" \