From 53fdc028c53223d290ae93bcade92efd84d7935f Mon Sep 17 00:00:00 2001 From: Aaron DeRuvo Date: Wed, 14 Aug 2024 15:19:35 +0200 Subject: [PATCH 1/2] keeping up with the jones --- package.json | 3 +- packages/celotool/package.json | 16 +- packages/env-tests/package.json | 10 +- packages/metadata-crawler/package.json | 6 +- packages/protocol/package.json | 10 +- yarn.lock | 234 +++++++++---------------- 6 files changed, 110 insertions(+), 169 deletions(-) diff --git a/package.json b/package.json index 8c20f992118..69ed2cf24d2 100644 --- a/package.json +++ b/package.json @@ -68,5 +68,6 @@ "blind-threshold-bls": "npm:@celo/blind-threshold-bls@1.0.0-beta", "@types/bn.js": "4.11.6", "bignumber.js": "9.0.0" - } + }, + "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } diff --git a/packages/celotool/package.json b/packages/celotool/package.json index e39d976451d..8a8c9c31a34 100644 --- a/packages/celotool/package.json +++ b/packages/celotool/package.json @@ -6,15 +6,15 @@ "author": "Celo", "license": "Apache-2.0", "dependencies": { - "@celo/base": "^6.0.0", - "@celo/connect": "^5.1.2", - "@celo/cryptographic-utils": "^5.0.7", - "@celo/contractkit": "^7.0.0", + "@celo/base": "^6.1.0", + "@celo/connect": "^6.0.1", + "@celo/cryptographic-utils": "^5.1.0", + "@celo/contractkit": "^8.1.1", "@celo/env-tests": "1.0.3", - "@celo/explorer": "^5.0.8", - "@celo/governance": "^5.0.9", - "@celo/network-utils": "^5.0.5", - "@celo/utils": "^5.0.6", + "@celo/explorer": "^5.0.12", + "@celo/governance": "^5.1.3", + "@celo/network-utils": "^5.0.6", + "@celo/utils": "^7.0.0", "@ethereumjs/util": "8.0.5", "@ethereumjs/rlp": "4.0.1", "@google-cloud/monitoring": "0.7.1", diff --git a/packages/env-tests/package.json b/packages/env-tests/package.json index ab4c6e84233..0ad6abae541 100644 --- a/packages/env-tests/package.json +++ b/packages/env-tests/package.json @@ -6,11 +6,11 @@ "main": "index.js", "license": "MIT", "dependencies": { - "@celo/contractkit": "^7.0.0", - "@celo/utils": "^5.0.6", - "@celo/base": "^6.0.0", - "@celo/connect": "^5.1.2", - "@celo/cryptographic-utils": "^5.0.7", + "@celo/contractkit": "^8.1.1", + "@celo/utils": "^7.0.0", + "@celo/base": "^6.1.0", + "@celo/connect": "^6.0.1", + "@celo/cryptographic-utils": "^5.1.0", "bignumber.js": "^9.0.0", "bunyan": "1.8.12", "bunyan-gke-stackdriver": "0.1.2", diff --git a/packages/metadata-crawler/package.json b/packages/metadata-crawler/package.json index 5c1fb1ed824..46ca516c25a 100644 --- a/packages/metadata-crawler/package.json +++ b/packages/metadata-crawler/package.json @@ -9,9 +9,9 @@ "homepage": "https://github.com/celo-org/celo-monorepo/tree/master/packages/metadata-crawler", "repository": "https://github.com/celo-org/celo-monorepo/tree/master/packages/metadata-crawler", "dependencies": { - "@celo/connect": "^5.1.2", - "@celo/contractkit": "^7.0.0", - "@celo/utils": "^5.0.6", + "@celo/connect": "^6.0.1", + "@celo/contractkit": "^8.1.1", + "@celo/utils": "^7.0.0", "@types/pg": "^7.14.3", "bunyan": "1.8.12", "bunyan-gke-stackdriver": "0.1.2", diff --git a/packages/protocol/package.json b/packages/protocol/package.json index 5c213455084..7c260f0e3f9 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -64,12 +64,12 @@ "@0x/sol-profiler": "^4.1.37", "@0x/sol-trace": "^3.0.47", "@0x/subproviders": "^7.0.1", - "@celo/base": "^6.0.0", + "@celo/base": "^6.1.0", "@celo/bls12377js": "0.1.1", - "@celo/connect": "^5.1.2", - "@celo/cryptographic-utils": "^5.0.7", - "@celo/utils": "^5.0.6", - "@celo/wallet-local": "^5.1.2", + "@celo/connect": "^6.0.1", + "@celo/cryptographic-utils": "^5.1.0", + "@celo/utils": "^7.0.0", + "@celo/wallet-local": "^6.0.1", "@ethereumjs/util": "8.0.5", "@ethereumjs/vm": "npm:@celo/ethereumjs-vm@6.4.1-unofficial.0", "@ganache/console.log": "0.3.0", diff --git a/yarn.lock b/yarn.lock index 9ae825e3764..839d4797bd8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -792,15 +792,15 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@celo/abis@10.0.0": - version "10.0.0" - resolved "https://registry.yarnpkg.com/@celo/abis/-/abis-10.0.0.tgz#2c1002f2e82b29ca22cec70c988bf90d26fadc68" - integrity sha512-DC8UAEz89+1yEQqKzkxOWLYGUv/XWaqPAOkU0lKuQzhvN25ndP3fitawQl53WYn8i3ZPfRWfLO4w75l//tDSbg== +"@celo/abis-12@npm:@celo/abis@12.0.0-canary.16": + version "12.0.0-canary.16" + resolved "https://registry.yarnpkg.com/@celo/abis/-/abis-12.0.0-canary.16.tgz#9f043c2032f41f60d28b33bd2b79c62e857d0f9a" + integrity sha512-nbynuyhXUZKQTEUlkvQaWI7y4lPXa5xuVLJDLqzNfWbF27E6V1xGoMNUK4XxzmTC161VOPp18Guah2C49kXQ0w== -"@celo/base@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@celo/base/-/base-6.0.0.tgz#23811b0bc8730a0d13fa90df55a7ec0e90d370cd" - integrity sha512-z29p7glyh69R4tKSbZuomEvnAihmzgQKxmGoqt/4S6zSx6uOjTILUlhqlcDl2Wbkd+V0h85ft14nui2HXY2Lsg== +"@celo/abis@11.0.0": + version "11.0.0" + resolved "https://registry.yarnpkg.com/@celo/abis/-/abis-11.0.0.tgz#7f96b6142498662fdf36427afc8a4539c6db50e4" + integrity sha512-rPjHQxHbWaKQU3MX6hE3A3xRkBFBphjFvfCs4t+19dqPPys6Q+cneHmRWGBX4NLiBh5BLZcNZjQoMf2jxRLMpg== "@celo/base@^6.1.0": version "6.1.0" @@ -815,45 +815,46 @@ "@stablelib/blake2xs" "0.10.4" big-integer "^1.6.44" -"@celo/connect@^5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@celo/connect/-/connect-5.1.2.tgz#c8d170ebe1d0f043b932add374718f0fbb239102" - integrity sha512-b0dJsjtTg65PDbfjbuEyOzicB9yyR4AGzppY9zcaUxUktYaK5dePeUOXQoYeZBWCsZ/iAZplUmmU4ITR6/InnQ== +"@celo/connect@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@celo/connect/-/connect-6.0.1.tgz#7a0c85d73167df4129cb4b92f86476333e640a72" + integrity sha512-nMWivxDeXSILRqsnFZNDz4Rv3eX3xj7++16LT03m5fa6GvlfLvxx1jQ1yv6Hf2Z8yvHEeL36zzBIfqyHOyF99Q== dependencies: - "@celo/base" "^6.0.0" - "@celo/utils" "^6.0.0" + "@celo/base" "^6.1.0" + "@celo/utils" "^7.0.0" "@ethereumjs/util" "8.0.5" "@types/debug" "^4.1.5" "@types/utf8" "^2.1.6" bignumber.js "^9.0.0" debug "^4.1.1" utf8 "3.0.0" - web3-core "1.10.0" - web3-eth "1.10.0" - web3-eth-contract "1.10.0" + web3-core "1.10.4" + web3-eth "1.10.4" + web3-eth-contract "1.10.4" -"@celo/contractkit@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@celo/contractkit/-/contractkit-7.0.0.tgz#6878ce9c2b0c381703cfc26195db0678f50b6854" - integrity sha512-Knmg2TeO7W363xMNgOC5ZEKWn8RpsO4ARsq8SDLRq2O4v84GnTMPCh43+sIwmckx/d3tklhXrcHq/oLWiNLXYg== - dependencies: - "@celo/abis" "10.0.0" - "@celo/base" "^6.0.0" - "@celo/connect" "^5.1.2" - "@celo/utils" "^6.0.0" - "@celo/wallet-local" "^5.1.2" +"@celo/contractkit@^8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@celo/contractkit/-/contractkit-8.1.1.tgz#21d8b3af12cb7fcc7713d33eadb0c3148744fa22" + integrity sha512-EUZaoo8BQIkXKWF4h0UI9yNmVAsDSsDOjTB5C4RrdDkylzn7PGICPmUMq/9WU2QH1zFV9kf1JpGzxlA8Uci6MQ== + dependencies: + "@celo/abis" "11.0.0" + "@celo/abis-12" "npm:@celo/abis@12.0.0-canary.16" + "@celo/base" "^6.1.0" + "@celo/connect" "^6.0.1" + "@celo/utils" "^7.0.0" + "@celo/wallet-local" "^6.0.1" "@types/bn.js" "^5.1.0" "@types/debug" "^4.1.5" bignumber.js "^9.0.0" - cross-fetch "3.0.6" + cross-fetch "3.1.5" debug "^4.1.1" fp-ts "2.1.1" io-ts "2.0.1" semver "^7.3.5" - web3 "1.10.0" - web3-core-helpers "1.10.0" + web3 "1.10.4" + web3-core-helpers "1.10.4" -"@celo/cryptographic-utils@^5.0.7": +"@celo/cryptographic-utils@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@celo/cryptographic-utils/-/cryptographic-utils-5.1.0.tgz#64adcf4fe852d209cc4443d5e1ad9897d03de611" integrity sha512-UWdg+sQJaf5vaN7F52OqmPL5bG94Av8IfWzZH4u9FQaE1slzd9xz5fB7DYuBdjpXWcSGqhZyK0/8pooJXtu7xA== @@ -882,46 +883,45 @@ web3 "1.10.4" web3-core-helpers "1.10.4" -"@celo/explorer@^5.0.8": - version "5.0.8" - resolved "https://registry.yarnpkg.com/@celo/explorer/-/explorer-5.0.8.tgz#48e7ec3867f3a82318b66038c1e546ab279a710a" - integrity sha512-2Qadubg9Cs33Vp8y8m2dAj4iTnL5dKgu9u3p+uacrGjWG48tax1hMU+9hpmaR0/Hc/gONNjdK3WzuqfnH02rKQ== +"@celo/explorer@^5.0.12": + version "5.0.12" + resolved "https://registry.yarnpkg.com/@celo/explorer/-/explorer-5.0.12.tgz#b0f19905953315fec464a79a7c4e6b399719d0bf" + integrity sha512-Y03U5kbJ2FaLBkzG68pjTwpfKAf2T/WIt0TB4QmA0IofI0aGdfXGSDW8hIModJK/K0B8FnPD1116pi4oPk9I+g== dependencies: - "@celo/base" "^6.0.0" - "@celo/connect" "^5.1.2" - "@celo/contractkit" "^7.0.0" - "@celo/utils" "^6.0.0" + "@celo/base" "^6.1.0" + "@celo/connect" "^6.0.1" + "@celo/contractkit" "^8.1.1" + "@celo/utils" "^7.0.0" "@types/debug" "^4.1.5" bignumber.js "9.0.0" - cross-fetch "3.0.6" + cross-fetch "3.1.5" debug "^4.1.1" -"@celo/governance@^5.0.9": - version "5.0.9" - resolved "https://registry.yarnpkg.com/@celo/governance/-/governance-5.0.9.tgz#d7b92598ddd3f249a5e0fd45a6d5565985b1238f" - integrity sha512-PEHK6te4zx5pIqBi8MHqNjJt8flqoO6y/OHHux7labJywIrkOHk8CmEesfYm1ByaREhp7L9Fo4RwE40bf8OY2Q== - dependencies: - "@celo/abis" "10.0.0" - "@celo/base" "^6.0.0" - "@celo/connect" "^5.1.2" - "@celo/contractkit" "^7.0.0" - "@celo/explorer" "^5.0.8" - "@celo/utils" "^6.0.0" +"@celo/governance@^5.1.3": + version "5.1.3" + resolved "https://registry.yarnpkg.com/@celo/governance/-/governance-5.1.3.tgz#f72e22df9fc684e48ecbd2e59f1ac5a42c2574ad" + integrity sha512-aD+V+e4oQydYw/YMYKqSx3/SblXaoz0eS/auhHZvbC0JPQEaS36Bf0idAfr5ybBrbOzu7a2hDNo1KOU6adGCkA== + dependencies: + "@celo/abis" "11.0.0" + "@celo/base" "^6.1.0" + "@celo/connect" "^6.0.1" + "@celo/contractkit" "^8.1.1" + "@celo/explorer" "^5.0.12" + "@celo/utils" "^7.0.0" "@ethereumjs/util" "8.0.5" "@types/debug" "^4.1.5" "@types/inquirer" "^6.5.0" bignumber.js "^9.0.0" debug "^4.1.1" - ethereum-cryptography "1.2.0" inquirer "^7.0.5" -"@celo/network-utils@^5.0.5": - version "5.0.5" - resolved "https://registry.yarnpkg.com/@celo/network-utils/-/network-utils-5.0.5.tgz#5d096b435cd93ea1083951966b4f349bdb82b3d4" - integrity sha512-9+0Pr3OLSS3O1baxbUSW+HfCWcctPEfwuccvuVqdLiXqcuP5Usx8IDi3XAkEQcvGQ1RS097FqZqM6t8u+Npqgw== +"@celo/network-utils@^5.0.6": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@celo/network-utils/-/network-utils-5.0.6.tgz#50f2006c04e76939464bfaabe7a236c7fbff6291" + integrity sha512-F4IuC73HOVu4VDmT8sf2+UEVbRhmsIvRl/YYwGtcQcoMZlRL+TPxfSjhy3HWtAERldyLfhmXc0Lu6H9Bkem1Dg== dependencies: "@types/debug" "^4.1.5" - cross-fetch "3.0.6" + cross-fetch "3.1.5" debug "^4.1.1" "@celo/typechain-target-web3-v1-celo@^1.0.0": @@ -941,44 +941,6 @@ tslint-eslint-rules "^5.4.0" tslint-microsoft-contrib "^6.2.0" -"@celo/utils@^5.0.6": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@celo/utils/-/utils-5.0.6.tgz#26d57dbbb524f3452c73af7ad5eb46ffff4a767b" - integrity sha512-bOnHZC72VeKtBRMoityH8GQbgOfIhLTzya+yV5taZsvPZM2vewc+ZHhrEVAh5OBeGjQOr4E2hExawaI3WQy5bQ== - dependencies: - "@celo/base" "^6.0.0" - "@ethereumjs/util" "8.0.5" - "@types/bn.js" "^5.1.0" - "@types/elliptic" "^6.4.9" - "@types/node" "^18.7.16" - bignumber.js "^9.0.0" - bn.js "4.11.9" - elliptic "^6.5.4" - ethereum-cryptography "1.2.0" - fp-ts "2.1.1" - io-ts "2.0.1" - rlp "^2.2.4" - web3-eth-abi "1.10.0" - web3-utils "1.10.0" - -"@celo/utils@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@celo/utils/-/utils-6.0.0.tgz#869f45a66c9e13789ca4b61d88dcf5a247f37d5c" - integrity sha512-0jveALnE5WvasJcSAlBB0XnuzhqbKTj51b0+CkWg6aU0eCA0cQEzW4kQVt/X+Wo8d9S18ardmIVkwzrKToBdEA== - dependencies: - "@celo/base" "^6.0.0" - "@ethereumjs/util" "8.0.5" - "@types/elliptic" "^6.4.9" - "@types/node" "^18.7.16" - bignumber.js "^9.0.0" - elliptic "^6.5.4" - ethereum-cryptography "1.2.0" - fp-ts "2.1.1" - io-ts "2.0.1" - rlp "^2.2.4" - web3-eth-abi "1.10.0" - web3-utils "1.10.0" - "@celo/utils@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@celo/utils/-/utils-7.0.0.tgz#76bf2576d74daf43ec3801fe45cf78b8e6eacff1" @@ -998,34 +960,34 @@ web3-eth-abi "1.10.4" web3-utils "1.10.4" -"@celo/wallet-base@^5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@celo/wallet-base/-/wallet-base-5.1.2.tgz#294a0a98f72d3c72b38337b534a97820128c8bd0" - integrity sha512-bb3JRIXD68P1RxpFJG0UfzBkIztkKvHC6P2KRBiSJZbcwbCsAstqfU44oMMsmE6dPkQHINbBcCAVSDYWfTaccA== +"@celo/wallet-base@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@celo/wallet-base/-/wallet-base-6.0.1.tgz#03053ea8599798838d70968d2d493a79784107ce" + integrity sha512-6vZxEkm6VcT/LmKDnyxmS6n8YWEUo20E5tccY8XrBxcLAPinaiLfcwEQsgvspIB6m4hG/AH3qtuKby5nC4T/6g== dependencies: - "@celo/base" "^6.0.0" - "@celo/connect" "^5.1.2" - "@celo/utils" "^6.0.0" - "@ethereumjs/rlp" "^5.0.0" + "@celo/base" "^6.1.0" + "@celo/connect" "^6.0.1" + "@celo/utils" "^7.0.0" + "@ethereumjs/rlp" "^5.0.2" "@ethereumjs/util" "8.0.5" + "@noble/curves" "^1.3.0" + "@noble/hashes" "^1.3.3" "@types/debug" "^4.1.5" bignumber.js "^9.0.0" debug "^4.1.1" - eth-lib "^0.2.8" - ethereum-cryptography "^2.1.2" - web3 "1.10.0" - web3-eth-accounts "1.10.0" + web3 "1.10.4" + web3-eth-accounts "1.10.4" -"@celo/wallet-local@^5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@celo/wallet-local/-/wallet-local-5.1.2.tgz#c295793c634cb690423c3e858da1fa55ef61462e" - integrity sha512-qk5sVdwzZByrb4YW1+Ux8DLeNB/zpoCWmS+9V47vPWJv5s37QUOYFE0/95I5Pn9iVSkKTmjuDHEetAQ7Fio/0g== +"@celo/wallet-local@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@celo/wallet-local/-/wallet-local-6.0.1.tgz#c06f57ac32776f325e859fd982913fa2d5109178" + integrity sha512-bSf7qxAs4ONEDrpdJZRqiayWWyKsO7fu2ai8PDQsICnLw8ZsyVP7+oNgr7zberHk6ghdmG1Qp957a0Myw7w6lA== dependencies: - "@celo/connect" "^5.1.2" - "@celo/utils" "^6.0.0" - "@celo/wallet-base" "^5.1.2" + "@celo/base" "^6.1.0" + "@celo/connect" "^6.0.1" + "@celo/utils" "^7.0.0" + "@celo/wallet-base" "^6.0.1" "@ethereumjs/util" "8.0.5" - eth-lib "^0.2.8" "@chainsafe/as-sha256@^0.3.1": version "0.3.1" @@ -1327,11 +1289,6 @@ resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41" integrity sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw== -"@ethereumjs/rlp@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-5.0.0.tgz#dd81b32b2237bc32fb1b54534f8ff246a6c89d9b" - integrity sha512-WuS1l7GJmB0n0HsXLozCoEFc9IwYgf3l0gCkKVYgR67puVF1O4OpEaN0hWmm1c+iHUHFCKt1hJrvy5toLg+6ag== - "@ethereumjs/rlp@^5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-5.0.2.tgz#c89bd82f2f3bec248ab2d517ae25f5bbc4aac842" @@ -3143,6 +3100,13 @@ dependencies: "@noble/hashes" "1.3.3" +"@noble/curves@^1.3.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.5.0.tgz#7a9b9b507065d516e6dce275a1e31db8d2a100dd" + integrity sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/curves@~1.4.0": version "1.4.2" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" @@ -3170,7 +3134,7 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== -"@noble/hashes@1.4.0", "@noble/hashes@~1.4.0": +"@noble/hashes@1.4.0", "@noble/hashes@^1.3.3", "@noble/hashes@~1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== @@ -4722,7 +4686,7 @@ dependencies: "@babel/types" "^7.3.0" -"@types/bn.js@*", "@types/bn.js@4.11.6", "@types/bn.js@^4.11.0", "@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^5.1.0", "@types/bn.js@^5.1.1": +"@types/bn.js@4.11.6", "@types/bn.js@^4.11.0", "@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^5.1.0", "@types/bn.js@^5.1.1": version "4.11.6" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== @@ -4826,13 +4790,6 @@ dependencies: "@types/node" "*" -"@types/elliptic@^6.4.9": - version "6.4.14" - resolved "https://registry.yarnpkg.com/@types/elliptic/-/elliptic-6.4.14.tgz#7bbaad60567a588c1f08b10893453e6b9b4de48e" - integrity sha512-z4OBcDAU0GVwDTuwJzQCiL6188QvZMkvoERgcVjq0/mPM8jCfdwZ3x5zQEVoL9WCAru3aG5wl3Z5Ww5wBWn7ZQ== - dependencies: - "@types/bn.js" "*" - "@types/ethereum-protocol@*": version "1.0.2" resolved "https://registry.yarnpkg.com/@types/ethereum-protocol/-/ethereum-protocol-1.0.2.tgz#e765d4c6f4b5ebe906932bd20333e307c56a9bc7" @@ -6661,11 +6618,6 @@ bn.js@4.11.8: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== -bn.js@4.11.9: - version "4.11.9" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" - integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== - bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" @@ -8127,14 +8079,7 @@ cross-env@^5.1.6: dependencies: cross-spawn "^6.0.5" -cross-fetch@3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" - integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ== - dependencies: - node-fetch "2.6.1" - -cross-fetch@^3.1.4: +cross-fetch@3.1.5, cross-fetch@^3.1.4: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== @@ -15471,11 +15416,6 @@ node-domexception@^1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" From fac3c0c38a1cc0eb88a111ffcba956ea8a1aeb90 Mon Sep 17 00:00:00 2001 From: Aaron DeRuvo Date: Wed, 28 Aug 2024 13:10:25 +0200 Subject: [PATCH 2/2] upgrade to lastest contractkit -- for better l2 compatability remove demurage / inflation test on Stable transfer e2e as that no longer exists --- packages/celotool/package.json | 2 +- .../src/cmds/deploy/upgrade/hotfix.ts | 5 +- .../src/cmds/generate/faucet-load-test.ts | 3 +- .../celotool/src/e2e-tests/cip35_tests.ts | 70 ++--- .../celotool/src/e2e-tests/transfer_tests.ts | 258 +----------------- packages/celotool/src/lib/generate_utils.ts | 5 +- packages/celotool/src/lib/geth.ts | 26 +- .../lib/interfaces/geth-instance-config.ts | 3 - packages/env-tests/src/monorepoRun.ts | 2 + packages/env-tests/src/tests/oracle.ts | 5 +- packages/env-tests/src/tests/reserve.ts | 2 +- packages/metadata-crawler/src/crawler.ts | 26 +- packages/protocol/package.json | 6 +- 13 files changed, 76 insertions(+), 337 deletions(-) diff --git a/packages/celotool/package.json b/packages/celotool/package.json index 8a8c9c31a34..360970f6634 100644 --- a/packages/celotool/package.json +++ b/packages/celotool/package.json @@ -44,7 +44,7 @@ "tiny-secp256k1": "2.2.1", "chai": "^4.3.7", "mocha": "^10.2.0", - "web3": "1.10.0", + "web3": "1.10.4", "web3-eth-admin": "1.0.0-beta.55", "yargs": "17.7.2" }, diff --git a/packages/celotool/src/cmds/deploy/upgrade/hotfix.ts b/packages/celotool/src/cmds/deploy/upgrade/hotfix.ts index 0554873625d..62c7554176a 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/hotfix.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/hotfix.ts @@ -1,6 +1,7 @@ // This is a more unusual Celotool command. It basically helps you to execute Hotfixes on testnets. Because constructing proposals is difficult to do via a CLI, you should define them here in code. There are two examples below that you can start from. import { newKitFromWeb3 } from '@celo/contractkit' +import { L1HotfixRecord } from '@celo/contractkit/lib/wrappers/Governance' import { hotfixToHash, ProposalBuilder, proposalToJSON } from '@celo/governance' import { privateKeyToAddress } from '@celo/utils/lib/address' import { concurrentMap } from '@celo/utils/lib/async' @@ -121,7 +122,9 @@ export const handler = async (argv: EthstatsArgv) => { hotfixRecord = await governance.getHotfixRecord(proposalHash) console.info('\nHotfix Record: ', hotfixRecord) - if (hotfixRecord.preparedEpoch.toNumber() === 0) { + // if this is actually used we need to handle the L2 case but that is out of scope for just upgrading ck + + if ((hotfixRecord as L1HotfixRecord).preparedEpoch?.toNumber() === 0) { console.error('Hotfix could not be prepared') throw new Error() } diff --git a/packages/celotool/src/cmds/generate/faucet-load-test.ts b/packages/celotool/src/cmds/generate/faucet-load-test.ts index 2fae45c3eb9..4a048682437 100644 --- a/packages/celotool/src/cmds/generate/faucet-load-test.ts +++ b/packages/celotool/src/cmds/generate/faucet-load-test.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { newKit } from '@celo/contractkit' import { switchToClusterFromEnv } from 'src/lib/cluster' import { convertToContractDecimals } from 'src/lib/contract-utils' @@ -65,7 +66,7 @@ export const handler = async (argv: CeloEnvArgv & FaucetLoadTest) => { const kit = newKit('http://localhost:8545') const account = (await kit.web3.eth.getAccounts())[0] console.info(`Using account: ${account}`) - kit.defaultAccount = account + kit.defaultAccount = account as StrongAddress const [goldToken, stableToken] = await Promise.all([ kit.contracts.getGoldToken(), diff --git a/packages/celotool/src/e2e-tests/cip35_tests.ts b/packages/celotool/src/e2e-tests/cip35_tests.ts index b31e8f93aae..deae95d25e3 100644 --- a/packages/celotool/src/e2e-tests/cip35_tests.ts +++ b/packages/celotool/src/e2e-tests/cip35_tests.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { CeloTx } from '@celo/connect' import { ContractKit, newKitFromWeb3 } from '@celo/contractkit' import { privateKeyToAddress } from '@celo/utils/lib/address' @@ -26,7 +27,6 @@ const validatorPrivateKey = generatePrivateKey(mnemonic, AccountType.VALIDATOR, const validatorAddress = privateKeyToAddress(validatorPrivateKey) // Arbitrary addresses to use in the transactions const toAddress = '0x8c36775E95A5f7FEf6894Ba658628352Ac58605B' -const gatewayFeeRecipientAddress = '0xc77538d1e30C0e4ec44B0DcaD97FD3dc63fcaCC4' // Simple contract with a single constant const bytecode = @@ -47,8 +47,6 @@ const devFilter: Filter = { ethCompatible: undefined, contractCreation: undefined, useFeeCurrency: undefined, - useGatewayFee: undefined, - useGatewayFeeRecipient: undefined, sendRawTransaction: undefined, } /// //////////////////////////////////////////////////////////////////////////////////////////// @@ -65,8 +63,6 @@ interface TestCase { ethCompatible: boolean contractCreation: boolean useFeeCurrency: boolean - useGatewayFee: boolean - useGatewayFeeRecipient: boolean sendRawTransaction: boolean // whether to use eth_sendRawTransaction ot eth_sendTransaction errorString: string | null errorReason: string | null @@ -88,38 +84,32 @@ function generateTestCases(cipIsActivated: boolean) { for (const ethCompatible of getValues(devFilter.ethCompatible)) { for (const contractCreation of getValues(devFilter.contractCreation)) { for (const useFeeCurrency of getValues(devFilter.useFeeCurrency)) { - for (const useGatewayFee of getValues(devFilter.useGatewayFee)) { - for (const useGatewayFeeRecipient of getValues(devFilter.useGatewayFeeRecipient)) { - for (const sendRawTransaction of getValues(devFilter.sendRawTransaction)) { - let errorString: string | null = null - let errorReason: string | null = null - const hasCeloFields = useFeeCurrency || useGatewayFee || useGatewayFeeRecipient - if (ethCompatible && hasCeloFields) { - errorString = notCompatibleError - errorReason = 'transaction has celo-only fields' - } else if (ethCompatible && !cipIsActivated) { - errorString = notYetActivatedError - errorReason = 'Donut is not activated' - } - if (sendRawTransaction && ethCompatible && hasCeloFields) { - // Such scenarios don't make sense, since eth-compatible transactions in RLP can't have - // these fields. So skip these cases. - continue - } - cases.push({ - cipIsActivated, - lightNode, - ethCompatible, - contractCreation, - useFeeCurrency, - useGatewayFee, - useGatewayFeeRecipient, - sendRawTransaction, - errorString, - errorReason, - }) - } + for (const sendRawTransaction of getValues(devFilter.sendRawTransaction)) { + let errorString: string | null = null + let errorReason: string | null = null + const hasCeloFields = useFeeCurrency + if (ethCompatible && hasCeloFields) { + errorString = notCompatibleError + errorReason = 'transaction has celo-only fields' + } else if (ethCompatible && !cipIsActivated) { + errorString = notYetActivatedError + errorReason = 'Donut is not activated' } + if (sendRawTransaction && ethCompatible && hasCeloFields) { + // Such scenarios don't make sense, since eth-compatible transactions in RLP can't have + // these fields. So skip these cases. + continue + } + cases.push({ + cipIsActivated, + lightNode, + ethCompatible, + contractCreation, + useFeeCurrency, + sendRawTransaction, + errorString, + errorReason, + }) } } } @@ -344,13 +334,7 @@ class TestEnv { nonce: await this.kit.connection.nonce(validatorAddress), } if (testCase.useFeeCurrency) { - tx.feeCurrency = this.stableTokenAddr - } - if (testCase.useGatewayFee) { - tx.gatewayFee = '0x25' - } - if (testCase.useGatewayFeeRecipient) { - tx.gatewayFeeRecipient = gatewayFeeRecipientAddress + tx.feeCurrency = this.stableTokenAddr as StrongAddress } if (testCase.contractCreation) { diff --git a/packages/celotool/src/e2e-tests/transfer_tests.ts b/packages/celotool/src/e2e-tests/transfer_tests.ts index 2de49034b2e..311154b2e4e 100644 --- a/packages/celotool/src/e2e-tests/transfer_tests.ts +++ b/packages/celotool/src/e2e-tests/transfer_tests.ts @@ -1,8 +1,8 @@ +import { StrongAddress } from '@celo/base' import { CeloTxPending, CeloTxReceipt, TransactionResult } from '@celo/connect' import { ContractKit, newKitFromWeb3 } from '@celo/contractkit' import { CeloTokenType, EachCeloToken, StableToken, Token } from '@celo/contractkit/lib/celo-tokens' import { eqAddress, toChecksumAddress } from '@celo/utils/lib/address' -import { toFixed } from '@celo/utils/lib/fixidity' import BigNumber from 'bignumber.js' import { assert } from 'chai' import Web3 from 'web3' @@ -13,67 +13,6 @@ import { getHooks, initAndSyncGethWithRetry, killInstance, sleep } from './utils const TMP_PATH = '/tmp/e2e' const verbose = false -/** - * Helper Class to change StableToken Inflation in tests - */ -class InflationManager { - private kit: ContractKit - private readonly minUpdateDelay = 10 - - constructor( - readonly validatorUri: string, - readonly validatorAddress: string, - readonly token: StableToken - ) { - this.kit = newKitFromWeb3(new Web3(validatorUri)) - this.kit.connection.defaultAccount = validatorAddress - } - - now = async (): Promise => { - return Number((await this.kit.connection.getBlock('pending')).timestamp) - } - - getNextUpdateRate = async (): Promise => { - const stableToken = await this.getStableToken() - // Compute necessary `updateRate` so inflationFactor adjusment takes place on next operation - const { factorLastUpdated } = await stableToken.getInflationParameters() - - // Wait until the minimum update delay has passed so we can set a rate that gives us some - // buffer time to make the transaction in the next availiable update window. - let timeSinceLastUpdated = (await this.now()) - factorLastUpdated.toNumber() - while (timeSinceLastUpdated < this.minUpdateDelay) { - await sleep(this.minUpdateDelay - timeSinceLastUpdated) - timeSinceLastUpdated = (await this.now()) - factorLastUpdated.toNumber() - } - - return timeSinceLastUpdated - } - - getParameters = async () => { - const stableToken = await this.getStableToken() - return stableToken.getInflationParameters() - } - - setInflationRateForNextTransfer = async (rate: BigNumber) => { - // Possibly update the inflation factor and ensure it won't update again. - await this.setInflationParameters(new BigNumber(1), Number.MAX_SAFE_INTEGER) - - const updateRate = await this.getNextUpdateRate() - await this.setInflationParameters(rate, updateRate) - } - - setInflationParameters = async (rate: BigNumber, updatePeriod: number) => { - const stableToken = await this.getStableToken() - await stableToken - .setInflationParameters(toFixed(rate).toFixed(), updatePeriod.toFixed()) - .sendAndWaitForReceipt({ from: this.validatorAddress }) - } - - getStableToken = async () => { - return this.kit.celoTokens.getWrapper(this.token) - } -} - const setIntrinsicGas = async (validatorUri: string, validatorAddress: string, gasCost: number) => { const kit = newKitFromWeb3(new Web3(validatorUri)) const parameters = await kit.contracts.getBlockchainParameters() @@ -205,7 +144,7 @@ describe('Transfer tests', function (this: any) { // Arbitrary addresses. const txFeeRecipientAddress = '0x5555555555555555555555555555555555555555' const ToAddress = '0xbBae99F0E1EE565404465638d40827b54D343638' - const gatewayFeeRecipientAddress = '0x4f5f8a3f45d179553e7b95119ce296010f50f6f1' + const someOtherAddress = '0x4f5f8a3f45d179553e7b95119ce296010f50f6f1' const syncModes = ['full', 'fast', 'light', 'lightest'] const gethConfig: GethRunConfig = { @@ -250,13 +189,12 @@ describe('Transfer tests', function (this: any) { validating: false, syncmode: 'full', lightserv: true, - gatewayFee: new BigNumber(10000), port: 30305, rpcport: 8547, // We need to set an etherbase here so that the full node will accept transactions from // light clients. - minerValidator: gatewayFeeRecipientAddress, - txFeeRecipient: gatewayFeeRecipientAddress, + minerValidator: someOtherAddress, + txFeeRecipient: someOtherAddress, } const restartWithCleanNodes = async () => { @@ -311,8 +249,6 @@ describe('Transfer tests', function (this: any) { port: 30307, rpcport: 8549, lightserv: !light, - // TODO(nategraf): Remove this when light clients can query for gateway fee. - gatewayFee: light ? new BigNumber(10000) : undefined, privateKey: DEF_FROM_PK, } @@ -346,9 +282,7 @@ describe('Transfer tests', function (this: any) { txOptions: { gas?: number gasPrice?: string - feeCurrency?: string - gatewayFeeRecipient?: string - gatewayFee?: string + feeCurrency?: StrongAddress } = {} ) => { const res = await kit.connection.sendTransaction({ @@ -367,9 +301,7 @@ describe('Transfer tests', function (this: any) { txOptions: { gas?: number gasPrice?: string - feeCurrency?: string - gatewayFeeRecipient?: string - gatewayFee?: string + feeCurrency?: StrongAddress } = {} ) => { const kitStableToken = await kit.contracts.getStableToken() @@ -394,7 +326,6 @@ describe('Transfer tests', function (this: any) { total: BigNumber tip: BigNumber base: BigNumber - gateway: BigNumber } interface GasUsage { @@ -465,17 +396,11 @@ describe('Transfer tests', function (this: any) { const txFee = new BigNumber(gasVal).times(tx.gasPrice) const txFeeBase = new BigNumber(gasVal).times(minGasPrice) const txFeeTip = txFee.minus(txFeeBase) - const gatewayFee = new BigNumber(tx.gatewayFee || 0) - assert.equal( - tx.gatewayFeeRecipient === null || tx.gatewayFeeRecipient === undefined, - gatewayFee.eq(0) - ) const fees: Fees = { - total: txFee.plus(gatewayFee), + total: txFee, base: txFeeBase, tip: txFeeTip, - gateway: gatewayFee, } const gas: GasUsage = { used: receipt && receipt.gasUsed, @@ -528,8 +453,6 @@ describe('Transfer tests', function (this: any) { expectSuccess?: boolean txOptions?: { gas?: number - gatewayFeeRecipient?: string - gatewayFee?: string } fromAddress?: string toAddress?: string @@ -562,8 +485,6 @@ describe('Transfer tests', function (this: any) { expectSuccess?: boolean txOptions?: { gas?: number - gatewayFeeRecipient?: string - gatewayFee?: string } fromAddress?: string toAddress?: string @@ -578,7 +499,7 @@ describe('Transfer tests', function (this: any) { fromAddress, toAddress, txFeeRecipientAddress, - gatewayFeeRecipientAddress, + someOtherAddress, governanceAddress, ] balances = await newBalanceWatcher(kit, accounts) @@ -648,9 +569,6 @@ describe('Transfer tests', function (this: any) { } } - it(`should increment the gateway fee recipient's ${feeToken} balance by the gateway fee`, () => - assertEqualBN(balances.delta(gatewayFeeRecipientAddress, feeToken), txRes.fees.gateway)) - it(`should increment the infrastructure fund's ${feeToken} balance by the base portion of the gas fee`, () => assertEqualBN(balances.delta(governanceAddress, feeToken), txRes.fees.base)) @@ -667,73 +585,11 @@ describe('Transfer tests', function (this: any) { describe('Transfer CeloGold >', () => { describe('with feeCurrency = CeloGold >', () => { - if (syncMode === 'light' || syncMode === 'lightest') { - describe('when running in light/lightest sync mode', () => { - const recipient = (choice: string) => { - switch (choice) { - case 'peer': - return gatewayFeeRecipientAddress - case 'random': - return Web3.utils.randomHex(20) - default: - // unset - return undefined - } - } - const feeValue = (choice: string) => { - switch (choice) { - case 'sufficient': - return '0x10000' - case 'insufficient': - return '0x1' - default: - // unset - return undefined - } - } - for (const recipientChoice of ['peer', 'random', 'unset']) { - describe(`when the gateway fee recipient is ${recipientChoice}`, () => { - for (const feeValueChoice of ['sufficient', 'insufficient', 'unset']) { - describe(`when the gateway fee value is ${feeValueChoice}`, () => { - const txOptions = { - gatewayFeeRecipient: recipient(recipientChoice), - gatewayFee: feeValue(feeValueChoice), - } - if (recipientChoice === 'random' || feeValueChoice === 'insufficient') { - it('should get rejected by the sending node before being added to the tx pool', async () => { - try { - const res = await transferCeloGold( - FromAddress, - ToAddress, - TransferAmount, - txOptions - ) - await res.waitReceipt() - assert.fail('no error was thrown') - } catch (error: any) { - assert.include(error.toString(), `Error: no suitable peers available`) - } - }) - } else { - testTransferToken({ - expectedGas: INTRINSIC_TX_GAS_COST, - transferToken: Token.CELO, - feeToken: Token.CELO, - txOptions, - }) - } - }) - } - }) - } - }) - } else { - testTransferToken({ - expectedGas: INTRINSIC_TX_GAS_COST, - transferToken: Token.CELO, - feeToken: Token.CELO, - }) - } + testTransferToken({ + expectedGas: INTRINSIC_TX_GAS_COST, + transferToken: Token.CELO, + feeToken: Token.CELO, + }) }) describe('feeCurrency = CeloDollars >', () => { @@ -851,92 +707,4 @@ describe('Transfer tests', function (this: any) { }) } }) - - describe('Transfer with Demurrage >', () => { - for (const syncMode of syncModes) { - describe(`${syncMode} Node >`, () => { - let inflationManager: InflationManager - before(`start geth on sync: ${syncMode}`, async () => { - await restartWithCleanNodes() - inflationManager = new InflationManager( - 'http://localhost:8545', - validatorAddress, - StableToken.cUSD - ) - await startSyncNode(syncMode) - }) - - describe('when there is demurrage of 50% applied', () => { - describe('when setting a gas amount greater than the amount of gas necessary', () => { - let balances: BalanceWatcher - let expectedFees: Fees - let txRes: TestTxResults - - before(async () => { - balances = await newBalanceWatcher(kit, [ - FromAddress, - ToAddress, - gatewayFeeRecipientAddress, - governanceAddress, - ]) - - await inflationManager.setInflationRateForNextTransfer(new BigNumber(2)) - const feeCurrency = await kit.celoTokens.getFeeCurrencyAddress(StableToken.cUSD) - txRes = await runTestTransaction( - await transferCeloGold(FromAddress, ToAddress, TransferAmount, { - feeCurrency, - }), - INTRINSIC_TX_GAS_COST + ADDITIONAL_INTRINSIC_TX_GAS_COST, - feeCurrency - ) - - await balances.update() - expectedFees = txRes.fees - }) - - it('should succeed', () => assert.isTrue(txRes.ok)) - - it('should use the expected amount of gas', () => - assert.equal(txRes.gas.used, txRes.gas.expected)) - - it("should decrement the sender's Celo Gold balance by the transfer amount", () => { - assertEqualBN(balances.delta(FromAddress, Token.CELO).negated(), TransferAmount) - }) - - it("should increment the receiver's Celo Gold balance by the transfer amount", () => { - assertEqualBN(balances.delta(ToAddress, Token.CELO), TransferAmount) - }) - - it("should halve the sender's Celo Dollar balance due to demurrage and decrement it by the total fees", () => { - assertEqualBN( - balances - .initial(FromAddress, StableToken.cUSD) - .idiv(2) - .minus(balances.current(FromAddress, StableToken.cUSD)), - expectedFees.total - ) - }) - - it("should halve the gateway fee recipient's Celo Dollar balance then increase it by the gateway fee", () => { - assertEqualBN( - balances - .current(gatewayFeeRecipientAddress, StableToken.cUSD) - .minus(balances.initial(gatewayFeeRecipientAddress, StableToken.cUSD).idiv(2)), - expectedFees.gateway - ) - }) - - it("should halve the infrastructure fund's Celo Dollar balance then increment it by the base portion of the gas fees", () => { - assertEqualBN( - balances - .current(governanceAddress, StableToken.cUSD) - .minus(balances.initial(governanceAddress, StableToken.cUSD).idiv(2)), - expectedFees.base - ) - }) - }) - }) - }) - } - }) }) diff --git a/packages/celotool/src/lib/generate_utils.ts b/packages/celotool/src/lib/generate_utils.ts index 312e35b9283..97abef839a9 100644 --- a/packages/celotool/src/lib/generate_utils.ts +++ b/packages/celotool/src/lib/generate_utils.ts @@ -1,4 +1,4 @@ -// @ts-ignore +import { StrongAddress } from '@celo/base' import * as bls12377js from '@celo/bls12377js' import { blsPrivateKeyToProcessedPrivateKey } from '@celo/cryptographic-utils/lib/bls' import BigNumber from 'bignumber.js' @@ -145,8 +145,7 @@ export const privateKeyToPublicKey = (privateKey: string): string => { } export const privateKeyToAddress = (privateKey: string) => { - // @ts-ignore - return new Web3.modules.Eth().accounts.privateKeyToAccount(ensure0x(privateKey)).address + return new Web3().eth.accounts.privateKeyToAccount(ensure0x(privateKey)).address as StrongAddress } export const privateKeyToStrippedAddress = (privateKey: string) => diff --git a/packages/celotool/src/lib/geth.ts b/packages/celotool/src/lib/geth.ts index 8c7da6d364d..cf21f5810c3 100644 --- a/packages/celotool/src/lib/geth.ts +++ b/packages/celotool/src/lib/geth.ts @@ -1,4 +1,5 @@ /* eslint-disable no-console */ +import { StrongAddress } from '@celo/base' import { CeloTxReceipt, TransactionResult } from '@celo/connect' import { CeloContract, ContractKit, newKitFromWeb3 } from '@celo/contractkit' import { GoldTokenWrapper } from '@celo/contractkit/lib/wrappers/GoldTokenWrapper' @@ -452,9 +453,7 @@ export const transferCalldata = async ( chainId?: number gas?: number gasPrice?: string - feeCurrency?: string - gatewayFeeRecipient?: string - gatewayFee?: string + feeCurrency?: StrongAddress nonce?: number } = {} ) => { @@ -466,8 +465,6 @@ export const transferCalldata = async ( data: dataStr, gas: txOptions.gas, gasPrice: txOptions.gasPrice, - gatewayFeeRecipient: txOptions.gatewayFeeRecipient, - gatewayFee: txOptions.gatewayFee, nonce: txOptions.nonce, }) } @@ -484,8 +481,6 @@ export const transferOrdinals = async ( gas?: number gasPrice?: string feeCurrency?: string - gatewayFeeRecipient?: string - gatewayFee?: string nonce?: number } = {} ) => { @@ -514,9 +509,7 @@ export const transferCeloGold = async ( chainId?: number gas?: number gasPrice?: string - feeCurrency?: string - gatewayFeeRecipient?: string - gatewayFee?: string + feeCurrency?: StrongAddress nonce?: number } = {} ) => { @@ -527,8 +520,6 @@ export const transferCeloGold = async ( gas: txOptions.gas, gasPrice: txOptions.gasPrice, feeCurrency: txOptions.feeCurrency || undefined, - gatewayFeeRecipient: txOptions.gatewayFeeRecipient, - gatewayFee: txOptions.gatewayFee, nonce: txOptions.nonce, }) } @@ -543,9 +534,7 @@ export const transferCeloDollars = async ( chainId?: number gas?: number gasPrice?: string - feeCurrency?: string - gatewayFeeRecipient?: string - gatewayFee?: string + feeCurrency?: StrongAddress nonce?: number } = {} ) => { @@ -556,8 +545,6 @@ export const transferCeloDollars = async ( gas: txOptions.gas, gasPrice: txOptions.gasPrice, feeCurrency: txOptions.feeCurrency || undefined, - gatewayFeeRecipient: txOptions.gatewayFeeRecipient, - gatewayFee: txOptions.gatewayFee, nonce: txOptions.nonce, }) } @@ -1238,7 +1225,6 @@ export async function startGeth( isProxied, proxyport, ethstats, - gatewayFee, } = instance const privateKey = instance.privateKey || '' @@ -1309,10 +1295,6 @@ export async function startGeth( instance.args.push(`--nodekeyhex=${privateKey}`) } - if (gatewayFee) { - instance.args.push(`--light.gatewayfee=${gatewayFee.toString()}`) - } - if (validating) { instance.args.push('--mine') diff --git a/packages/celotool/src/lib/interfaces/geth-instance-config.ts b/packages/celotool/src/lib/interfaces/geth-instance-config.ts index bb72e7c13ba..e620f9ad566 100644 --- a/packages/celotool/src/lib/interfaces/geth-instance-config.ts +++ b/packages/celotool/src/lib/interfaces/geth-instance-config.ts @@ -1,5 +1,3 @@ -import BigNumber from 'bignumber.js' - export interface GethInstanceConfig { name: string validating?: boolean @@ -11,7 +9,6 @@ export interface GethInstanceConfig { rpcport?: number wsport?: number lightserv?: boolean - gatewayFee?: BigNumber privateKey?: string minerValidator?: string txFeeRecipient?: string diff --git a/packages/env-tests/src/monorepoRun.ts b/packages/env-tests/src/monorepoRun.ts index 81362a33c64..f0b04337233 100644 --- a/packages/env-tests/src/monorepoRun.ts +++ b/packages/env-tests/src/monorepoRun.ts @@ -17,6 +17,8 @@ function runTests() { if (!process.env.MNEMONIC) { throw new Error('No MNEMONIC was set, envName was parsed as ' + envName) } + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error const kit = newKitFromWeb3(new Web3(process.env.CELO_PROVIDER || 'http://localhost:8545')) const mnemonic: string = process.env.MNEMONIC const reserveSpenderMultiSigAddress = process.env.RESERVE_SPENDER_MULTISIG_ADDRESS diff --git a/packages/env-tests/src/tests/oracle.ts b/packages/env-tests/src/tests/oracle.ts index 6e18bc9cfe1..106d3d7dc3f 100644 --- a/packages/env-tests/src/tests/oracle.ts +++ b/packages/env-tests/src/tests/oracle.ts @@ -1,5 +1,6 @@ +/* eslint-disable import/no-extraneous-dependencies */ +import { StrongAddress } from '@celo/base' import { CeloContract } from '@celo/contractkit' -// eslint-disable-next-line import/no-extraneous-dependencies import { describe, expect, test } from '@jest/globals' import BigNumber from 'bignumber.js' import { EnvTestContext } from '../context' @@ -16,7 +17,7 @@ export function runOracleTest(context: EnvTestContext) { test('report a rate', async () => { const from = await getKey(context.mnemonic, TestAccounts.Oracle) context.kit.connection.addAccount(from.privateKey) - context.kit.defaultAccount = from.address + context.kit.defaultAccount = from.address as StrongAddress const stableToken = await context.kit.contracts.getStableToken() context.kit.defaultFeeCurrency = stableToken.address diff --git a/packages/env-tests/src/tests/reserve.ts b/packages/env-tests/src/tests/reserve.ts index f3a8cafd4d6..e794991e742 100644 --- a/packages/env-tests/src/tests/reserve.ts +++ b/packages/env-tests/src/tests/reserve.ts @@ -36,7 +36,7 @@ export function runReserveTest(context: EnvTestContext) { expect(custodians).toContain(custodian.address) const spenderMultiSig = await context.kit.contracts.getMultiSig(spenderMultiSigAddress) - const isOwner = await spenderMultiSig.isowner(spender.address) + const isOwner = await spenderMultiSig.isOwner(spender.address) expect(isOwner).toBeTruthy() const reserveValue = await reserve.getReserveGoldBalance() diff --git a/packages/metadata-crawler/src/crawler.ts b/packages/metadata-crawler/src/crawler.ts index bc6f8d1d132..e787be988b2 100644 --- a/packages/metadata-crawler/src/crawler.ts +++ b/packages/metadata-crawler/src/crawler.ts @@ -14,12 +14,12 @@ import { dataLogger, logger, operationalLogger } from './logger' const CONCURRENCY = 10 -const PGUSER = process.env['PGUSER'] || 'postgres' -const PGPASSWORD = process.env['PGPASSWORD'] || '' -const PGHOST = process.env['PGHOST'] || '127.0.0.1' -const PGPORT = process.env['PGPORT'] || '5432' -const PGDATABASE = process.env['PGDATABASE'] || 'blockscout' -const PROVIDER_URL = process.env['PROVIDER_URL'] || 'http://localhost:8545' +const PGUSER = process.env.PGUSER || 'postgres' +const PGPASSWORD = process.env.PGPASSWORD || '' +const PGHOST = process.env.PGHOST || '127.0.0.1' +const PGPORT = process.env.PGPORT || '5432' +const PGDATABASE = process.env.PGDATABASE || 'blockscout' +const PROVIDER_URL = process.env.PROVIDER_URL || 'http://localhost:8545' const client = new Client({ user: PGUSER, @@ -28,11 +28,13 @@ const client = new Client({ port: Number(PGPORT), database: PGDATABASE, }) - +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-expect-error const kit = newKitFromWeb3(new Web3(PROVIDER_URL)) async function jsonQuery(query: string) { - let res = await client.query(`SELECT json_agg(t) FROM (${query}) t`) + const res = await client.query(`SELECT json_agg(t) FROM (${query}) t`) + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return res.rows[0].json_agg } @@ -40,7 +42,7 @@ async function createVerificationClaims( address: string, domain: string, verified: boolean, - accounts: Array
+ accounts: Address[] ) { await addDatabaseVerificationClaims(address, domain, verified) await concurrentMap(CONCURRENCY, accounts, (account) => @@ -84,20 +86,20 @@ async function getVerifiedAccounts(metadata: IdentityMetadataWrapper, address: A async function getVerifiedDomains( metadata: IdentityMetadataWrapper, address: Address, - logger: Logger + loggerParam: Logger ) { const unverifiedDomains = metadata.filterClaims(ClaimTypes.DOMAIN) const domainVerification = await concurrentMap(CONCURRENCY, unverifiedDomains, async (claim) => { try { const verificationStatus = await verifyDomainRecord(kit, claim, address) - logger.debug({ claim, verificationStatus }, `verified_domain`) + loggerParam.debug({ claim, verificationStatus }, `verified_domain`) return { claim, verified: verificationStatus === undefined, } } catch (err) { - logger.error({ err, claim }) + loggerParam.error({ err, claim }) return { claim, verified: false, diff --git a/packages/protocol/package.json b/packages/protocol/package.json index 7c260f0e3f9..930827d8681 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -109,11 +109,11 @@ "truffle": "5.9.0", "truffle-security": "^1.7.3", "weak-map": "^1.0.5", - "web3": "1.10.0", - "web3-core": "1.10.0", + "web3": "1.10.4", + "web3-core": "1.10.4", "web3-core-helpers": "1.10.0", "web3-provider-engine": "^16.0.5", - "web3-utils": "1.10.0", + "web3-utils": "1.10.4", "truffle-plugin-verify": "^0.6.5" }, "devDependencies": {