From a8ccc61a29e153d7939f269ebcf4293466ced256 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Tue, 4 Jun 2024 19:45:02 +0800 Subject: [PATCH 01/23] hardhat init --- .env.local.example | 1 + .gitignore | 17 + .nvmrc | 1 + .prettierignore | 7 + .prettierrc | 22 + README.md | 13 + contracts/Assertions/A1.sol | 62 + contracts/Assertions/A20.sol | 61 + contracts/Assertions/A6.sol | 110 + contracts/DynamicAssertion.sol | 328 ++ hardhat.config.ts | 8 + package-lock.json | 7408 ++++++++++++++++++++++++++++++++ package.json | 19 + test/A1.ts | 0 test/A20.ts | 0 test/A6.ts | 0 tsconfig.json | 11 + 17 files changed, 8068 insertions(+) create mode 100644 .env.local.example create mode 100644 .gitignore create mode 100644 .nvmrc create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 README.md create mode 100644 contracts/Assertions/A1.sol create mode 100644 contracts/Assertions/A20.sol create mode 100644 contracts/Assertions/A6.sol create mode 100644 contracts/DynamicAssertion.sol create mode 100644 hardhat.config.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 test/A1.ts create mode 100644 test/A20.ts create mode 100644 test/A6.ts create mode 100644 tsconfig.json diff --git a/.env.local.example b/.env.local.example new file mode 100644 index 0000000..2807c4b --- /dev/null +++ b/.env.local.example @@ -0,0 +1 @@ +PARACHAIN_ENDPOINT=wss://localhost:9944 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e8c12ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +node_modules +.env + +# Hardhat files +/cache +/artifacts + +# TypeChain files +/typechain +/typechain-types + +# solidity-coverage files +/coverage +/coverage.json + +# Hardhat Ignition default folder for deployments against a local node +ignition/deployments/chain-31337 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a77793e --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/hydrogen diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..8187acd --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +artifacts +cache +node_modules +.env +.idea +typechain-types +coverage \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..4b51fe3 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,22 @@ +{ + "plugins": ["prettier-plugin-solidity"], + "trailingComma": "es5", + "tabWidth": 4, + "semi": false, + "singleQuote": false, + "useTabs": true, + "printWidth": 120, + "overrides": [ + { + "files": "*.sol", + "options": { + "parser": "solidity-parse", + "printWidth": 80, + "tabWidth": 4, + "useTabs": true, + "singleQuote": false, + "bracketSpacing": true + } + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..17f8ed1 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Sample Hardhat Project + +This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a Hardhat Ignition module that deploys that contract. + +Try running some of the following tasks: + +```shell +npx hardhat help +npx hardhat test +REPORT_GAS=true npx hardhat test +npx hardhat node +npx hardhat ignition deploy ./ignition/modules/Lock.ts +``` diff --git a/contracts/Assertions/A1.sol b/contracts/Assertions/A1.sol new file mode 100644 index 0000000..5d7d46e --- /dev/null +++ b/contracts/Assertions/A1.sol @@ -0,0 +1,62 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { DynamicAssertion, Identity } from "../DynamicAssertion.sol"; + +contract A1 is DynamicAssertion { + function execute( + Identity[] memory identities, + string[] memory /*secrets*/ + ) + public + override + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ) + { + string + memory description = "You've identified at least one account/address in both Web2 and Web3."; + string memory assertion_type = "Basic Identity Verification"; + assertions.push( + '{"and": [{ "src": "$has_web2_account", "op": "==", "dst": "true" }, { "src": "$has_web3_account", "op": "==", "dst": "true" } ] }' + ); + schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/1-basic-identity-verification/1-0-0.json"; + + bool result; + + bool has_web3_identity = false; + bool has_web2_identity = false; + + for (uint256 i = 0; i < identities.length; i++) { + if (is_web2(identities[i])) { + has_web2_identity = true; + } else if (is_web3(identities[i])) { + has_web3_identity = true; + } + } + result = has_web2_identity && has_web3_identity; + + return (description, assertion_type, assertions, schema_url, result); + } +} diff --git a/contracts/Assertions/A20.sol b/contracts/Assertions/A20.sol new file mode 100644 index 0000000..1934528 --- /dev/null +++ b/contracts/Assertions/A20.sol @@ -0,0 +1,61 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import {DynamicAssertion, Identity, HttpHeader} from "../DynamicAssertion.sol"; + +contract A20 is DynamicAssertion { + function execute(Identity[] memory identities, string[] memory /*secrets*/) + public + override + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ) + { + string + memory description = "The user is an early bird user of the IdentityHub EVM version and has generated at least 1 credential during 2023 Aug 14th ~ Aug 21st."; + string memory assertion_type = "IDHub EVM Version Early Bird"; + assertions.push('{ "src": "$has_joined", "op": "==", "dst": "true" }'); + schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/12-idhub-evm-version-early-bird/1-0-0.json"; + bool result = false; + + for (uint256 i = 0; i < identities.length; i++) { + if (is_web3(identities[i])) { + string memory res = toHex(identities[i].value); + + string memory url = concatenateStrings( + "http://localhost:19527/events/does-user-joined-evm-campaign?account=", + res + ); + string memory jsonPointer = "/hasJoined"; + HttpHeader[] memory headers = new HttpHeader[](0); + + result = GetBool(url, jsonPointer, headers); + if (result) { + break; + } + } + } + return (description, assertion_type, assertions, schema_url, result); + } +} diff --git a/contracts/Assertions/A6.sol b/contracts/Assertions/A6.sol new file mode 100644 index 0000000..1d2e7ec --- /dev/null +++ b/contracts/Assertions/A6.sol @@ -0,0 +1,110 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { DynamicAssertion, Identity, HttpHeader } from "../DynamicAssertion.sol"; +import "@openzeppelin/contracts/utils/Strings.sol"; + +contract A6 is DynamicAssertion { + function execute( + Identity[] memory identities, + string[] memory secrets + ) + public + override + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ) + { + string + memory description = "The range of the user's Twitter follower count"; + string memory assertion_type = "Twitter Follower Amount"; + schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/6-twitter-follower-amount/1-0-0.json"; + + bool result; + + int64 sum = 0; + + for (uint256 i = 0; i < identities.length; i++) { + if (is_twitter(identities[i])) { + string memory url = concatenateStrings( + "http://localhost:19528/2/users/by/username/", + string(identities[i].value) + ); + string memory full_url = concatenateStrings( + url, + "?user.fields=public_metrics" + ); + + HttpHeader[] memory headers = new HttpHeader[](1); + // we expect first secret to be twitter api key + headers[0] = HttpHeader("authorization", secrets[0]); + + int64 followers_count = GetI64( + full_url, + "/data/public_metrics/followers_count", + headers + ); + + sum += followers_count; + } + } + + int64 min = 0; + int64 max = 0; + + if (sum >= 0 && sum <= 1) { + min = 0; + max = 1; + } else if (sum > 1 && sum <= 100) { + min = 1; + max = 100; + } else if (sum > 100 && sum <= 1000) { + min = 100; + max = 1000; + } else if (sum > 1000 && sum <= 10000) { + min = 1000; + max = 10000; + } else if (sum > 10000 && sum <= 100000) { + min = 10000; + max = 100000; + } else if (sum > 100000) { + min = 100000; + max = 9223372036854775807; + } + result = true; + + string memory assertion = concatenateStrings( + '{"and": [{ "src": "$total_followers", "op": ">", "dst": "', + Strings.toString(min) + ); + assertion = concatenateStrings( + assertion, + '" }, { "src": "$has_web3_account", "op": "<=", "dst": "' + ); + assertion = concatenateStrings(assertion, Strings.toString(max)); + assertion = concatenateStrings(assertion, '" } ] }'); + assertions.push(assertion); + return (description, assertion_type, assertions, schema_url, result); + } +} diff --git a/contracts/DynamicAssertion.sol b/contracts/DynamicAssertion.sol new file mode 100644 index 0000000..086a215 --- /dev/null +++ b/contracts/DynamicAssertion.sol @@ -0,0 +1,328 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +struct Identity { + uint32 identity_type; + bytes value; + uint32[] networks; +} + +struct HttpHeader { + string name; + string value; +} + +abstract contract DynamicAssertion { + string[] assertions; + string schema_url; + + function execute( + Identity[] memory identities, + string[] memory secrets + ) + public + virtual + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ); + + function encode_params( + string memory url, + string memory jsonPointer + ) internal pure returns (bytes memory) { + return abi.encode(url, jsonPointer); + } + + function GetI64( + string memory url, + string memory jsonPointer, + HttpHeader[] memory headers + ) internal returns (int64) { + int64 value; + + bytes memory encoded_params = abi.encode(url, jsonPointer, headers); + uint256 encoded_params_len = encoded_params.length; + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03E8, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x20 + ) + ) { + revert(0, 0) + } + value := mload(memPtr) + } + + return (value); + } + + function GetBool( + string memory url, + string memory jsonPointer, + HttpHeader[] memory headers + ) internal returns (bool) { + bool value; + + bytes memory encoded_params = abi.encode(url, jsonPointer, headers); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03E9, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x20 + ) + ) { + revert(0, 0) + } + value := mload(memPtr) + } + + return (value); + } + + function concatenateStrings( + string memory a, + string memory b + ) internal pure returns (string memory) { + bytes memory concatenatedBytes = abi.encodePacked(a, b); + return string(concatenatedBytes); + } + + function toHex( + bytes memory bytes_value + ) internal returns (string memory returnVal) { + bytes memory encoded = abi.encode(bytes_value); + uint256 encoded_len = encoded.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041B, + 0, + add(encoded, 0x20), + encoded_len, + returnVal, + 0x82 + ) + ) { + revert(0, 0) + } + } + } + + function from( + uint32 identity_type, + bytes memory value, + uint32[] memory networks + ) internal pure returns (Identity memory) { + return (Identity(identity_type, value, networks)); + } + + function is_web3( + Identity memory identity_type + ) internal pure returns (bool) { + return (is_substrate(identity_type) || + is_evm(identity_type) || + is_bitcoin(identity_type)); + } + + function is_web2( + Identity memory identity_type + ) internal pure returns (bool) { + return (is_twitter(identity_type) || + is_discord(identity_type) || + is_github(identity_type)); + } + + function is_twitter(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, 0); + } + + function is_discord(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, 1); + } + + function is_github(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, 2); + } + + function is_substrate( + Identity memory identity + ) internal pure returns (bool) { + return is_of_type(identity, 3); + } + + function is_evm(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, 4); + } + + function is_bitcoin(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, 5); + } + + function is_solana(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, 6); + } + + function is_of_type( + Identity memory identity, + uint32 identity_type + ) internal pure returns (bool) { + if (identity.identity_type == identity_type) { + return (true); + } else { + return (false); + } + } + + function has_polkadot_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 0); + } + + function has_kusama_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 1); + } + + function has_litentry_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 2); + } + + function has_litmus_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 3); + } + + function has_litentry_rococo_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 4); + } + + function has_khala_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 5); + } + + function has_substrate_testnet_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 6); + } + + function has_ethereum_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 7); + } + + function has_bsc_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 8); + } + + function has_bitcoin_p2tr_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 9); + } + + function has_bitcoin_p2pkh_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 10); + } + + function has_bitcoin_p2sh_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 11); + } + + function has_bitcoin_p2wpkh_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 12); + } + + function has_bitcoin_p2wsh_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 13); + } + + function has_polygon_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 14); + } + + function has_arbitrum_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 15); + } + + function has_solana_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, 16); + } + + function has_network( + Identity memory identity_type, + uint32 network + ) internal pure returns (bool) { + for (uint256 i = 0; i < identity_type.networks.length; i++) { + if (identity_type.networks[i] == network) { + return (true); + } + } + return (false); + } +} diff --git a/hardhat.config.ts b/hardhat.config.ts new file mode 100644 index 0000000..e289017 --- /dev/null +++ b/hardhat.config.ts @@ -0,0 +1,8 @@ +import { HardhatUserConfig } from "hardhat/config" +import "@nomicfoundation/hardhat-toolbox" + +const config: HardhatUserConfig = { + solidity: "0.8.8", +} + +export default config diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..1e7f041 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,7408 @@ +{ + "name": "@litentry/contracts", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@litentry/contracts", + "license": "MIT", + "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^5.0.0", + "@openzeppelin/contracts": "^4.9.0", + "hardhat": "^2.22.5", + "prettier-plugin-solidity": "^1.3.1" + } + }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "dev": true, + "peer": true + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ethereumjs/rlp": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", + "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", + "dev": true, + "peer": true, + "bin": { + "rlp": "bin/rlp" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@ethereumjs/util": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", + "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", + "dev": true, + "peer": true, + "dependencies": { + "@ethereumjs/rlp": "^4.0.1", + "ethereum-cryptography": "^2.0.0", + "micro-ftch": "^0.3.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@ethereumjs/util/node_modules/@noble/curves": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.3.0.tgz", + "integrity": "sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/hashes": "1.3.3" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz", + "integrity": "sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/curves": "1.3.0", + "@noble/hashes": "1.3.3", + "@scure/bip32": "1.3.3", + "@scure/bip39": "1.2.2" + } + }, + "node_modules/@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "node_modules/@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "node_modules/@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "node_modules/@ethersproject/json-wallets/node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "dev": true, + "peer": true + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@ethersproject/providers/node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "node_modules/@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true, + "peer": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@metamask/eth-sig-util": { + "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", + "ethereumjs-util": "^6.2.1", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@metamask/eth-sig-util/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==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/@metamask/eth-sig-util/node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/secp256k1": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", + "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", + "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", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "peer": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nomicfoundation/edr": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.4.0.tgz", + "integrity": "sha512-T96DMSogO8TCdbKKctvxfsDljbhFOUKWc9fHJhSeUh71EEho2qR4951LKQF7t7UWEzguVYh/idQr5L/E3QeaMw==", + "dev": true, + "dependencies": { + "@nomicfoundation/edr-darwin-arm64": "0.4.0", + "@nomicfoundation/edr-darwin-x64": "0.4.0", + "@nomicfoundation/edr-linux-arm64-gnu": "0.4.0", + "@nomicfoundation/edr-linux-arm64-musl": "0.4.0", + "@nomicfoundation/edr-linux-x64-gnu": "0.4.0", + "@nomicfoundation/edr-linux-x64-musl": "0.4.0", + "@nomicfoundation/edr-win32-x64-msvc": "0.4.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-darwin-arm64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.4.0.tgz", + "integrity": "sha512-7+rraFk9tCqvfemv9Ita5vTlSBAeO/S5aDKOgGRgYt0JEKZlrX161nDW6UfzMPxWl9GOLEDUzCEaYuNmXseUlg==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-darwin-x64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.4.0.tgz", + "integrity": "sha512-+Hrc0mP9L6vhICJSfyGo/2taOToy1AIzVZawO3lU8Lf7oDQXfhQ4UkZnkWAs9SVu1eUwHUGGGE0qB8644piYgg==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-arm64-gnu": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.4.0.tgz", + "integrity": "sha512-4HUDMchNClQrVRfVTqBeSX92hM/3khCgpZkXP52qrnJPqgbdCxosOehlQYZ65wu0b/kaaZSyvACgvCLSQ5oSzQ==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-arm64-musl": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.4.0.tgz", + "integrity": "sha512-D4J935ZRL8xfnP3zIFlCI9jXInJ0loDUkCTLeCEbOf2uuDumWDghKNQlF1itUS+EHaR1pFVBbuwqq8hVK0dASg==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-x64-gnu": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.4.0.tgz", + "integrity": "sha512-6x7HPy+uN5Cb9N77e2XMmT6+QSJ+7mRbHnhkGJ8jm4cZvWuj2Io7npOaeHQ3YHK+TiQpTnlbkjoOIpEwpY3XZA==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-x64-musl": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.4.0.tgz", + "integrity": "sha512-3HFIJSXgyubOiaN4MWGXx2xhTnhwlJk0PiSYNf9+L/fjBtcRkb2nM910ZJHTvqCb6OT98cUnaKuAYdXIW2amgw==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-win32-x64-msvc": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.4.0.tgz", + "integrity": "sha512-CP4GsllEfXEz+lidcGYxKe5rDJ60TM5/blB5z/04ELVvw6/CK9eLcYeku7HV0jvV7VE6dADYKSdQyUkvd0El+A==", + "dev": true, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/ethereumjs-common": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz", + "integrity": "sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg==", + "dev": true, + "dependencies": { + "@nomicfoundation/ethereumjs-util": "9.0.4" + } + }, + "node_modules/@nomicfoundation/ethereumjs-rlp": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz", + "integrity": "sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw==", + "dev": true, + "bin": { + "rlp": "bin/rlp.cjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@nomicfoundation/ethereumjs-tx": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz", + "integrity": "sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw==", + "dev": true, + "dependencies": { + "@nomicfoundation/ethereumjs-common": "4.0.4", + "@nomicfoundation/ethereumjs-rlp": "5.0.4", + "@nomicfoundation/ethereumjs-util": "9.0.4", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "c-kzg": "^2.1.2" + }, + "peerDependenciesMeta": { + "c-kzg": { + "optional": true + } + } + }, + "node_modules/@nomicfoundation/ethereumjs-util": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz", + "integrity": "sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q==", + "dev": true, + "dependencies": { + "@nomicfoundation/ethereumjs-rlp": "5.0.4", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "c-kzg": "^2.1.2" + }, + "peerDependenciesMeta": { + "c-kzg": { + "optional": true + } + } + }, + "node_modules/@nomicfoundation/hardhat-chai-matchers": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.7.tgz", + "integrity": "sha512-RQfsiTwdf0SP+DtuNYvm4921X6VirCQq0Xyh+mnuGlTwEFSPZ/o27oQC+l+3Y/l48DDU7+ZcYBR+Fp+Rp94LfQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/chai-as-promised": "^7.1.3", + "chai-as-promised": "^7.1.1", + "deep-eql": "^4.0.1", + "ordinal": "^1.0.3" + }, + "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.0", + "chai": "^4.2.0", + "ethers": "^6.1.0", + "hardhat": "^2.9.4" + } + }, + "node_modules/@nomicfoundation/hardhat-ethers": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.6.tgz", + "integrity": "sha512-/xzkFQAaHQhmIAYOQmvHBPwL+NkwLzT9gRZBsgWUYeV+E6pzXsBQsHfRYbAZ3XEYare+T7S+5Tg/1KDJgepSkA==", + "dev": true, + "peer": true, + "dependencies": { + "debug": "^4.1.1", + "lodash.isequal": "^4.5.0" + }, + "peerDependencies": { + "ethers": "^6.1.0", + "hardhat": "^2.0.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition": { + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.4.tgz", + "integrity": "sha512-x1lhLN9ZRSJ9eiNY9AoinMdeQeU4LDQSQOIw90W9DiZIG/g9YUzcTEIY58QTi2TZOF8YFiF6vJqLSePCpi8R1Q==", + "dev": true, + "peer": true, + "dependencies": { + "@nomicfoundation/ignition-core": "^0.15.4", + "@nomicfoundation/ignition-ui": "^0.15.4", + "chalk": "^4.0.0", + "debug": "^4.3.2", + "fs-extra": "^10.0.0", + "prompts": "^2.4.2" + }, + "peerDependencies": { + "@nomicfoundation/hardhat-verify": "^2.0.1", + "hardhat": "^2.18.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition-ethers": { + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.4.tgz", + "integrity": "sha512-vY30V4b788GSziW/nOd0L/4IPw6mwpluahLs4+gPUUKWaHHGMA8OIeHaYpRRljM1i0M/Kg1yIozrDM/aeRebkg==", + "dev": true, + "peer": true, + "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.4", + "@nomicfoundation/hardhat-ignition": "^0.15.4", + "@nomicfoundation/ignition-core": "^0.15.4", + "ethers": "^6.7.0", + "hardhat": "^2.18.0" + } + }, + "node_modules/@nomicfoundation/hardhat-network-helpers": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.11.tgz", + "integrity": "sha512-uGPL7QSKvxrHRU69dx8jzoBvuztlLCtyFsbgfXIwIjnO3dqZRz2GNMHJoO3C3dIiUNM6jdNF4AUnoQKDscdYrA==", + "dev": true, + "peer": true, + "dependencies": { + "ethereumjs-util": "^7.1.4" + }, + "peerDependencies": { + "hardhat": "^2.9.5" + } + }, + "node_modules/@nomicfoundation/hardhat-toolbox": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-5.0.0.tgz", + "integrity": "sha512-FnUtUC5PsakCbwiVNsqlXVIWG5JIb5CEZoSXbJUsEBun22Bivx2jhF1/q9iQbzuaGpJKFQyOhemPB2+XlEE6pQ==", + "dev": true, + "peerDependencies": { + "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", + "@nomicfoundation/hardhat-ethers": "^3.0.0", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.0", + "@nomicfoundation/hardhat-network-helpers": "^1.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.0", + "@typechain/ethers-v6": "^0.5.0", + "@typechain/hardhat": "^9.0.0", + "@types/chai": "^4.2.0", + "@types/mocha": ">=9.1.0", + "@types/node": ">=18.0.0", + "chai": "^4.2.0", + "ethers": "^6.4.0", + "hardhat": "^2.11.0", + "hardhat-gas-reporter": "^1.0.8", + "solidity-coverage": "^0.8.1", + "ts-node": ">=8.0.0", + "typechain": "^8.3.0", + "typescript": ">=4.5.0" + } + }, + "node_modules/@nomicfoundation/hardhat-verify": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.8.tgz", + "integrity": "sha512-x/OYya7A2Kcz+3W/J78dyDHxr0ezU23DKTrRKfy5wDPCnePqnr79vm8EXqX3gYps6IjPBYyGPZ9K6E5BnrWx5Q==", + "dev": true, + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@ethersproject/address": "^5.0.2", + "cbor": "^8.1.0", + "chalk": "^2.4.2", + "debug": "^4.1.1", + "lodash.clonedeep": "^4.5.0", + "semver": "^6.3.0", + "table": "^6.8.0", + "undici": "^5.14.0" + }, + "peerDependencies": { + "hardhat": "^2.0.4" + } + }, + "node_modules/@nomicfoundation/hardhat-verify/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, + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@nomicfoundation/hardhat-verify/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, + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@nomicfoundation/hardhat-verify/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, + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@nomicfoundation/hardhat-verify/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "peer": true + }, + "node_modules/@nomicfoundation/hardhat-verify/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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@nomicfoundation/hardhat-verify/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@nomicfoundation/hardhat-verify/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, + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@nomicfoundation/ignition-core": { + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-core/-/ignition-core-0.15.4.tgz", + "integrity": "sha512-i379lH+xOLFdaDv0KiNma550ZXCHc5ZkmKYhM44xyLMKBlvX6skUVFkgUjjN1gvprgOIxc17GVQXlR1R5FhGZA==", + "dev": true, + "peer": true, + "dependencies": { + "@ethersproject/address": "5.6.1", + "@nomicfoundation/solidity-analyzer": "^0.1.1", + "cbor": "^9.0.0", + "debug": "^4.3.2", + "ethers": "^6.7.0", + "fs-extra": "^10.0.0", + "immer": "10.0.2", + "lodash": "4.17.21", + "ndjson": "2.0.0" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/@ethersproject/address": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", + "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.1" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/cbor": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-9.0.2.tgz", + "integrity": "sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==", + "dev": true, + "peer": true, + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@nomicfoundation/ignition-ui": { + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.4.tgz", + "integrity": "sha512-cHbmuxmhso5n2zdIaaIW4p8NNzrFj0mrnv8ufhAZfM3s3IFrRoGc1zo8hI/n1CiOTPuqUbdZcB79d+2tCKtCNw==", + "dev": true, + "peer": true + }, + "node_modules/@nomicfoundation/solidity-analyzer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz", + "integrity": "sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==", + "dev": true, + "engines": { + "node": ">= 12" + }, + "optionalDependencies": { + "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.1", + "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.1", + "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.1" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-darwin-arm64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz", + "integrity": "sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-darwin-x64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz", + "integrity": "sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-freebsd-x64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz", + "integrity": "sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz", + "integrity": "sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-musl": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz", + "integrity": "sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-gnu": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz", + "integrity": "sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-musl": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz", + "integrity": "sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-win32-arm64-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz", + "integrity": "sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-win32-ia32-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz", + "integrity": "sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-win32-x64-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz", + "integrity": "sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@openzeppelin/contracts": { + "version": "4.9.6", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.6.tgz", + "integrity": "sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==", + "dev": true + }, + "node_modules/@scure/base": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.6.tgz", + "integrity": "sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==", + "dev": true, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.3.tgz", + "integrity": "sha512-LJaN3HwRbfQK0X1xFSi0Q9amqOgzQnnDngIt+ZlsBC3Bm7/nE7K0kwshZHyaru79yIVRv/e1mQAjZyuZG6jOFQ==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/curves": "~1.3.0", + "@noble/hashes": "~1.3.2", + "@scure/base": "~1.1.4" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32/node_modules/@noble/curves": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.3.0.tgz", + "integrity": "sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/hashes": "1.3.3" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.2.tgz", + "integrity": "sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/hashes": "~1.3.2", + "@scure/base": "~1.1.4" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@sentry/core": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", + "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "dev": true, + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/core/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/hub": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", + "dev": true, + "dependencies": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/hub/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/minimal": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", + "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", + "dev": true, + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/minimal/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/node": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", + "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", + "dev": true, + "dependencies": { + "@sentry/core": "5.30.0", + "@sentry/hub": "5.30.0", + "@sentry/tracing": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/node/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/tracing": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", + "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", + "dev": true, + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/tracing/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "dev": true, + "dependencies": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/utils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@solidity-parser/parser": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.5.tgz", + "integrity": "sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==", + "dev": true, + "peer": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "peer": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "peer": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "peer": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "peer": true + }, + "node_modules/@typechain/ethers-v6": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@typechain/ethers-v6/-/ethers-v6-0.5.1.tgz", + "integrity": "sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA==", + "dev": true, + "peer": true, + "dependencies": { + "lodash": "^4.17.15", + "ts-essentials": "^7.0.1" + }, + "peerDependencies": { + "ethers": "6.x", + "typechain": "^8.3.2", + "typescript": ">=4.7.0" + } + }, + "node_modules/@typechain/hardhat": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@typechain/hardhat/-/hardhat-9.1.0.tgz", + "integrity": "sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA==", + "dev": true, + "peer": true, + "dependencies": { + "fs-extra": "^9.1.0" + }, + "peerDependencies": { + "@typechain/ethers-v6": "^0.5.1", + "ethers": "^6.1.0", + "hardhat": "^2.9.9", + "typechain": "^8.3.2" + } + }, + "node_modules/@typechain/hardhat/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "peer": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@types/bn.js": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.5.tgz", + "integrity": "sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/chai": { + "version": "4.3.16", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.16.tgz", + "integrity": "sha512-PatH4iOdyh3MyWtmHVFXLWCCIhUbopaltqddG9BzB+gMIzee2MJrvd+jouii9Z3wzQJruGWAm7WOMjgfG8hQlQ==", + "dev": true, + "peer": true + }, + "node_modules/@types/chai-as-promised": { + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz", + "integrity": "sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==", + "dev": true, + "peer": true, + "dependencies": { + "@types/chai": "*" + } + }, + "node_modules/@types/concat-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", + "dev": true + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true, + "peer": true + }, + "node_modules/@types/mocha": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", + "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", + "dev": true, + "peer": true + }, + "node_modules/@types/node": { + "version": "20.14.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.1.tgz", + "integrity": "sha512-T2MzSGEu+ysB/FkWfqmhV3PLyQlowdptmmgD20C6QxsS8Fmv5SjpZ1ayXaEC0S21/h5UJ9iA6W/5vSNU5l00OA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/prettier": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", + "dev": true, + "peer": true + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true, + "peer": true + }, + "node_modules/@types/secp256k1": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", + "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==", + "dev": true, + "peer": true + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true, + "engines": { + "node": ">=0.3.0" + } + }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "dev": true, + "peer": true + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "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/ajv": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.15.0.tgz", + "integrity": "sha512-15BTtQUOsSrmHCy+B4VnAiJAJxJ8IFgu6fcjFQF3jQYZ78nLSQthlFg4ehp+NLIyfvFgOlxNsjKIEhydtFPVHQ==", + "dev": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^2.3.0", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.4.2" + } + }, + "node_modules/ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "dev": true, + "dependencies": { + "string-width": "^4.1.0" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/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/antlr4ts": { + "version": "0.5.0-alpha.4", + "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz", + "integrity": "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==", + "dev": true, + "peer": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "peer": true + }, + "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/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "peer": true + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "peer": true, + "engines": { + "node": "*" + } + }, + "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, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", + "dev": true, + "peer": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "peer": true + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/axios": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "dev": true, + "peer": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true, + "peer": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/blakejs": { + "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/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, + "node_modules/boxen": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", + "dev": true, + "dependencies": { + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/boxen/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "dev": true, + "peer": true + }, + "node_modules/cbor": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", + "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", + "dev": true, + "peer": true, + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=12.19" + } + }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "peer": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chai-as-promised": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", + "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", + "dev": true, + "peer": true, + "dependencies": { + "check-error": "^1.0.2" + }, + "peerDependencies": { + "chai": ">= 2.1.2 < 6" + } + }, + "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/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true, + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "peer": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "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/cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-table3": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", + "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", + "dev": true, + "peer": true, + "dependencies": { + "object-assign": "^4.1.0", + "string-width": "^2.1.1" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "colors": "^1.1.2" + } + }, + "node_modules/cli-table3/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "peer": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "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/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/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "peer": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dev": true, + "peer": true, + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-usage": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "dev": true, + "peer": true, + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/command-line-usage/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, + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/command-line-usage/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, + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/command-line-usage/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, + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/command-line-usage/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "peer": true + }, + "node_modules/command-line-usage/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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/command-line-usage/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/command-line-usage/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, + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/command-line-usage/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "peer": true + }, + "node_modules/concat-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "peer": true + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "peer": true + }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true, + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/death": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", + "integrity": "sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==", + "dev": true, + "peer": true + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "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/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "peer": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "peer": true + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "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/difflib": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", + "integrity": "sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==", + "dev": true, + "peer": true, + "dependencies": { + "heap": ">= 0.2.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "peer": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "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/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "peer": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "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/escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==", + "dev": true, + "peer": true, + "dependencies": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=0.12.0" + }, + "optionalDependencies": { + "source-map": "~0.2.0" + } + }, + "node_modules/esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", + "dev": true, + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eth-gas-reporter": { + "version": "0.2.27", + "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.27.tgz", + "integrity": "sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw==", + "dev": true, + "peer": true, + "dependencies": { + "@solidity-parser/parser": "^0.14.0", + "axios": "^1.5.1", + "cli-table3": "^0.5.0", + "colors": "1.4.0", + "ethereum-cryptography": "^1.0.3", + "ethers": "^5.7.2", + "fs-readdir-recursive": "^1.1.0", + "lodash": "^4.17.14", + "markdown-table": "^1.1.3", + "mocha": "^10.2.0", + "req-cwd": "^2.0.0", + "sha1": "^1.1.1", + "sync-request": "^6.0.0" + }, + "peerDependencies": { + "@codechecks/client": "^0.1.0" + }, + "peerDependenciesMeta": { + "@codechecks/client": { + "optional": true + } + } + }, + "node_modules/eth-gas-reporter/node_modules/@noble/hashes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", + "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true + }, + "node_modules/eth-gas-reporter/node_modules/@scure/bip32": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", + "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true, + "dependencies": { + "@noble/hashes": "~1.2.0", + "@noble/secp256k1": "~1.7.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/@scure/bip39": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", + "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true, + "dependencies": { + "@noble/hashes": "~1.2.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/ethereum-cryptography": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", + "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/hashes": "1.2.0", + "@noble/secp256k1": "1.7.1", + "@scure/bip32": "1.1.5", + "@scure/bip39": "1.1.1" + } + }, + "node_modules/eth-gas-reporter/node_modules/ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "node_modules/ethereum-bloom-filters": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.1.0.tgz", + "integrity": "sha512-J1gDRkLpuGNvWYzWslBQR9cDV4nd4kfvVTE/Wy4Kkm4yb3EYRSlyi0eB/inTsSTTVyA0+HyzHgbr95Fn/Z1fSw==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/hashes": "^1.4.0" + } + }, + "node_modules/ethereum-bloom-filters/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + } + }, + "node_modules/ethereumjs-abi/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==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ethereumjs-abi/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/ethereumjs-abi/node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "node_modules/ethereumjs-util": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/ethers": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.0.tgz", + "integrity": "sha512-+yyQQQWEntY5UVbCv++guA14RRVFm1rSnO1GoLFdrK7/XRWMoktNgyG9UjwxrQqGBfGyFKknNZ81YpUS2emCgg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "18.15.13", + "aes-js": "4.0.0-beta.5", + "tslib": "2.4.0", + "ws": "8.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@types/node": { + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==", + "dev": true, + "peer": true + }, + "node_modules/ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==", + "dev": true, + "peer": true, + "dependencies": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/ethjs-unit/node_modules/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", + "dev": true, + "peer": true + }, + "node_modules/ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "peer": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "peer": true + }, + "node_modules/fast-uri": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.3.0.tgz", + "integrity": "sha512-eel5UKGn369gGEWOqBShmFJWfq/xSJvsgDzgLYC845GneayWvXBf0lJCBn5qTABfewy1ZDPoaR5OZCP+kssfuw==", + "dev": true, + "peer": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "peer": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dev": true, + "peer": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "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/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "peer": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fp-ts": { + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", + "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", + "dev": true + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true, + "peer": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ghost-testrpc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", + "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", + "dev": true, + "peer": true, + "dependencies": { + "chalk": "^2.4.2", + "node-emoji": "^1.10.0" + }, + "bin": { + "testrpc-sc": "index.js" + } + }, + "node_modules/ghost-testrpc/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, + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ghost-testrpc/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, + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ghost-testrpc/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, + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/ghost-testrpc/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "peer": 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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": 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", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ghost-testrpc/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, + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "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": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "peer": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "peer": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "peer": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "peer": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/handlebars/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hardhat": { + "version": "2.22.5", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.22.5.tgz", + "integrity": "sha512-9Zq+HonbXCSy6/a13GY1cgHglQRfh4qkzmj1tpPlhxJDwNVnhxlReV6K7hCWFKlOrV13EQwsdcD0rjcaQKWRZw==", + "dev": true, + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", + "@nomicfoundation/edr": "^0.4.0", + "@nomicfoundation/ethereumjs-common": "4.0.4", + "@nomicfoundation/ethereumjs-tx": "5.0.4", + "@nomicfoundation/ethereumjs-util": "9.0.4", + "@nomicfoundation/solidity-analyzer": "^0.1.0", + "@sentry/node": "^5.18.1", + "@types/bn.js": "^5.1.0", + "@types/lru-cache": "^5.1.0", + "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", + "ansi-escapes": "^4.3.0", + "boxen": "^5.1.2", + "chalk": "^2.4.2", + "chokidar": "^3.4.0", + "ci-info": "^2.0.0", + "debug": "^4.1.1", + "enquirer": "^2.3.0", + "env-paths": "^2.2.0", + "ethereum-cryptography": "^1.0.3", + "ethereumjs-abi": "^0.6.8", + "find-up": "^2.1.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "glob": "7.2.0", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "keccak": "^3.0.2", + "lodash": "^4.17.11", + "mnemonist": "^0.38.0", + "mocha": "^10.0.0", + "p-map": "^4.0.0", + "raw-body": "^2.4.1", + "resolve": "1.17.0", + "semver": "^6.3.0", + "solc": "0.7.3", + "source-map-support": "^0.5.13", + "stacktrace-parser": "^0.1.10", + "tsort": "0.0.1", + "undici": "^5.14.0", + "uuid": "^8.3.2", + "ws": "^7.4.6" + }, + "bin": { + "hardhat": "internal/cli/bootstrap.js" + }, + "peerDependencies": { + "ts-node": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/hardhat-gas-reporter": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.10.tgz", + "integrity": "sha512-02N4+So/fZrzJ88ci54GqwVA3Zrf0C9duuTyGt0CFRIh/CdNwbnTgkXkRfojOMLBQ+6t+lBIkgbsOtqMvNwikA==", + "dev": true, + "peer": true, + "dependencies": { + "array-uniq": "1.0.3", + "eth-gas-reporter": "^0.2.25", + "sha1": "^1.1.1" + }, + "peerDependencies": { + "hardhat": "^2.0.2" + } + }, + "node_modules/hardhat/node_modules/@noble/hashes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", + "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/hardhat/node_modules/@scure/bip32": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", + "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.2.0", + "@noble/secp256k1": "~1.7.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/hardhat/node_modules/@scure/bip39": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", + "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.2.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/hardhat/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/hardhat/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/hardhat/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/hardhat/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/hardhat/node_modules/ethereum-cryptography": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", + "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.2.0", + "@noble/secp256k1": "1.7.1", + "@scure/bip32": "1.1.5", + "@scure/bip39": "1.1.1" + } + }, + "node_modules/hardhat/node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/hardhat/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/hardhat/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/hardhat/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/hardhat/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/hardhat/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "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/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "peer": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/heap": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", + "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==", + "dev": true, + "peer": true + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/http-basic": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", + "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", + "dev": true, + "peer": true, + "dependencies": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/http-errors": { + "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": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "^10.0.3" + } + }, + "node_modules/http-response-object/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", + "dev": true, + "peer": true + }, + "node_modules/https-proxy-agent": { + "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", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/immer": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/immer/-/immer-10.0.2.tgz", + "integrity": "sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==", + "dev": true, + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "node_modules/immutable": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.6.tgz", + "integrity": "sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ==", + "dev": true + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "peer": true + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/io-ts": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz", + "integrity": "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==", + "dev": true, + "dependencies": { + "fp-ts": "^1.0.0" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "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/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "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/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/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "peer": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "peer": true + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "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/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, + "peer": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "peer": true + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonschema": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", + "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", + "dev": true, + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/keccak": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", + "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.9" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true, + "peer": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true, + "peer": true + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true, + "peer": true + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true, + "peer": true + }, + "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/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "peer": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", + "dev": true + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "peer": true + }, + "node_modules/markdown-table": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", + "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==", + "dev": true, + "peer": true + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micro-ftch": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", + "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==", + "dev": true, + "peer": true + }, + "node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "peer": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "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, + "peer": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "peer": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mnemonist": { + "version": "0.38.5", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", + "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", + "dev": true, + "dependencies": { + "obliterator": "^2.0.0" + } + }, + "node_modules/mocha": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", + "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", + "dev": true, + "dependencies": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "8.1.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/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/mocha/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/mocha/node_modules/debug": { + "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" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "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/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/mocha/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "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/mocha/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/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/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/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/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/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/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/ndjson": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ndjson/-/ndjson-2.0.0.tgz", + "integrity": "sha512-nGl7LRGrzugTtaFcJMhLbpzJM6XdivmbkdlaGcrk/LXg2KL/YBC6z1g70xh0/al+oFuVFP8N8kiWRucmeEH/qQ==", + "dev": true, + "peer": true, + "dependencies": { + "json-stringify-safe": "^5.0.1", + "minimist": "^1.2.5", + "readable-stream": "^3.6.0", + "split2": "^3.0.0", + "through2": "^4.0.0" + }, + "bin": { + "ndjson": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "peer": true + }, + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true + }, + "node_modules/node-emoji": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", + "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", + "dev": true, + "peer": true, + "dependencies": { + "lodash": "^4.17.21" + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", + "dev": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/nofilter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", + "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12.19" + } + }, + "node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", + "dev": true, + "peer": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/number-to-bn": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", + "integrity": "sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==", + "dev": true, + "peer": true, + "dependencies": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/number-to-bn/node_modules/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", + "dev": true, + "peer": true + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/obliterator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", + "dev": true + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "peer": 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/ordinal": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ordinal/-/ordinal-1.0.3.tgz", + "integrity": "sha512-cMddMgb2QElm8G7vdaa02jhUNbTSrhsgAGUz1OokD83uJTwSUn+nKoNoKVVaRa08yF6sgfO7Maou1+bgLd9rdQ==", + "dev": true, + "peer": true + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "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-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==", + "dev": true, + "peer": true + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "peer": 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": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.3.1.tgz", + "integrity": "sha512-MN4OP5I2gHAzHZG1wcuJl0FsLS3c4Cc5494bbg+6oQWBPuEamjwDvmGfFMZ6NFzsh3Efd9UUxeT7ImgjNH4ozA==", + "dev": true, + "dependencies": { + "@solidity-parser/parser": "^0.17.0", + "semver": "^7.5.4", + "solidity-comments-extractor": "^0.0.8" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "prettier": ">=2.3.0" + } + }, + "node_modules/prettier-plugin-solidity/node_modules/@solidity-parser/parser": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.17.0.tgz", + "integrity": "sha512-Nko8R0/kUo391jsEHHxrGM07QFdnPGvlmox4rmH0kNiNAashItAilhy4Mv4pK5gQmW5f4sXAF58fwJbmlkGcVw==", + "dev": true + }, + "node_modules/prettier-plugin-solidity/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "peer": true + }, + "node_modules/promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "dev": true, + "peer": true, + "dependencies": { + "asap": "~2.0.6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "peer": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "peer": true + }, + "node_modules/qs": { + "version": "6.12.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz", + "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", + "dev": true, + "peer": true, + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "peer": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/recursive-readdir": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", + "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", + "dev": true, + "peer": true, + "dependencies": { + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/req-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", + "integrity": "sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ==", + "dev": true, + "peer": true, + "dependencies": { + "req-from": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/req-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", + "integrity": "sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA==", + "dev": true, + "peer": true, + "dependencies": { + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "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/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "peer": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rlp": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", + "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.0" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/sc-istanbul": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.6.tgz", + "integrity": "sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g==", + "dev": true, + "peer": true, + "dependencies": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "istanbul": "lib/cli.js" + } + }, + "node_modules/sc-istanbul/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/sc-istanbul/node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "peer": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/sc-istanbul/node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sc-istanbul/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/sc-istanbul/node_modules/js-yaml/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/sc-istanbul/node_modules/resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", + "dev": true, + "peer": true + }, + "node_modules/sc-istanbul/node_modules/supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^1.0.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true + }, + "node_modules/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "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/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "peer": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==", + "dev": true, + "peer": true, + "dependencies": { + "charenc": ">= 0.0.1", + "crypt": ">= 0.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "peer": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "peer": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "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, + "peer": 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/solc": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", + "integrity": "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==", + "dev": true, + "dependencies": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "follow-redirects": "^1.12.1", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "bin": { + "solcjs": "solcjs" + }, + "engines": { + "node": ">=8.0.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", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "node_modules/solc/node_modules/jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/solc/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/solidity-comments-extractor": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.8.tgz", + "integrity": "sha512-htM7Vn6LhHreR+EglVMd2s+sZhcXAirB1Zlyrv5zBuTxieCvjfnRpd7iZk75m/u6NOlEyQ94C6TWbBn2cY7w8g==", + "dev": true + }, + "node_modules/solidity-coverage": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.12.tgz", + "integrity": "sha512-8cOB1PtjnjFRqOgwFiD8DaUsYJtVJ6+YdXQtSZDrLGf8cdhhh8xzTtGzVTGeBf15kTv0v7lYPJlV/az7zLEPJw==", + "dev": true, + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.0.9", + "@solidity-parser/parser": "^0.18.0", + "chalk": "^2.4.2", + "death": "^1.1.0", + "difflib": "^0.2.4", + "fs-extra": "^8.1.0", + "ghost-testrpc": "^0.0.2", + "global-modules": "^2.0.0", + "globby": "^10.0.1", + "jsonschema": "^1.2.4", + "lodash": "^4.17.21", + "mocha": "^10.2.0", + "node-emoji": "^1.10.0", + "pify": "^4.0.1", + "recursive-readdir": "^2.2.2", + "sc-istanbul": "^0.4.5", + "semver": "^7.3.4", + "shelljs": "^0.8.3", + "web3-utils": "^1.3.6" + }, + "bin": { + "solidity-coverage": "plugins/bin.js" + }, + "peerDependencies": { + "hardhat": "^2.11.0" + } + }, + "node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.18.0.tgz", + "integrity": "sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==", + "dev": true, + "peer": true + }, + "node_modules/solidity-coverage/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, + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/solidity-coverage/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, + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/solidity-coverage/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, + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/solidity-coverage/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "peer": 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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": 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", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/solidity-coverage/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/solidity-coverage/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "peer": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/solidity-coverage/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/solidity-coverage/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, + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/solidity-coverage/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dev": true, + "peer": true, + "dependencies": { + "readable-stream": "^3.0.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "peer": true + }, + "node_modules/stacktrace-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", + "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "dev": true, + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/stacktrace-parser/node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "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/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz", + "integrity": "sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==", + "dev": true, + "peer": true + }, + "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/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/strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dev": true, + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/sync-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", + "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", + "dev": true, + "peer": true, + "dependencies": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/sync-rpc": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", + "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", + "dev": true, + "peer": true, + "dependencies": { + "get-port": "^3.1.0" + } + }, + "node_modules/table": { + "version": "6.8.2", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", + "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==", + "dev": true, + "peer": 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/table-layout": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "dev": true, + "peer": true, + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table-layout/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/then-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", + "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/then-request/node_modules/@types/node": { + "version": "8.10.66", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", + "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==", + "dev": true, + "peer": true + }, + "node_modules/then-request/node_modules/form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "dev": true, + "peer": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "peer": true, + "dependencies": { + "readable-stream": "3" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/ts-command-line-args": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", + "integrity": "sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==", + "dev": true, + "peer": true, + "dependencies": { + "chalk": "^4.1.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.0", + "string-format": "^2.0.0" + }, + "bin": { + "write-markdown": "dist/write-markdown.js" + } + }, + "node_modules/ts-essentials": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", + "integrity": "sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==", + "dev": true, + "peer": true, + "peerDependencies": { + "typescript": ">=3.7.0" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "dev": true, + "peer": true + }, + "node_modules/tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", + "dev": true + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true + }, + "node_modules/tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typechain": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", + "integrity": "sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==", + "dev": true, + "peer": true, + "dependencies": { + "@types/prettier": "^2.1.1", + "debug": "^4.3.1", + "fs-extra": "^7.0.0", + "glob": "7.1.7", + "js-sha3": "^0.8.0", + "lodash": "^4.17.15", + "mkdirp": "^1.0.4", + "prettier": "^2.3.1", + "ts-command-line-args": "^2.2.0", + "ts-essentials": "^7.0.1" + }, + "bin": { + "typechain": "dist/cli/cli.js" + }, + "peerDependencies": { + "typescript": ">=4.3.0" + } + }, + "node_modules/typechain/node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/typechain/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "peer": 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": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typechain/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "peer": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/typechain/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "peer": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/typechain/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "dev": true, + "peer": true + }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dev": true, + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true, + "peer": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "peer": true + }, + "node_modules/web3-utils": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.4.tgz", + "integrity": "sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==", + "dev": true, + "peer": true, + "dependencies": { + "@ethereumjs/util": "^8.1.0", + "bn.js": "^5.2.1", + "ethereum-bloom-filters": "^1.0.6", + "ethereum-cryptography": "^2.1.2", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-utils/node_modules/@noble/curves": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.3.0.tgz", + "integrity": "sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/hashes": "1.3.3" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@noble/hashes": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.3.tgz", + "integrity": "sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/ethereum-cryptography": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz", + "integrity": "sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/curves": "1.3.0", + "@noble/hashes": "1.3.3", + "@scure/bip32": "1.3.3", + "@scure/bip39": "1.2.2" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "peer": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true, + "peer": true + }, + "node_modules/wordwrapjs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "dev": true, + "peer": true, + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/wordwrapjs/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/ws": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "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/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/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/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "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" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..ecb7dca --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "@litentry/contracts", + "description": "Litentry Dynamic Assertion Contracts", + "license": "MIT", + "author": "Litentry Dev Team", + "scripts": { + "clean": "rm -rf artifacts cache", + "compile": "hardhat compile", + "fmt": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol' && prettier --write .", + "fmt:check": "prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol' && prettier --check ." + }, + "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^5.0.0", + "@openzeppelin/contracts": "^4.9.0", + "hardhat": "^2.22.5", + "prettier-plugin-solidity": "^1.3.1" + }, + "packageManager": "npm@10.5.0" +} diff --git a/test/A1.ts b/test/A1.ts new file mode 100644 index 0000000..e69de29 diff --git a/test/A20.ts b/test/A20.ts new file mode 100644 index 0000000..e69de29 diff --git a/test/A6.ts b/test/A6.ts new file mode 100644 index 0000000..e69de29 diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..0e79616 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "resolveJsonModule": true + } +} From be3348fc92f1b127658d1251d637e2a41dc97cc9 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 18:28:45 +0800 Subject: [PATCH 02/23] add readme --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 17f8ed1..ab0461d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,53 @@ -# Sample Hardhat Project +## Litentry Dynamic Assertion Contracts -This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a Hardhat Ignition module that deploys that contract. +This repo is the contracts part separated from the [litentry-parachain](https://github.com/litentry/litentry-parachain). -Try running some of the following tasks: +## System Requirements -```shell -npx hardhat help -npx hardhat test -REPORT_GAS=true npx hardhat test -npx hardhat node -npx hardhat ignition deploy ./ignition/modules/Lock.ts -``` +- Node.js +- Typescript +- [Hardhat](https://hardhat.org/hardhat-runner/docs/getting-started#overview) +- Solidity + +## Configuration + +- [Solidity versions](https://hardhat.org/hardhat-runner/docs/advanced/multiple-solidity-versions) +- [Configuration Variables](https://hardhat.org/hardhat-runner/docs/config#configuration) + +## Getting started + +1. Install Node V18 + +2. Clone this repo + +3. Switch to the right Node.js version using NVM. + + ```typescript + # From the repo's root + nvm use + ``` + +4. Install dependencies with `npm` + + ```typescript + # From the repo's root + npm install + ``` + +5. Compile contracts + + ```typescript + # From the repo's root + npm run compile or npx hardhat compile + ``` + + [Compile directory structure](https://hardhat.org/hardhat-runner/docs/advanced/artifacts#directory-structure) + +6. Run ts-tests + + ``` + # From the repo's root + npm run test:all or npx hardhat test + ``` + +​ [More tesing contracts details](https://hardhat.org/hardhat-runner/docs/guides/test-contracts) \ No newline at end of file From 51a754426ea3ba74f153ba9f70a4afbb22dfd328 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 18:29:00 +0800 Subject: [PATCH 03/23] update scripts --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ecb7dca..cd4f0c0 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,11 @@ "license": "MIT", "author": "Litentry Dev Team", "scripts": { - "clean": "rm -rf artifacts cache", + "clean": "npx hardhat clean", "compile": "hardhat compile", "fmt": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol' && prettier --write .", - "fmt:check": "prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol' && prettier --check ." + "fmt-check": "prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol' && prettier --check .", + "test:all": "npx hardhat test" }, "devDependencies": { "@nomicfoundation/hardhat-toolbox": "^5.0.0", From 4f784bcdce55a23edaa5b02127035af31d963f22 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 18:29:21 +0800 Subject: [PATCH 04/23] add basci gha --- .github/workflows/ci.yml | 68 +++++++++++++++++++ .../delete-branch-after-pr-merge.yml | 19 ++++++ 2 files changed, 87 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/delete-branch-after-pr-merge.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6d958f6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: General CI + +on: + push: + branches: + - dev + paths-ignore: + - "**/README.md" + pull_request: + branches: + - dev + types: + - opened + - reopened + - synchronize + - ready_for_review +jobs: + + set-node: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set Node version + uses: actions/setup-node@v4 + with: + node-version: 18 + + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install deps + run: | + npm install + + - name: Fmt check + run: | + npm run fmt-check + + compile: + runs-on: ubuntu-latest + needs: + - fmt + steps: + - uses: actions/checkout@v4 + + - name: Compile solidity + run: | + npm run compile + + hardhat-test: + runs-on: ubuntu-latest + needs: + - compile + + - uses: actions/checkout@v4 + + - name: Run hardhat test + run: | + npm run test:all + + + + + + diff --git a/.github/workflows/delete-branch-after-pr-merge.yml b/.github/workflows/delete-branch-after-pr-merge.yml new file mode 100644 index 0000000..8314dee --- /dev/null +++ b/.github/workflows/delete-branch-after-pr-merge.yml @@ -0,0 +1,19 @@ +name: Delete branch after PR merge + +on: + pull_request_target: + types: + - closed + +jobs: + delete_branch_optionally: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: delete_branch + run: | + git push origin --delete "${{ github.head_ref }}" + echo "remote branch ${{ github.head_ref }} deleted" \ No newline at end of file From d7c168cf14c4f585000e54c7c97f7be4b7c3e39a Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 18:31:25 +0800 Subject: [PATCH 05/23] fix readme fmt --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab0461d..2f099b0 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,14 @@ This repo is the contracts part separated from the [litentry-parachain](https:// npm run compile or npx hardhat compile ``` - [Compile directory structure](https://hardhat.org/hardhat-runner/docs/advanced/artifacts#directory-structure) + [Compiled directory structure](https://hardhat.org/hardhat-runner/docs/advanced/artifacts#directory-structure) 6. Run ts-tests - ``` + ```typescript # From the repo's root npm run test:all or npx hardhat test ``` -​ [More tesing contracts details](https://hardhat.org/hardhat-runner/docs/guides/test-contracts) \ No newline at end of file +​ [More tesing contracts details](https://hardhat.org/hardhat-runner/docs/guides/test-contracts) + From 7f3670dda6efe74f9499cdcfc539bbdcd6eac633 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 18:32:38 +0800 Subject: [PATCH 06/23] fix one more --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f099b0..4ad371c 100644 --- a/README.md +++ b/README.md @@ -50,5 +50,6 @@ This repo is the contracts part separated from the [litentry-parachain](https:// npm run test:all or npx hardhat test ``` -​ [More tesing contracts details](https://hardhat.org/hardhat-runner/docs/guides/test-contracts) + [More tesing contracts details](https://hardhat.org/hardhat-runner/docs/guides/test-contracts) + From 6e378626a234c325c04dfd8fc352e7ed3e5fe567 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 18:34:06 +0800 Subject: [PATCH 07/23] add LOGO --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ad371c..1710272 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -## Litentry Dynamic Assertion Contracts +![Logo](https://avatars.githubusercontent.com/u/51339301?s=200&v=4) +## Litentry Dynamic Assertion Contracts This repo is the contracts part separated from the [litentry-parachain](https://github.com/litentry/litentry-parachain). ## System Requirements From cb7e7fe8517ca27c6f663b068c4705c5fa68c008 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 19:00:25 +0800 Subject: [PATCH 08/23] add prettier --- .github/workflows/ci.yml | 2 ++ package-lock.json | 28 ++++++++++++++++++++++------ package.json | 1 + 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9da84d8..e395bdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,8 @@ jobs: fmt: runs-on: ubuntu-latest + needs: + - set-node steps: - uses: actions/checkout@v4 diff --git a/package-lock.json b/package-lock.json index 1e7f041..6ee9062 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "@nomicfoundation/hardhat-toolbox": "^5.0.0", "@openzeppelin/contracts": "^4.9.0", "hardhat": "^2.22.5", + "prettier": "^3.3.1", "prettier-plugin-solidity": "^1.3.1" } }, @@ -5604,16 +5605,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", + "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", "dev": true, - "peer": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -7034,6 +7034,22 @@ "node": ">=10" } }, + "node_modules/typechain/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "peer": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/typechain/node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", diff --git a/package.json b/package.json index cd4f0c0..f9318cd 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@nomicfoundation/hardhat-toolbox": "^5.0.0", "@openzeppelin/contracts": "^4.9.0", "hardhat": "^2.22.5", + "prettier": "^3.3.1", "prettier-plugin-solidity": "^1.3.1" }, "packageManager": "npm@10.5.0" From c448c92681f81911c38a4e1ef9aaf67ce0e02e73 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 19:02:25 +0800 Subject: [PATCH 09/23] fmt --- .github/workflows/ci.yml | 118 +++++++++--------- .../delete-branch-after-pr-merge.yml | 26 ++-- README.md | 53 ++++---- contracts/Assertions/A20.sol | 73 +++++------ 4 files changed, 136 insertions(+), 134 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e395bdb..2ae4bd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,63 +1,63 @@ name: General CI on: - push: - branches: - - dev - paths-ignore: - - "**/README.md" - pull_request: - branches: - - dev - types: - - opened - - reopened - - synchronize - - ready_for_review + push: + branches: + - dev + paths-ignore: + - "**/README.md" + pull_request: + branches: + - dev + types: + - opened + - reopened + - synchronize + - ready_for_review jobs: - set-node: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set Node version - uses: actions/setup-node@v4 - with: - node-version: 18 - - fmt: - runs-on: ubuntu-latest - needs: - - set-node - steps: - - uses: actions/checkout@v4 - - - name: Install deps - run: | - npm install - - - name: Fmt check - run: | - npm run fmt-check - - compile: - runs-on: ubuntu-latest - needs: - - fmt - steps: - - uses: actions/checkout@v4 - - - name: Compile solidity - run: | - npm run compile - - hardhat-test: - runs-on: ubuntu-latest - needs: - - compile - steps: - - uses: actions/checkout@v4 - - - name: Run hardhat test - run: | - npm run test:all + set-node: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set Node version + uses: actions/setup-node@v4 + with: + node-version: 18 + + fmt: + runs-on: ubuntu-latest + needs: + - set-node + steps: + - uses: actions/checkout@v4 + + - name: Install deps + run: | + npm install + + - name: Fmt check + run: | + npm run fmt-check + + compile: + runs-on: ubuntu-latest + needs: + - fmt + steps: + - uses: actions/checkout@v4 + + - name: Compile solidity + run: | + npm run compile + + hardhat-test: + runs-on: ubuntu-latest + needs: + - compile + steps: + - uses: actions/checkout@v4 + + - name: Run hardhat test + run: | + npm run test:all diff --git a/.github/workflows/delete-branch-after-pr-merge.yml b/.github/workflows/delete-branch-after-pr-merge.yml index 8314dee..3a7d102 100644 --- a/.github/workflows/delete-branch-after-pr-merge.yml +++ b/.github/workflows/delete-branch-after-pr-merge.yml @@ -1,19 +1,19 @@ name: Delete branch after PR merge on: - pull_request_target: - types: - - closed + pull_request_target: + types: + - closed jobs: - delete_branch_optionally: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + delete_branch_optionally: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: delete_branch - run: | - git push origin --delete "${{ github.head_ref }}" - echo "remote branch ${{ github.head_ref }} deleted" \ No newline at end of file + - name: delete_branch + run: | + git push origin --delete "${{ github.head_ref }}" + echo "remote branch ${{ github.head_ref }} deleted" diff --git a/README.md b/README.md index 1710272..99c941b 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,20 @@ ![Logo](https://avatars.githubusercontent.com/u/51339301?s=200&v=4) -## Litentry Dynamic Assertion Contracts +## Litentry Dynamic Assertion Contracts + This repo is the contracts part separated from the [litentry-parachain](https://github.com/litentry/litentry-parachain). ## System Requirements -- Node.js -- Typescript -- [Hardhat](https://hardhat.org/hardhat-runner/docs/getting-started#overview) -- Solidity +- Node.js +- Typescript +- [Hardhat](https://hardhat.org/hardhat-runner/docs/getting-started#overview) +- Solidity ## Configuration -- [Solidity versions](https://hardhat.org/hardhat-runner/docs/advanced/multiple-solidity-versions) -- [Configuration Variables](https://hardhat.org/hardhat-runner/docs/config#configuration) +- [Solidity versions](https://hardhat.org/hardhat-runner/docs/advanced/multiple-solidity-versions) +- [Configuration Variables](https://hardhat.org/hardhat-runner/docs/config#configuration) ## Getting started @@ -23,34 +24,32 @@ This repo is the contracts part separated from the [litentry-parachain](https:// 3. Switch to the right Node.js version using NVM. - ```typescript - # From the repo's root - nvm use - ``` + ```typescript + # From the repo's root + nvm use + ``` 4. Install dependencies with `npm` - ```typescript - # From the repo's root - npm install - ``` + ```typescript + # From the repo's root + npm install + ``` 5. Compile contracts - ```typescript - # From the repo's root - npm run compile or npx hardhat compile - ``` + ```typescript + # From the repo's root + npm run compile or npx hardhat compile + ``` - [Compiled directory structure](https://hardhat.org/hardhat-runner/docs/advanced/artifacts#directory-structure) + [Compiled directory structure](https://hardhat.org/hardhat-runner/docs/advanced/artifacts#directory-structure) 6. Run ts-tests - ```typescript - # From the repo's root - npm run test:all or npx hardhat test - ``` - - [More tesing contracts details](https://hardhat.org/hardhat-runner/docs/guides/test-contracts) - + ```typescript + # From the repo's root + npm run test:all or npx hardhat test + ``` + [More tesing contracts details](https://hardhat.org/hardhat-runner/docs/guides/test-contracts) diff --git a/contracts/Assertions/A20.sol b/contracts/Assertions/A20.sol index 1934528..472159f 100644 --- a/contracts/Assertions/A20.sol +++ b/contracts/Assertions/A20.sol @@ -18,44 +18,47 @@ pragma solidity ^0.8.8; -import {DynamicAssertion, Identity, HttpHeader} from "../DynamicAssertion.sol"; +import { DynamicAssertion, Identity, HttpHeader } from "../DynamicAssertion.sol"; contract A20 is DynamicAssertion { - function execute(Identity[] memory identities, string[] memory /*secrets*/) - public - override - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ) - { - string - memory description = "The user is an early bird user of the IdentityHub EVM version and has generated at least 1 credential during 2023 Aug 14th ~ Aug 21st."; - string memory assertion_type = "IDHub EVM Version Early Bird"; - assertions.push('{ "src": "$has_joined", "op": "==", "dst": "true" }'); - schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/12-idhub-evm-version-early-bird/1-0-0.json"; - bool result = false; + function execute( + Identity[] memory identities, + string[] memory /*secrets*/ + ) + public + override + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ) + { + string + memory description = "The user is an early bird user of the IdentityHub EVM version and has generated at least 1 credential during 2023 Aug 14th ~ Aug 21st."; + string memory assertion_type = "IDHub EVM Version Early Bird"; + assertions.push('{ "src": "$has_joined", "op": "==", "dst": "true" }'); + schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/12-idhub-evm-version-early-bird/1-0-0.json"; + bool result = false; - for (uint256 i = 0; i < identities.length; i++) { - if (is_web3(identities[i])) { - string memory res = toHex(identities[i].value); + for (uint256 i = 0; i < identities.length; i++) { + if (is_web3(identities[i])) { + string memory res = toHex(identities[i].value); - string memory url = concatenateStrings( - "http://localhost:19527/events/does-user-joined-evm-campaign?account=", - res - ); - string memory jsonPointer = "/hasJoined"; - HttpHeader[] memory headers = new HttpHeader[](0); + string memory url = concatenateStrings( + "http://localhost:19527/events/does-user-joined-evm-campaign?account=", + res + ); + string memory jsonPointer = "/hasJoined"; + HttpHeader[] memory headers = new HttpHeader[](0); - result = GetBool(url, jsonPointer, headers); - if (result) { - break; - } - } - } - return (description, assertion_type, assertions, schema_url, result); - } + result = GetBool(url, jsonPointer, headers); + if (result) { + break; + } + } + } + return (description, assertion_type, assertions, schema_url, result); + } } From c8ecd726db1961b910fd945c4fa9cbbd5b5c6fe5 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 19:11:55 +0800 Subject: [PATCH 10/23] fmt md --- .github/workflows/ci.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ae4bd8..b9306ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ on: - synchronize - ready_for_review jobs: - set-node: + set-env: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -28,7 +28,7 @@ jobs: fmt: runs-on: ubuntu-latest needs: - - set-node + - set-env steps: - uses: actions/checkout@v4 @@ -40,24 +40,21 @@ jobs: run: | npm run fmt-check - compile: + compile-tests: runs-on: ubuntu-latest needs: - fmt steps: - uses: actions/checkout@v4 + - name: Install deps + run: | + npm install + - name: Compile solidity run: | npm run compile - hardhat-test: - runs-on: ubuntu-latest - needs: - - compile - steps: - - uses: actions/checkout@v4 - - name: Run hardhat test run: | npm run test:all From 20284f269f9975ba79ef27c2c2f7f949a063ac02 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 20:58:43 +0800 Subject: [PATCH 11/23] get bytecode --- test/A1.ts | 0 test/A20.ts | 0 test/A6.ts | 0 test/contracts.ts | 14 ++++++++++++++ 4 files changed, 14 insertions(+) delete mode 100644 test/A1.ts delete mode 100644 test/A20.ts delete mode 100644 test/A6.ts create mode 100644 test/contracts.ts diff --git a/test/A1.ts b/test/A1.ts deleted file mode 100644 index e69de29..0000000 diff --git a/test/A20.ts b/test/A20.ts deleted file mode 100644 index e69de29..0000000 diff --git a/test/A6.ts b/test/A6.ts deleted file mode 100644 index e69de29..0000000 diff --git a/test/contracts.ts b/test/contracts.ts new file mode 100644 index 0000000..46088b1 --- /dev/null +++ b/test/contracts.ts @@ -0,0 +1,14 @@ +import { ethers } from "hardhat" + +// todo: add more tests +describe("contracts", () => { + it("should return the bytecode of the contracts", async () => { + const A1Contract = await ethers.getContractFactory("A1") + const A6Contract = await ethers.getContractFactory("A6") + const A20Contract = await ethers.getContractFactory("A20") + + console.log("A1 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€πŸš€:", A1Contract.bytecode) + console.log("A6 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A6Contract.bytecode) + console.log("A20 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A20Contract.bytecode) + }) +}) From c846f5eff27e6cd72ab7498cb36ab0332c994363 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 21:02:17 +0800 Subject: [PATCH 12/23] Add assertion. --- test/contracts.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/contracts.ts b/test/contracts.ts index 46088b1..1db225a 100644 --- a/test/contracts.ts +++ b/test/contracts.ts @@ -1,14 +1,17 @@ import { ethers } from "hardhat" - +import { expect } from "chai" // todo: add more tests describe("contracts", () => { - it("should return the bytecode of the contracts", async () => { - const A1Contract = await ethers.getContractFactory("A1") - const A6Contract = await ethers.getContractFactory("A6") - const A20Contract = await ethers.getContractFactory("A20") + it("should return the bytecode of the contracts", async () => { + const A1Contract = await ethers.getContractFactory("A1") + const A6Contract = await ethers.getContractFactory("A6") + const A20Contract = await ethers.getContractFactory("A20") - console.log("A1 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€πŸš€:", A1Contract.bytecode) - console.log("A6 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A6Contract.bytecode) - console.log("A20 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A20Contract.bytecode) - }) + expect(A1Contract.bytecode).to.be.ok + expect(A6Contract.bytecode).to.be.ok + expect(A20Contract.bytecode).to.be.ok + console.log("A1 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€πŸš€:", A1Contract.bytecode) + console.log("A6 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A6Contract.bytecode) + console.log("A20 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A20Contract.bytecode) + }) }) From ffd053116f1e417e1e4b5b9ef69fad027149a106 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Wed, 5 Jun 2024 21:10:58 +0800 Subject: [PATCH 13/23] fmt --- test/contracts.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/contracts.ts b/test/contracts.ts index 1db225a..7fd67e2 100644 --- a/test/contracts.ts +++ b/test/contracts.ts @@ -2,16 +2,16 @@ import { ethers } from "hardhat" import { expect } from "chai" // todo: add more tests describe("contracts", () => { - it("should return the bytecode of the contracts", async () => { - const A1Contract = await ethers.getContractFactory("A1") - const A6Contract = await ethers.getContractFactory("A6") - const A20Contract = await ethers.getContractFactory("A20") + it("should return the bytecode of the contracts", async () => { + const A1Contract = await ethers.getContractFactory("A1") + const A6Contract = await ethers.getContractFactory("A6") + const A20Contract = await ethers.getContractFactory("A20") - expect(A1Contract.bytecode).to.be.ok - expect(A6Contract.bytecode).to.be.ok - expect(A20Contract.bytecode).to.be.ok - console.log("A1 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€πŸš€:", A1Contract.bytecode) - console.log("A6 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A6Contract.bytecode) - console.log("A20 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A20Contract.bytecode) - }) + expect(A1Contract.bytecode).to.be.ok + expect(A6Contract.bytecode).to.be.ok + expect(A20Contract.bytecode).to.be.ok + console.log("A1 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€πŸš€:", A1Contract.bytecode) + console.log("A6 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A6Contract.bytecode) + console.log("A20 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A20Contract.bytecode) + }) }) From ac8d0a6ca78e3d27a5143a757b75f5c2a2df7caf Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Thu, 13 Jun 2024 09:57:31 +0800 Subject: [PATCH 14/23] init dymic assertion --- .../TokenHoldingAmount.sol | 165 ++++++++++++++++++ .../token_holding_amount/tokens/Btcs.sol | 46 +++++ .../token_holding_amount/tokens/Cats.sol | 45 +++++ .../token_holding_amount/tokens/Long.sol | 46 +++++ .../token_holding_amount/tokens/Mmss.sol | 46 +++++ .../token_holding_amount/tokens/Ordi.sol | 45 +++++ .../token_holding_amount/tokens/Rats.sol | 46 +++++ .../token_holding_amount/tokens/Sats.sol | 46 +++++ 8 files changed, 485 insertions(+) create mode 100644 contracts/token_holding_amount/TokenHoldingAmount.sol create mode 100644 contracts/token_holding_amount/tokens/Btcs.sol create mode 100644 contracts/token_holding_amount/tokens/Cats.sol create mode 100644 contracts/token_holding_amount/tokens/Long.sol create mode 100644 contracts/token_holding_amount/tokens/Mmss.sol create mode 100644 contracts/token_holding_amount/tokens/Ordi.sol create mode 100644 contracts/token_holding_amount/tokens/Rats.sol create mode 100644 contracts/token_holding_amount/tokens/Sats.sol diff --git a/contracts/token_holding_amount/TokenHoldingAmount.sol b/contracts/token_holding_amount/TokenHoldingAmount.sol new file mode 100644 index 0000000..da1f847 --- /dev/null +++ b/contracts/token_holding_amount/TokenHoldingAmount.sol @@ -0,0 +1,165 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "@openzeppelin/contracts/utils/Strings.sol"; +import "../libraries/AssertionLogic.sol"; +import "../libraries/Identities.sol"; +import "../DynamicAssertion.sol"; + +abstract contract TokenHoldingAmount is DynamicAssertion { + function execute(Identity[] memory identities, string[] memory secrets) + public + override + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ) + { + string + memory description = "The amount of a particular token you are holding"; + string memory assertion_type = "Token Holding Amount"; + schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/25-token-holding-amount/1-1-0.json"; + + uint256 balance = queryTotalBalance(identities, secrets); + + (uint256 index, uint256 min, int256 max) = calculateRange(balance); + + string[] memory assertions = assembleAssertions(min, max); + + bool result = index > 0 || balance > 0; + + return (description, assertion_type, assertions, schema_url, result); + } + + function queryTotalBalance( + Identity[] memory identities, + string[] memory secrets + ) internal virtual returns (uint256) { + uint256 total_balance = 0; + uint256 identitiesLength = identities.length; + + for (uint256 i = 0; i < identitiesLength; i++) { + Identity memory identity = identities[i]; + uint256 networksLength = identity.networks.length; + for (uint32 j = 0; j < networksLength; j++) { + uint32 network = identity.networks[j]; + if (isSupportedNetwork(network)) { + total_balance += queryBalance(identity, network, secrets); + } + } + } + + return total_balance; + } + + function calculateRange(uint256 balance) + private + pure + returns ( + uint256, + uint256, + int256 + ) + { + uint256[] memory ranges = getTokenRanges(); + uint256 index = ranges.length - 1; + uint256 min = 0; + int256 max = 0; + + for (uint32 i = 1; i < ranges.length; i++) { + if (balance < ranges[i] * 10**getTokenDecimals()) { + index = i - 1; + break; + } + } + + if (index == ranges.length - 1) { + min = ranges[index]; + max = -1; + } else { + min = ranges[index]; + max = int256(ranges[index + 1]); + } + + return (index, min, max); + } + + function assembleAssertions(uint256 min, int256 max) + private + pure + returns (string[] memory) + { + string memory variable = "$holding_amount"; + AssertionLogic.CompositeCondition memory cc = AssertionLogic + .CompositeCondition( + new AssertionLogic.Condition[](max > 0 ? 3 : 2), + true + ); + AssertionLogic.andOp( + cc, + 0, + "$token", + AssertionLogic.Op.Equal, + getTokenName() + ); + AssertionLogic.andOp( + cc, + 1, + variable, + AssertionLogic.Op.GreaterEq, + Strings.toString(min) + ); + if (max > 0) { + AssertionLogic.andOp( + cc, + 2, + variable, + AssertionLogic.Op.LessThan, + Strings.toString(max) + ); + } + + string[] memory assertions = new string[](1); + assertions[0] = AssertionLogic.toString(cc); + + return assertions; + } + + function getTokenName() internal pure virtual returns (string memory); + + function getTokenRanges() internal pure virtual returns (uint256[] memory); + + function getTokenDecimals() internal pure virtual returns (uint8); + + function isSupportedNetwork(uint32 network) + internal + pure + virtual + returns (bool); + + function queryBalance( + Identity memory identity, + uint32 network, + string[] memory secrets + ) internal virtual returns (uint256); +} diff --git a/contracts/token_holding_amount/tokens/Btcs.sol b/contracts/token_holding_amount/tokens/Btcs.sol new file mode 100644 index 0000000..1204ba1 --- /dev/null +++ b/contracts/token_holding_amount/tokens/Btcs.sol @@ -0,0 +1,46 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import {BRC20} from "../BRC20.sol"; + +contract Btcs is BRC20 { + function getTokenName() internal pure override returns (string memory) { + return "btcs"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 5; + ranges[3] = 20; + ranges[4] = 50; + ranges[5] = 100; + ranges[6] = 200; + ranges[7] = 500; + ranges[8] = 800; + return ranges; + } +} diff --git a/contracts/token_holding_amount/tokens/Cats.sol b/contracts/token_holding_amount/tokens/Cats.sol new file mode 100644 index 0000000..0c737a3 --- /dev/null +++ b/contracts/token_holding_amount/tokens/Cats.sol @@ -0,0 +1,45 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import {BRC20} from "../BRC20.sol"; + +contract Cats is BRC20 { + function getTokenName() internal pure override returns (string memory) { + return "cats"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](8); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 10000; + ranges[3] = 50000; + ranges[4] = 100000; + ranges[5] = 200000; + ranges[6] = 500000; + ranges[7] = 800000; + return ranges; + } +} diff --git a/contracts/token_holding_amount/tokens/Long.sol b/contracts/token_holding_amount/tokens/Long.sol new file mode 100644 index 0000000..8ec3681 --- /dev/null +++ b/contracts/token_holding_amount/tokens/Long.sol @@ -0,0 +1,46 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import {BRC20} from "../BRC20.sol"; + +contract Long is BRC20 { + function getTokenName() internal pure override returns (string memory) { + return "long"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 20; + ranges[3] = 50; + ranges[4] = 200; + ranges[5] = 500; + ranges[6] = 1000; + ranges[7] = 2000; + ranges[8] = 3000; + return ranges; + } +} diff --git a/contracts/token_holding_amount/tokens/Mmss.sol b/contracts/token_holding_amount/tokens/Mmss.sol new file mode 100644 index 0000000..4cf9030 --- /dev/null +++ b/contracts/token_holding_amount/tokens/Mmss.sol @@ -0,0 +1,46 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import {BRC20} from "../BRC20.sol"; + +contract Mmss is BRC20 { + function getTokenName() internal pure override returns (string memory) { + return "mmss"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 20; + ranges[3] = 50; + ranges[4] = 100; + ranges[5] = 200; + ranges[6] = 500; + ranges[7] = 1000; + ranges[8] = 2000; + return ranges; + } +} diff --git a/contracts/token_holding_amount/tokens/Ordi.sol b/contracts/token_holding_amount/tokens/Ordi.sol new file mode 100644 index 0000000..eb337df --- /dev/null +++ b/contracts/token_holding_amount/tokens/Ordi.sol @@ -0,0 +1,45 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import {BRC20} from "../BRC20.sol"; + +contract Ordi is BRC20 { + function getTokenName() internal pure override returns (string memory) { + return "ordi"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](8); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 5; + ranges[3] = 20; + ranges[4] = 50; + ranges[5] = 100; + ranges[6] = 200; + ranges[7] = 500; + return ranges; + } +} diff --git a/contracts/token_holding_amount/tokens/Rats.sol b/contracts/token_holding_amount/tokens/Rats.sol new file mode 100644 index 0000000..27a27f4 --- /dev/null +++ b/contracts/token_holding_amount/tokens/Rats.sol @@ -0,0 +1,46 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import {BRC20} from "../BRC20.sol"; + +contract Rats is BRC20 { + function getTokenName() internal pure override returns (string memory) { + return "rats"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 40000; + ranges[3] = 200000; + ranges[4] = 1000000; + ranges[5] = 2000000; + ranges[6] = 4000000; + ranges[7] = 10000000; + ranges[8] = 2000000; + return ranges; + } +} diff --git a/contracts/token_holding_amount/tokens/Sats.sol b/contracts/token_holding_amount/tokens/Sats.sol new file mode 100644 index 0000000..3b86677 --- /dev/null +++ b/contracts/token_holding_amount/tokens/Sats.sol @@ -0,0 +1,46 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import {BRC20} from "../BRC20.sol"; + +contract Sats is BRC20 { + function getTokenName() internal pure override returns (string memory) { + return "sats"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 40000000; + ranges[3] = 200000000; + ranges[4] = 500000000; + ranges[5] = 1000000000; + ranges[6] = 2000000000; + ranges[7] = 4000000000; + ranges[8] = 6000000000; + return ranges; + } +} From fc9d156cd90071ad1e53410380ecb22dd218165e Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Thu, 13 Jun 2024 09:57:51 +0800 Subject: [PATCH 15/23] assertions --- contracts/Assertions/A1.sol | 62 ---- contracts/Assertions/A20.sol | 64 ---- contracts/Assertions/A6.sol | 110 ------ contracts/DynamicAssertion.sol | 318 +----------------- contracts/README.md | 1 + contracts/libraries/AssertionLogic.sol | 139 ++++++++ contracts/libraries/Http.sol | 247 ++++++++++++++ contracts/libraries/Identities.sol | 295 ++++++++++++++++ contracts/libraries/Utils.sol | 171 ++++++++++ contracts/tests/GetBool.sol | 43 +++ contracts/tests/GetI64.sol | 42 +++ contracts/tests/GetString.sol | 42 +++ contracts/tests/HexToNumber.sol | 30 ++ contracts/tests/IdentityToString.sol | 30 ++ contracts/tests/ParseDecimal.sol | 30 ++ contracts/tests/ParseInt.sol | 27 ++ contracts/tests/PostBool.sol | 46 +++ contracts/tests/PostI64.sol | 46 +++ contracts/tests/PostString.sol | 51 +++ contracts/tests/README.md | 2 + contracts/tests/ToHex.sol | 30 ++ contracts/token_holding_amount/BRC20.sol | 82 +++++ .../BlockchainInfoClient.sol | 49 +++ .../token_holding_amount/NoderealClient.sol | 77 +++++ hardhat.config.ts | 2 +- 25 files changed, 1494 insertions(+), 542 deletions(-) delete mode 100644 contracts/Assertions/A1.sol delete mode 100644 contracts/Assertions/A20.sol delete mode 100644 contracts/Assertions/A6.sol create mode 100644 contracts/README.md create mode 100644 contracts/libraries/AssertionLogic.sol create mode 100644 contracts/libraries/Http.sol create mode 100644 contracts/libraries/Identities.sol create mode 100644 contracts/libraries/Utils.sol create mode 100644 contracts/tests/GetBool.sol create mode 100644 contracts/tests/GetI64.sol create mode 100644 contracts/tests/GetString.sol create mode 100644 contracts/tests/HexToNumber.sol create mode 100644 contracts/tests/IdentityToString.sol create mode 100644 contracts/tests/ParseDecimal.sol create mode 100644 contracts/tests/ParseInt.sol create mode 100644 contracts/tests/PostBool.sol create mode 100644 contracts/tests/PostI64.sol create mode 100644 contracts/tests/PostString.sol create mode 100644 contracts/tests/README.md create mode 100644 contracts/tests/ToHex.sol create mode 100644 contracts/token_holding_amount/BRC20.sol create mode 100644 contracts/token_holding_amount/BlockchainInfoClient.sol create mode 100644 contracts/token_holding_amount/NoderealClient.sol diff --git a/contracts/Assertions/A1.sol b/contracts/Assertions/A1.sol deleted file mode 100644 index 5d7d46e..0000000 --- a/contracts/Assertions/A1.sol +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -// SPDX-License-Identifier: GPL-3.0-or-later - -pragma solidity ^0.8.8; - -import { DynamicAssertion, Identity } from "../DynamicAssertion.sol"; - -contract A1 is DynamicAssertion { - function execute( - Identity[] memory identities, - string[] memory /*secrets*/ - ) - public - override - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ) - { - string - memory description = "You've identified at least one account/address in both Web2 and Web3."; - string memory assertion_type = "Basic Identity Verification"; - assertions.push( - '{"and": [{ "src": "$has_web2_account", "op": "==", "dst": "true" }, { "src": "$has_web3_account", "op": "==", "dst": "true" } ] }' - ); - schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/1-basic-identity-verification/1-0-0.json"; - - bool result; - - bool has_web3_identity = false; - bool has_web2_identity = false; - - for (uint256 i = 0; i < identities.length; i++) { - if (is_web2(identities[i])) { - has_web2_identity = true; - } else if (is_web3(identities[i])) { - has_web3_identity = true; - } - } - result = has_web2_identity && has_web3_identity; - - return (description, assertion_type, assertions, schema_url, result); - } -} diff --git a/contracts/Assertions/A20.sol b/contracts/Assertions/A20.sol deleted file mode 100644 index 472159f..0000000 --- a/contracts/Assertions/A20.sol +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -// SPDX-License-Identifier: GPL-3.0-or-later - -pragma solidity ^0.8.8; - -import { DynamicAssertion, Identity, HttpHeader } from "../DynamicAssertion.sol"; - -contract A20 is DynamicAssertion { - function execute( - Identity[] memory identities, - string[] memory /*secrets*/ - ) - public - override - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ) - { - string - memory description = "The user is an early bird user of the IdentityHub EVM version and has generated at least 1 credential during 2023 Aug 14th ~ Aug 21st."; - string memory assertion_type = "IDHub EVM Version Early Bird"; - assertions.push('{ "src": "$has_joined", "op": "==", "dst": "true" }'); - schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/12-idhub-evm-version-early-bird/1-0-0.json"; - bool result = false; - - for (uint256 i = 0; i < identities.length; i++) { - if (is_web3(identities[i])) { - string memory res = toHex(identities[i].value); - - string memory url = concatenateStrings( - "http://localhost:19527/events/does-user-joined-evm-campaign?account=", - res - ); - string memory jsonPointer = "/hasJoined"; - HttpHeader[] memory headers = new HttpHeader[](0); - - result = GetBool(url, jsonPointer, headers); - if (result) { - break; - } - } - } - return (description, assertion_type, assertions, schema_url, result); - } -} diff --git a/contracts/Assertions/A6.sol b/contracts/Assertions/A6.sol deleted file mode 100644 index 1d2e7ec..0000000 --- a/contracts/Assertions/A6.sol +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -// SPDX-License-Identifier: GPL-3.0-or-later - -pragma solidity ^0.8.8; - -import { DynamicAssertion, Identity, HttpHeader } from "../DynamicAssertion.sol"; -import "@openzeppelin/contracts/utils/Strings.sol"; - -contract A6 is DynamicAssertion { - function execute( - Identity[] memory identities, - string[] memory secrets - ) - public - override - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ) - { - string - memory description = "The range of the user's Twitter follower count"; - string memory assertion_type = "Twitter Follower Amount"; - schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/6-twitter-follower-amount/1-0-0.json"; - - bool result; - - int64 sum = 0; - - for (uint256 i = 0; i < identities.length; i++) { - if (is_twitter(identities[i])) { - string memory url = concatenateStrings( - "http://localhost:19528/2/users/by/username/", - string(identities[i].value) - ); - string memory full_url = concatenateStrings( - url, - "?user.fields=public_metrics" - ); - - HttpHeader[] memory headers = new HttpHeader[](1); - // we expect first secret to be twitter api key - headers[0] = HttpHeader("authorization", secrets[0]); - - int64 followers_count = GetI64( - full_url, - "/data/public_metrics/followers_count", - headers - ); - - sum += followers_count; - } - } - - int64 min = 0; - int64 max = 0; - - if (sum >= 0 && sum <= 1) { - min = 0; - max = 1; - } else if (sum > 1 && sum <= 100) { - min = 1; - max = 100; - } else if (sum > 100 && sum <= 1000) { - min = 100; - max = 1000; - } else if (sum > 1000 && sum <= 10000) { - min = 1000; - max = 10000; - } else if (sum > 10000 && sum <= 100000) { - min = 10000; - max = 100000; - } else if (sum > 100000) { - min = 100000; - max = 9223372036854775807; - } - result = true; - - string memory assertion = concatenateStrings( - '{"and": [{ "src": "$total_followers", "op": ">", "dst": "', - Strings.toString(min) - ); - assertion = concatenateStrings( - assertion, - '" }, { "src": "$has_web3_account", "op": "<=", "dst": "' - ); - assertion = concatenateStrings(assertion, Strings.toString(max)); - assertion = concatenateStrings(assertion, '" } ] }'); - assertions.push(assertion); - return (description, assertion_type, assertions, schema_url, result); - } -} diff --git a/contracts/DynamicAssertion.sol b/contracts/DynamicAssertion.sol index 086a215..2783cf5 100644 --- a/contracts/DynamicAssertion.sol +++ b/contracts/DynamicAssertion.sol @@ -18,311 +18,19 @@ pragma solidity ^0.8.8; -struct Identity { - uint32 identity_type; - bytes value; - uint32[] networks; -} - -struct HttpHeader { - string name; - string value; -} +import "./libraries/Identities.sol"; abstract contract DynamicAssertion { - string[] assertions; - string schema_url; - - function execute( - Identity[] memory identities, - string[] memory secrets - ) - public - virtual - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ); - - function encode_params( - string memory url, - string memory jsonPointer - ) internal pure returns (bytes memory) { - return abi.encode(url, jsonPointer); - } - - function GetI64( - string memory url, - string memory jsonPointer, - HttpHeader[] memory headers - ) internal returns (int64) { - int64 value; - - bytes memory encoded_params = abi.encode(url, jsonPointer, headers); - uint256 encoded_params_len = encoded_params.length; - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x03E8, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x20 - ) - ) { - revert(0, 0) - } - value := mload(memPtr) - } - - return (value); - } - - function GetBool( - string memory url, - string memory jsonPointer, - HttpHeader[] memory headers - ) internal returns (bool) { - bool value; - - bytes memory encoded_params = abi.encode(url, jsonPointer, headers); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x03E9, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x20 - ) - ) { - revert(0, 0) - } - value := mload(memPtr) - } - - return (value); - } - - function concatenateStrings( - string memory a, - string memory b - ) internal pure returns (string memory) { - bytes memory concatenatedBytes = abi.encodePacked(a, b); - return string(concatenatedBytes); - } - - function toHex( - bytes memory bytes_value - ) internal returns (string memory returnVal) { - bytes memory encoded = abi.encode(bytes_value); - uint256 encoded_len = encoded.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x041B, - 0, - add(encoded, 0x20), - encoded_len, - returnVal, - 0x82 - ) - ) { - revert(0, 0) - } - } - } - - function from( - uint32 identity_type, - bytes memory value, - uint32[] memory networks - ) internal pure returns (Identity memory) { - return (Identity(identity_type, value, networks)); - } - - function is_web3( - Identity memory identity_type - ) internal pure returns (bool) { - return (is_substrate(identity_type) || - is_evm(identity_type) || - is_bitcoin(identity_type)); - } - - function is_web2( - Identity memory identity_type - ) internal pure returns (bool) { - return (is_twitter(identity_type) || - is_discord(identity_type) || - is_github(identity_type)); - } - - function is_twitter(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, 0); - } - - function is_discord(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, 1); - } - - function is_github(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, 2); - } - - function is_substrate( - Identity memory identity - ) internal pure returns (bool) { - return is_of_type(identity, 3); - } - - function is_evm(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, 4); - } - - function is_bitcoin(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, 5); - } - - function is_solana(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, 6); - } - - function is_of_type( - Identity memory identity, - uint32 identity_type - ) internal pure returns (bool) { - if (identity.identity_type == identity_type) { - return (true); - } else { - return (false); - } - } - - function has_polkadot_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 0); - } - - function has_kusama_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 1); - } - - function has_litentry_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 2); - } - - function has_litmus_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 3); - } - - function has_litentry_rococo_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 4); - } - - function has_khala_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 5); - } - - function has_substrate_testnet_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 6); - } - - function has_ethereum_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 7); - } - - function has_bsc_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 8); - } - - function has_bitcoin_p2tr_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 9); - } - - function has_bitcoin_p2pkh_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 10); - } - - function has_bitcoin_p2sh_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 11); - } - - function has_bitcoin_p2wpkh_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 12); - } - - function has_bitcoin_p2wsh_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 13); - } - - function has_polygon_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 14); - } - - function has_arbitrum_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 15); - } - - function has_solana_network( - Identity memory identity_type - ) internal pure returns (bool) { - return has_network(identity_type, 16); - } - - function has_network( - Identity memory identity_type, - uint32 network - ) internal pure returns (bool) { - for (uint256 i = 0; i < identity_type.networks.length; i++) { - if (identity_type.networks[i] == network) { - return (true); - } - } - return (false); - } + string schema_url; + + function execute(Identity[] memory identities, string[] memory secrets) + public + virtual + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ); } diff --git a/contracts/README.md b/contracts/README.md new file mode 100644 index 0000000..11752fe --- /dev/null +++ b/contracts/README.md @@ -0,0 +1 @@ +Compiled with solc 0.8.11 diff --git a/contracts/libraries/AssertionLogic.sol b/contracts/libraries/AssertionLogic.sol new file mode 100644 index 0000000..ada40ce --- /dev/null +++ b/contracts/libraries/AssertionLogic.sol @@ -0,0 +1,139 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +library AssertionLogic { + enum Op { + GreaterThan, + LessThan, + GreaterEq, + LessEq, + Equal, + NotEq + } + + struct Condition { + string src; + Op op; + string dst; + } + + struct CompositeCondition { + Condition[] conditions; + bool isAnd; // true for 'And', false for 'Or' + } + + function addCondition( + CompositeCondition memory cc, + uint256 i, + string memory src, + Op op, + string memory dst + ) internal pure { + cc.conditions[i] = Condition(src, op, dst); + } + + function andOp( + CompositeCondition memory cc, + uint256 i, + string memory src, + Op op, + string memory dst + ) internal pure returns (CompositeCondition memory) { + addCondition(cc, i, src, op, dst); + cc.isAnd = true; + return cc; + } + + function orOp( + CompositeCondition memory cc, + uint256 i, + string memory src, + Op op, + string memory dst + ) internal pure returns (CompositeCondition memory) { + addCondition(cc, i, src, op, dst); + cc.isAnd = false; + return cc; + } + + function toString(CompositeCondition memory cc) + internal + pure + returns (string memory) + { + string memory result = "{"; + + if (cc.conditions.length > 0) { + result = string( + abi.encodePacked(result, cc.isAnd ? '"and":[' : '"or":[') + ); + for (uint256 i = 0; i < cc.conditions.length; i++) { + if (i > 0) { + result = string(abi.encodePacked(result, ",")); + } + result = string( + abi.encodePacked(result, toString(cc.conditions[i])) + ); + } + result = string(abi.encodePacked(result, "]")); + } + + result = string(abi.encodePacked(result, "}")); + + return result; + } + + function toString(Condition memory condition) + internal + pure + returns (string memory) + { + return + string( + abi.encodePacked( + '{"src":"', + condition.src, + '","op":"', + operatorToString(condition.op), + '","dst":"', + condition.dst, + '"}' + ) + ); + } + + function operatorToString(Op op) internal pure returns (string memory) { + if (op == Op.Equal) { + return "=="; + } else if (op == Op.GreaterThan) { + return ">"; + } else if (op == Op.LessThan) { + return "<"; + } else if (op == Op.GreaterEq) { + return ">="; + } else if (op == Op.LessEq) { + return "<="; + } else if (op == Op.NotEq) { + return "!="; + } + + revert("Unsupported operator"); + } +} diff --git a/contracts/libraries/Http.sol b/contracts/libraries/Http.sol new file mode 100644 index 0000000..46370f4 --- /dev/null +++ b/contracts/libraries/Http.sol @@ -0,0 +1,247 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +struct HttpHeader { + string name; + string value; +} + +library Http { + function GetI64( + string memory url, + string memory jsonPointer, + HttpHeader[] memory headers + ) internal returns (bool, int64) { + bool success; + int64 value; + + bytes memory encoded_params = abi.encode(url, jsonPointer, headers); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03E8, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x40 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x40)) + } + + return (success, value); + } + + function GetBool( + string memory url, + string memory jsonPointer, + HttpHeader[] memory headers + ) internal returns (bool, bool) { + bool success; + bool value; + + bytes memory encoded_params = abi.encode(url, jsonPointer, headers); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03E9, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x40 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x40)) + } + + return (success, value); + } + + function GetString( + string memory url, + string memory jsonPointer, + HttpHeader[] memory headers + ) internal returns (bool, string memory) { + bool success; + string memory value; + + bytes memory encoded_params = abi.encode(url, jsonPointer, headers); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03EA, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x1000 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := add(memPtr, 0x40) + mstore(0x40, add(memPtr, 0x1000)) + } + + return (success, value); + } + + function PostI64( + string memory url, + string memory jsonPointer, + string memory payload, + HttpHeader[] memory headers + ) internal returns (bool, int64) { + bool success; + int64 value; + + bytes memory encoded_params = abi.encode( + url, + jsonPointer, + payload, + headers + ); + uint256 encoded_params_len = encoded_params.length; + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03EB, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x40 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x40)) + } + + return (success, value); + } + + function PostBool( + string memory url, + string memory jsonPointer, + string memory payload, + HttpHeader[] memory headers + ) internal returns (bool, bool) { + bool success; + bool value; + + bytes memory encoded_params = abi.encode( + url, + jsonPointer, + payload, + headers + ); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03EC, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x40 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x40)) + } + + return (success, value); + } + + function PostString( + string memory url, + string memory jsonPointer, + string memory payload, + HttpHeader[] memory headers + ) internal returns (bool, string memory) { + bool success; + string memory value; + + bytes memory encoded_params = abi.encode( + url, + jsonPointer, + payload, + headers + ); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03ED, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x1000 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := add(memPtr, 0x40) + mstore(0x40, add(memPtr, 0x1000)) + } + + return (success, value); + } +} diff --git a/contracts/libraries/Identities.sol b/contracts/libraries/Identities.sol new file mode 100644 index 0000000..bf79909 --- /dev/null +++ b/contracts/libraries/Identities.sol @@ -0,0 +1,295 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +struct Identity { + uint32 identity_type; + bytes value; + uint32[] networks; +} + +library IdentityTypes { + // web2 + uint32 public constant Twitter = 0; + uint32 public constant Discord = 1; + uint32 public constant Github = 2; + + // web3 + uint32 public constant Substrate = 3; + uint32 public constant Evm = 4; + uint32 public constant Bitcoin = 5; + uint32 public constant Solana = 6; +} + +library Web3Networks { + // substrate + uint32 public constant Polkadot = 0; + uint32 public constant Kusama = 1; + uint32 public constant Litentry = 2; + uint32 public constant Litmus = 3; + uint32 public constant LitentryRococo = 4; + uint32 public constant Khala = 5; + uint32 public constant SubstrateTestnet = 6; + + // evm + uint32 public constant Ethereum = 7; + uint32 public constant Bsc = 8; + uint32 public constant Polygon = 14; + uint32 public constant Arbitrum = 15; + uint32 public constant Solana = 16; + uint32 public constant Combo = 17; + + // btc + uint32 public constant BitcoinP2tr = 9; + uint32 public constant BitcoinP2pkh = 10; + uint32 public constant BitcoinP2sh = 11; + uint32 public constant BitcoinP2wpkh = 12; + uint32 public constant BitcoinP2wsh = 13; +} + +library Identities { + function from( + uint32 identity_type, + bytes memory value, + uint32[] memory networks + ) internal pure returns (Identity memory) { + return (Identity(identity_type, value, networks)); + } + + function is_web3(Identity memory identity_type) + internal + pure + returns (bool) + { + return (is_substrate(identity_type) || + is_evm(identity_type) || + is_bitcoin(identity_type)); + } + + function is_web2(Identity memory identity_type) + internal + pure + returns (bool) + { + return (is_twitter(identity_type) || + is_discord(identity_type) || + is_github(identity_type)); + } + + function is_twitter(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Twitter); + } + + function is_discord(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Discord); + } + + function is_github(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Github); + } + + function is_substrate(Identity memory identity) + internal + pure + returns (bool) + { + return is_of_type(identity, IdentityTypes.Substrate); + } + + function is_evm(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Evm); + } + + function is_bitcoin(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Bitcoin); + } + + function is_solana(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Solana); + } + + function is_of_type(Identity memory identity, uint32 identity_type) + internal + pure + returns (bool) + { + if (identity.identity_type == identity_type) { + return (true); + } else { + return (false); + } + } + + function has_polkadot_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Polkadot); + } + + function has_kusama_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Kusama); + } + + function has_litentry_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Litentry); + } + + function has_litmus_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Litmus); + } + + function has_litentry_rococo_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.LitentryRococo); + } + + function has_khala_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Khala); + } + + function has_substrate_testnet_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.SubstrateTestnet); + } + + function has_ethereum_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Ethereum); + } + + function has_bsc_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Bsc); + } + + function has_bitcoin_p2tr_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.BitcoinP2tr); + } + + function has_bitcoin_p2pkh_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.BitcoinP2pkh); + } + + function has_bitcoin_p2sh_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.BitcoinP2sh); + } + + function has_bitcoin_p2wpkh_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.BitcoinP2wpkh); + } + + function has_bitcoin_p2wsh_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.BitcoinP2wsh); + } + + function has_polygon_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Polygon); + } + + function has_arbitrum_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Arbitrum); + } + + function has_solana_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Solana); + } + + function has_combo_network(Identity memory identity_type) + internal + pure + returns (bool) + { + return has_network(identity_type, Web3Networks.Combo); + } + + function has_network(Identity memory identity_type, uint32 network) + internal + pure + returns (bool) + { + for (uint256 i = 0; i < identity_type.networks.length; i++) { + if (identity_type.networks[i] == network) { + return (true); + } + } + return (false); + } +} diff --git a/contracts/libraries/Utils.sol b/contracts/libraries/Utils.sol new file mode 100644 index 0000000..6ab2c5a --- /dev/null +++ b/contracts/libraries/Utils.sol @@ -0,0 +1,171 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +library Utils { + function toHex(bytes memory bytes_value) + internal + returns (bool success, string memory value) + { + bytes memory encoded_params = abi.encode(bytes_value); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041B, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x1000 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := add(memPtr, 0x40) + mstore(0x40, add(memPtr, 0x1000)) + } + + return (success, value); + } + + function identityToString(uint32 network_type, bytes memory identity_value) + internal + returns (bool success, string memory value) + { + bytes memory encoded_params = abi.encode(network_type, identity_value); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041C, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x1000 + ) + ) { + revert(0, 0) + } + success := memPtr + value := add(memPtr, 0x40) + mstore(0x40, add(memPtr, 0x1000)) + } + + return (success, value); + } + + function hexToNumber(string memory string_value) + internal + returns (bool success, uint256 value) + { + bytes memory encoded_params = abi.encode(string_value); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041D, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x82 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x82)) + } + + return (success, value); + } + + function parseDecimal(string memory string_value, uint8 decimals) + internal + returns (bool success, uint256 value) + { + bytes memory encoded_params = abi.encode(string_value, decimals); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041E, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x82 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x82)) + } + + return (success, value); + } + + function parseInt(string memory string_value) + internal + returns (bool success, uint256 value) + { + bytes memory encoded_params = abi.encode(string_value); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041F, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x82 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x82)) + } + + return (success, value); + } +} diff --git a/contracts/tests/GetBool.sol b/contracts/tests/GetBool.sol new file mode 100644 index 0000000..62bad35 --- /dev/null +++ b/contracts/tests/GetBool.sol @@ -0,0 +1,43 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; + +contract GetI64 { + function callGetBool(string memory url, string memory jsonPointer) + public + returns (bool, bool) + { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.GetBool(url, jsonPointer, headers); + } + + function callGetBoolTwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory secondUrl, + string memory secondJsonPointer + ) public returns (bool, bool) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.GetBool(firstUrl, firstJsonPointer, headers); + (firstUrl, firstJsonPointer, headers); + return Http.GetBool(secondUrl, secondJsonPointer, headers); + } +} diff --git a/contracts/tests/GetI64.sol b/contracts/tests/GetI64.sol new file mode 100644 index 0000000..d7e0d98 --- /dev/null +++ b/contracts/tests/GetI64.sol @@ -0,0 +1,42 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; + +contract GetI64 { + function callGetI64(string memory url, string memory jsonPointer) + public + returns (bool, int64) + { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.GetI64(url, jsonPointer, headers); + } + + function callGetI64TwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory secondUrl, + string memory secondJsonPointer + ) public returns (bool, int64) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.GetI64(firstUrl, firstJsonPointer, headers); + return Http.GetI64(secondUrl, secondJsonPointer, headers); + } +} diff --git a/contracts/tests/GetString.sol b/contracts/tests/GetString.sol new file mode 100644 index 0000000..c6a6a47 --- /dev/null +++ b/contracts/tests/GetString.sol @@ -0,0 +1,42 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; + +contract GetString { + function callGetString(string memory url, string memory jsonPointer) + public + returns (bool, string memory) + { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.GetString(url, jsonPointer, headers); + } + + function callGetStringTwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory secondUrl, + string memory secondJsonPointer + ) public returns (bool, string memory) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.GetI64(firstUrl, firstJsonPointer, headers); + return Http.GetString(secondUrl, secondJsonPointer, headers); + } +} diff --git a/contracts/tests/HexToNumber.sol b/contracts/tests/HexToNumber.sol new file mode 100644 index 0000000..7161bd1 --- /dev/null +++ b/contracts/tests/HexToNumber.sol @@ -0,0 +1,30 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Utils.sol"; + +contract HexToNumber { + function callHexToNumber(string memory text) + public + returns (bool, uint256) + { + return Utils.hexToNumber(text); + } +} diff --git a/contracts/tests/IdentityToString.sol b/contracts/tests/IdentityToString.sol new file mode 100644 index 0000000..f934dd8 --- /dev/null +++ b/contracts/tests/IdentityToString.sol @@ -0,0 +1,30 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Utils.sol"; + +contract IdentityToString { + function callIdentityToString( + uint32 network_type, + bytes memory identity_value + ) public returns (bool, string memory) { + return Utils.identityToString(network_type, identity_value); + } +} diff --git a/contracts/tests/ParseDecimal.sol b/contracts/tests/ParseDecimal.sol new file mode 100644 index 0000000..81c9b05 --- /dev/null +++ b/contracts/tests/ParseDecimal.sol @@ -0,0 +1,30 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Utils.sol"; + +contract ParseDecimal { + function callParseDecimal(string memory text, uint8 decimals) + public + returns (bool, uint256) + { + return Utils.parseDecimal(text, decimals); + } +} diff --git a/contracts/tests/ParseInt.sol b/contracts/tests/ParseInt.sol new file mode 100644 index 0000000..bc2dc94 --- /dev/null +++ b/contracts/tests/ParseInt.sol @@ -0,0 +1,27 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Utils.sol"; + +contract ParseInt { + function callParseInt(string memory text) public returns (bool, uint256) { + return Utils.parseInt(text); + } +} diff --git a/contracts/tests/PostBool.sol b/contracts/tests/PostBool.sol new file mode 100644 index 0000000..825da42 --- /dev/null +++ b/contracts/tests/PostBool.sol @@ -0,0 +1,46 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; + +contract PostBool { + function callPostBool( + string memory url, + string memory jsonPointer, + string memory payload + ) public returns (bool, bool) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.PostBool(url, jsonPointer, payload, headers); + } + + function callPostBoolTwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory firstPayload, + string memory secondUrl, + string memory secondJsonPointer, + string memory secondPayload + ) public returns (bool, bool) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.PostBool(firstUrl, firstJsonPointer, firstPayload, headers); + return + Http.PostBool(secondUrl, secondJsonPointer, secondPayload, headers); + } +} diff --git a/contracts/tests/PostI64.sol b/contracts/tests/PostI64.sol new file mode 100644 index 0000000..fcd0012 --- /dev/null +++ b/contracts/tests/PostI64.sol @@ -0,0 +1,46 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; + +contract PostI64 { + function callPostI64( + string memory url, + string memory jsonPointer, + string memory payload + ) public returns (bool, int64) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.PostI64(url, jsonPointer, payload, headers); + } + + function callPostI64TwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory firstPayload, + string memory secondUrl, + string memory secondJsonPointer, + string memory secondPayload + ) public returns (bool, int64) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.PostI64(firstUrl, firstJsonPointer, firstPayload, headers); + return + Http.PostI64(secondUrl, secondJsonPointer, secondPayload, headers); + } +} diff --git a/contracts/tests/PostString.sol b/contracts/tests/PostString.sol new file mode 100644 index 0000000..195222a --- /dev/null +++ b/contracts/tests/PostString.sol @@ -0,0 +1,51 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; + +contract PostString { + function callPostString( + string memory url, + string memory jsonPointer, + string memory payload + ) public returns (bool, string memory) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.PostString(url, jsonPointer, payload, headers); + } + + function callPostStringTwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory firstPayload, + string memory secondUrl, + string memory secondJsonPointer, + string memory secondPayload + ) public returns (bool, string memory) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.PostString(firstUrl, firstJsonPointer, firstPayload, headers); + return + Http.PostString( + secondUrl, + secondJsonPointer, + secondPayload, + headers + ); + } +} diff --git a/contracts/tests/README.md b/contracts/tests/README.md new file mode 100644 index 0000000..952e29e --- /dev/null +++ b/contracts/tests/README.md @@ -0,0 +1,2 @@ +This folder contains Solidity smart contracts used for testing integration between `DynamicAssertion.sol` and runtime precompiles. +Smart contract exposes function to call `DynamicAssertion.sol` functions with arbitrary data. Results can be used in test cases to assert integration correctness. diff --git a/contracts/tests/ToHex.sol b/contracts/tests/ToHex.sol new file mode 100644 index 0000000..4c80629 --- /dev/null +++ b/contracts/tests/ToHex.sol @@ -0,0 +1,30 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Utils.sol"; + +contract ToHex { + function callToHex(string memory text) + public + returns (bool, string memory) + { + return Utils.toHex(bytes(text)); + } +} diff --git a/contracts/token_holding_amount/BRC20.sol b/contracts/token_holding_amount/BRC20.sol new file mode 100644 index 0000000..4f6af27 --- /dev/null +++ b/contracts/token_holding_amount/BRC20.sol @@ -0,0 +1,82 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Identities.sol"; +import "../libraries/Http.sol"; +import "../libraries/Utils.sol"; +import {TokenHoldingAmount} from "./TokenHoldingAmount.sol"; + +abstract contract BRC20 is TokenHoldingAmount { + function getTokenDecimals() internal pure override returns (uint8) { + return 18; + } + + function queryBalance( + Identity memory identity, + uint32 network, + string[] memory secrets + ) internal virtual override returns (uint256) { + (bool identityToStringSuccess, string memory identityString) = Utils + .identityToString(network, identity.value); + if (identityToStringSuccess) { + // https://geniidata.readme.io/reference/get-brc20-tick-list-copy + string memory url = string( + abi.encodePacked( + "https://api.geniidata.com/api/1/brc20/balance", + // below url is used for test against mock server + // "http://localhost:19529/api/1/brc20/balance", + "?tick=", + getTokenName(), + "&address=", + identityString + ) + ); + + HttpHeader[] memory headers = new HttpHeader[](1); + headers[0] = HttpHeader("api-key", secrets[0]); + + (bool success, string memory value) = Http.GetString( + url, + "/data/list/0/available_balance", + headers + ); + + if (success) { + (bool parseDecimalSuccess, uint256 result) = Utils.parseDecimal( + value, + getTokenDecimals() + ); + if (parseDecimalSuccess) { + return result; + } + } + } + return 0; + } + + function isSupportedNetwork(uint32 network) + internal + pure + override + returns (bool) + { + return network == Web3Networks.BitcoinP2tr; + } +} diff --git a/contracts/token_holding_amount/BlockchainInfoClient.sol b/contracts/token_holding_amount/BlockchainInfoClient.sol new file mode 100644 index 0000000..17a27c5 --- /dev/null +++ b/contracts/token_holding_amount/BlockchainInfoClient.sol @@ -0,0 +1,49 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; +import "../libraries/Utils.sol"; + +library BlockchainInfoClient { + function getMultiAddress(string memory url, string[] memory accounts) + internal + returns (bool, int64) + { + string memory activeQueryParam = ""; + + for (uint256 i = 0; i < accounts.length; i++) { + activeQueryParam = string( + abi.encodePacked(activeQueryParam, accounts[i]) + ); + if (i != accounts.length - 1) { + activeQueryParam = string( + abi.encodePacked(activeQueryParam, "|") + ); + } + } + + url = string( + abi.encodePacked(url, "?active=", activeQueryParam, "&n=", "0") + ); + + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.GetI64(url, "/wallet/final_balance", headers); + } +} diff --git a/contracts/token_holding_amount/NoderealClient.sol b/contracts/token_holding_amount/NoderealClient.sol new file mode 100644 index 0000000..a86a216 --- /dev/null +++ b/contracts/token_holding_amount/NoderealClient.sol @@ -0,0 +1,77 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; +import "../libraries/Utils.sol"; + +library NoderealClient { + function getEthBalance(string memory url, string memory account) + internal + returns (bool, uint256) + { + HttpHeader[] memory headers = new HttpHeader[](0); + string memory request = string( + abi.encodePacked( + '{"jsonrpc": "2.0", "method": "eth_getBalance", "id": 1, "params": ["', + account, + '", "latest"]}' + ) + ); + (bool result, string memory balance) = Http.PostString( + url, + "/result", + request, + headers + ); + if (result) { + return Utils.hexToNumber(balance); + } else { + return (false, 0); + } + } + + function getErc20Balance( + string memory url, + string memory tokenContractAddress, + string memory account + ) internal returns (bool, uint256) { + HttpHeader[] memory headers = new HttpHeader[](0); + string memory request = string( + abi.encodePacked( + '{"jsonrpc": "2.0", "method": "nr_getTokenBalance20", "id": 1, "params": ["', + tokenContractAddress, + '","', + account, + '", "latest"]}' + ) + ); + (bool result, string memory balance) = Http.PostString( + url, + "/result", + request, + headers + ); + if (result) { + return Utils.hexToNumber(balance); + } else { + return (false, 0); + } + } +} diff --git a/hardhat.config.ts b/hardhat.config.ts index e289017..712c017 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/config" import "@nomicfoundation/hardhat-toolbox" const config: HardhatUserConfig = { - solidity: "0.8.8", + solidity: "0.8.11", } export default config From bb5fe06fce1bffb86e3c4efcd479b9613a488881 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Thu, 13 Jun 2024 11:42:57 +0800 Subject: [PATCH 16/23] fmt --- contracts/DynamicAssertion.sol | 25 +- contracts/libraries/AssertionLogic.sol | 206 ++++---- contracts/libraries/Http.sol | 444 ++++++++-------- contracts/libraries/Identities.sol | 484 ++++++++---------- contracts/libraries/Utils.sol | 295 ++++++----- contracts/tests/GetBool.sol | 36 +- contracts/tests/GetI64.sol | 34 +- contracts/tests/GetString.sol | 34 +- contracts/tests/HexToNumber.sol | 11 +- contracts/tests/IdentityToString.sol | 12 +- contracts/tests/ParseDecimal.sol | 12 +- contracts/tests/ParseInt.sol | 6 +- contracts/tests/PostBool.sol | 42 +- contracts/tests/PostI64.sol | 42 +- contracts/tests/PostString.sol | 52 +- contracts/tests/ToHex.sol | 11 +- contracts/token_holding_amount/BRC20.sol | 99 ++-- .../BlockchainInfoClient.sol | 42 +- .../token_holding_amount/NativeToken.sol | 77 +++ .../token_holding_amount/NoderealClient.sol | 102 ++-- .../TokenHoldingAmount.sol | 270 +++++----- contracts/token_holding_amount/tokens/BNB.sol | 48 ++ .../token_holding_amount/tokens/Btcs.sol | 44 +- .../token_holding_amount/tokens/Cats.sol | 42 +- .../token_holding_amount/tokens/Long.sol | 44 +- .../token_holding_amount/tokens/Mmss.sol | 44 +- .../token_holding_amount/tokens/Ordi.sol | 42 +- .../token_holding_amount/tokens/Rats.sol | 44 +- .../token_holding_amount/tokens/Sats.sol | 44 +- 29 files changed, 1377 insertions(+), 1311 deletions(-) create mode 100644 contracts/token_holding_amount/NativeToken.sol create mode 100644 contracts/token_holding_amount/tokens/BNB.sol diff --git a/contracts/DynamicAssertion.sol b/contracts/DynamicAssertion.sol index 2783cf5..f062ca7 100644 --- a/contracts/DynamicAssertion.sol +++ b/contracts/DynamicAssertion.sol @@ -21,16 +21,19 @@ pragma solidity ^0.8.8; import "./libraries/Identities.sol"; abstract contract DynamicAssertion { - string schema_url; + string schema_url; - function execute(Identity[] memory identities, string[] memory secrets) - public - virtual - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ); + function execute( + Identity[] memory identities, + string[] memory secrets + ) + public + virtual + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ); } diff --git a/contracts/libraries/AssertionLogic.sol b/contracts/libraries/AssertionLogic.sol index ada40ce..6c279ef 100644 --- a/contracts/libraries/AssertionLogic.sol +++ b/contracts/libraries/AssertionLogic.sol @@ -19,121 +19,117 @@ pragma solidity ^0.8.8; library AssertionLogic { - enum Op { - GreaterThan, - LessThan, - GreaterEq, - LessEq, - Equal, - NotEq - } + enum Op { + GreaterThan, + LessThan, + GreaterEq, + LessEq, + Equal, + NotEq + } - struct Condition { - string src; - Op op; - string dst; - } + struct Condition { + string src; + Op op; + string dst; + } - struct CompositeCondition { - Condition[] conditions; - bool isAnd; // true for 'And', false for 'Or' - } + struct CompositeCondition { + Condition[] conditions; + bool isAnd; // true for 'And', false for 'Or' + } - function addCondition( - CompositeCondition memory cc, - uint256 i, - string memory src, - Op op, - string memory dst - ) internal pure { - cc.conditions[i] = Condition(src, op, dst); - } + function addCondition( + CompositeCondition memory cc, + uint256 i, + string memory src, + Op op, + string memory dst + ) internal pure { + cc.conditions[i] = Condition(src, op, dst); + } - function andOp( - CompositeCondition memory cc, - uint256 i, - string memory src, - Op op, - string memory dst - ) internal pure returns (CompositeCondition memory) { - addCondition(cc, i, src, op, dst); - cc.isAnd = true; - return cc; - } + function andOp( + CompositeCondition memory cc, + uint256 i, + string memory src, + Op op, + string memory dst + ) internal pure returns (CompositeCondition memory) { + addCondition(cc, i, src, op, dst); + cc.isAnd = true; + return cc; + } - function orOp( - CompositeCondition memory cc, - uint256 i, - string memory src, - Op op, - string memory dst - ) internal pure returns (CompositeCondition memory) { - addCondition(cc, i, src, op, dst); - cc.isAnd = false; - return cc; - } + function orOp( + CompositeCondition memory cc, + uint256 i, + string memory src, + Op op, + string memory dst + ) internal pure returns (CompositeCondition memory) { + addCondition(cc, i, src, op, dst); + cc.isAnd = false; + return cc; + } - function toString(CompositeCondition memory cc) - internal - pure - returns (string memory) - { - string memory result = "{"; + function toString( + CompositeCondition memory cc + ) internal pure returns (string memory) { + string memory result = "{"; - if (cc.conditions.length > 0) { - result = string( - abi.encodePacked(result, cc.isAnd ? '"and":[' : '"or":[') - ); - for (uint256 i = 0; i < cc.conditions.length; i++) { - if (i > 0) { - result = string(abi.encodePacked(result, ",")); - } - result = string( - abi.encodePacked(result, toString(cc.conditions[i])) - ); - } - result = string(abi.encodePacked(result, "]")); - } + if (cc.conditions.length > 0) { + result = string( + abi.encodePacked(result, cc.isAnd ? '"and":[' : '"or":[') + ); + for (uint256 i = 0; i < cc.conditions.length; i++) { + if (i > 0) { + result = string(abi.encodePacked(result, ",")); + } + result = string( + abi.encodePacked(result, toString(cc.conditions[i])) + ); + } + result = string(abi.encodePacked(result, "]")); + } - result = string(abi.encodePacked(result, "}")); + result = string(abi.encodePacked(result, "}")); - return result; - } + return result; + } - function toString(Condition memory condition) - internal - pure - returns (string memory) - { - return - string( - abi.encodePacked( - '{"src":"', - condition.src, - '","op":"', - operatorToString(condition.op), - '","dst":"', - condition.dst, - '"}' - ) - ); - } + function toString( + Condition memory condition + ) internal pure returns (string memory) { + return + string( + abi.encodePacked( + '{"src":"', + condition.src, + '","op":"', + operatorToString(condition.op), + '","dst":"', + condition.dst, + '"}' + ) + ); + } - function operatorToString(Op op) internal pure returns (string memory) { - if (op == Op.Equal) { - return "=="; - } else if (op == Op.GreaterThan) { - return ">"; - } else if (op == Op.LessThan) { - return "<"; - } else if (op == Op.GreaterEq) { - return ">="; - } else if (op == Op.LessEq) { - return "<="; - } else if (op == Op.NotEq) { - return "!="; - } + function operatorToString(Op op) internal pure returns (string memory) { + if (op == Op.Equal) { + return "=="; + } else if (op == Op.GreaterThan) { + return ">"; + } else if (op == Op.LessThan) { + return "<"; + } else if (op == Op.GreaterEq) { + return ">="; + } else if (op == Op.LessEq) { + return "<="; + } else if (op == Op.NotEq) { + return "!="; + } - revert("Unsupported operator"); - } + revert("Unsupported operator"); + } } diff --git a/contracts/libraries/Http.sol b/contracts/libraries/Http.sol index 46370f4..688874e 100644 --- a/contracts/libraries/Http.sol +++ b/contracts/libraries/Http.sol @@ -19,229 +19,229 @@ pragma solidity ^0.8.8; struct HttpHeader { - string name; - string value; + string name; + string value; } library Http { - function GetI64( - string memory url, - string memory jsonPointer, - HttpHeader[] memory headers - ) internal returns (bool, int64) { - bool success; - int64 value; - - bytes memory encoded_params = abi.encode(url, jsonPointer, headers); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x03E8, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x40 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := mload(add(memPtr, 0x20)) - mstore(0x40, add(memPtr, 0x40)) - } - - return (success, value); - } - - function GetBool( - string memory url, - string memory jsonPointer, - HttpHeader[] memory headers - ) internal returns (bool, bool) { - bool success; - bool value; - - bytes memory encoded_params = abi.encode(url, jsonPointer, headers); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x03E9, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x40 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := mload(add(memPtr, 0x20)) - mstore(0x40, add(memPtr, 0x40)) - } - - return (success, value); - } - - function GetString( - string memory url, - string memory jsonPointer, - HttpHeader[] memory headers - ) internal returns (bool, string memory) { - bool success; - string memory value; - - bytes memory encoded_params = abi.encode(url, jsonPointer, headers); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x03EA, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x1000 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := add(memPtr, 0x40) - mstore(0x40, add(memPtr, 0x1000)) - } - - return (success, value); - } - - function PostI64( - string memory url, - string memory jsonPointer, - string memory payload, - HttpHeader[] memory headers - ) internal returns (bool, int64) { - bool success; - int64 value; - - bytes memory encoded_params = abi.encode( - url, - jsonPointer, - payload, - headers - ); - uint256 encoded_params_len = encoded_params.length; - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x03EB, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x40 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := mload(add(memPtr, 0x20)) - mstore(0x40, add(memPtr, 0x40)) - } - - return (success, value); - } - - function PostBool( - string memory url, - string memory jsonPointer, - string memory payload, - HttpHeader[] memory headers - ) internal returns (bool, bool) { - bool success; - bool value; - - bytes memory encoded_params = abi.encode( - url, - jsonPointer, - payload, - headers - ); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x03EC, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x40 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := mload(add(memPtr, 0x20)) - mstore(0x40, add(memPtr, 0x40)) - } - - return (success, value); - } - - function PostString( - string memory url, - string memory jsonPointer, - string memory payload, - HttpHeader[] memory headers - ) internal returns (bool, string memory) { - bool success; - string memory value; - - bytes memory encoded_params = abi.encode( - url, - jsonPointer, - payload, - headers - ); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x03ED, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x1000 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := add(memPtr, 0x40) - mstore(0x40, add(memPtr, 0x1000)) - } - - return (success, value); - } + function GetI64( + string memory url, + string memory jsonPointer, + HttpHeader[] memory headers + ) internal returns (bool, int64) { + bool success; + int64 value; + + bytes memory encoded_params = abi.encode(url, jsonPointer, headers); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03E8, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x40 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x40)) + } + + return (success, value); + } + + function GetBool( + string memory url, + string memory jsonPointer, + HttpHeader[] memory headers + ) internal returns (bool, bool) { + bool success; + bool value; + + bytes memory encoded_params = abi.encode(url, jsonPointer, headers); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03E9, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x40 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x40)) + } + + return (success, value); + } + + function GetString( + string memory url, + string memory jsonPointer, + HttpHeader[] memory headers + ) internal returns (bool, string memory) { + bool success; + string memory value; + + bytes memory encoded_params = abi.encode(url, jsonPointer, headers); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03EA, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x1000 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := add(memPtr, 0x40) + mstore(0x40, add(memPtr, 0x1000)) + } + + return (success, value); + } + + function PostI64( + string memory url, + string memory jsonPointer, + string memory payload, + HttpHeader[] memory headers + ) internal returns (bool, int64) { + bool success; + int64 value; + + bytes memory encoded_params = abi.encode( + url, + jsonPointer, + payload, + headers + ); + uint256 encoded_params_len = encoded_params.length; + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03EB, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x40 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x40)) + } + + return (success, value); + } + + function PostBool( + string memory url, + string memory jsonPointer, + string memory payload, + HttpHeader[] memory headers + ) internal returns (bool, bool) { + bool success; + bool value; + + bytes memory encoded_params = abi.encode( + url, + jsonPointer, + payload, + headers + ); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03EC, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x40 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x40)) + } + + return (success, value); + } + + function PostString( + string memory url, + string memory jsonPointer, + string memory payload, + HttpHeader[] memory headers + ) internal returns (bool, string memory) { + bool success; + string memory value; + + bytes memory encoded_params = abi.encode( + url, + jsonPointer, + payload, + headers + ); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x03ED, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x1000 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := add(memPtr, 0x40) + mstore(0x40, add(memPtr, 0x1000)) + } + + return (success, value); + } } diff --git a/contracts/libraries/Identities.sol b/contracts/libraries/Identities.sol index bf79909..1873617 100644 --- a/contracts/libraries/Identities.sol +++ b/contracts/libraries/Identities.sol @@ -19,277 +19,233 @@ pragma solidity ^0.8.8; struct Identity { - uint32 identity_type; - bytes value; - uint32[] networks; + uint32 identity_type; + bytes value; + uint32[] networks; } library IdentityTypes { - // web2 - uint32 public constant Twitter = 0; - uint32 public constant Discord = 1; - uint32 public constant Github = 2; - - // web3 - uint32 public constant Substrate = 3; - uint32 public constant Evm = 4; - uint32 public constant Bitcoin = 5; - uint32 public constant Solana = 6; + // web2 + uint32 public constant Twitter = 0; + uint32 public constant Discord = 1; + uint32 public constant Github = 2; + + // web3 + uint32 public constant Substrate = 3; + uint32 public constant Evm = 4; + uint32 public constant Bitcoin = 5; + uint32 public constant Solana = 6; } library Web3Networks { - // substrate - uint32 public constant Polkadot = 0; - uint32 public constant Kusama = 1; - uint32 public constant Litentry = 2; - uint32 public constant Litmus = 3; - uint32 public constant LitentryRococo = 4; - uint32 public constant Khala = 5; - uint32 public constant SubstrateTestnet = 6; - - // evm - uint32 public constant Ethereum = 7; - uint32 public constant Bsc = 8; - uint32 public constant Polygon = 14; - uint32 public constant Arbitrum = 15; - uint32 public constant Solana = 16; - uint32 public constant Combo = 17; - - // btc - uint32 public constant BitcoinP2tr = 9; - uint32 public constant BitcoinP2pkh = 10; - uint32 public constant BitcoinP2sh = 11; - uint32 public constant BitcoinP2wpkh = 12; - uint32 public constant BitcoinP2wsh = 13; + // substrate + uint32 public constant Polkadot = 0; + uint32 public constant Kusama = 1; + uint32 public constant Litentry = 2; + uint32 public constant Litmus = 3; + uint32 public constant LitentryRococo = 4; + uint32 public constant Khala = 5; + uint32 public constant SubstrateTestnet = 6; + + // evm + uint32 public constant Ethereum = 7; + uint32 public constant Bsc = 8; + uint32 public constant Polygon = 14; + uint32 public constant Arbitrum = 15; + uint32 public constant Solana = 16; + uint32 public constant Combo = 17; + + // btc + uint32 public constant BitcoinP2tr = 9; + uint32 public constant BitcoinP2pkh = 10; + uint32 public constant BitcoinP2sh = 11; + uint32 public constant BitcoinP2wpkh = 12; + uint32 public constant BitcoinP2wsh = 13; } library Identities { - function from( - uint32 identity_type, - bytes memory value, - uint32[] memory networks - ) internal pure returns (Identity memory) { - return (Identity(identity_type, value, networks)); - } - - function is_web3(Identity memory identity_type) - internal - pure - returns (bool) - { - return (is_substrate(identity_type) || - is_evm(identity_type) || - is_bitcoin(identity_type)); - } - - function is_web2(Identity memory identity_type) - internal - pure - returns (bool) - { - return (is_twitter(identity_type) || - is_discord(identity_type) || - is_github(identity_type)); - } - - function is_twitter(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, IdentityTypes.Twitter); - } - - function is_discord(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, IdentityTypes.Discord); - } - - function is_github(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, IdentityTypes.Github); - } - - function is_substrate(Identity memory identity) - internal - pure - returns (bool) - { - return is_of_type(identity, IdentityTypes.Substrate); - } - - function is_evm(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, IdentityTypes.Evm); - } - - function is_bitcoin(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, IdentityTypes.Bitcoin); - } - - function is_solana(Identity memory identity) internal pure returns (bool) { - return is_of_type(identity, IdentityTypes.Solana); - } - - function is_of_type(Identity memory identity, uint32 identity_type) - internal - pure - returns (bool) - { - if (identity.identity_type == identity_type) { - return (true); - } else { - return (false); - } - } - - function has_polkadot_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Polkadot); - } - - function has_kusama_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Kusama); - } - - function has_litentry_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Litentry); - } - - function has_litmus_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Litmus); - } - - function has_litentry_rococo_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.LitentryRococo); - } - - function has_khala_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Khala); - } - - function has_substrate_testnet_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.SubstrateTestnet); - } - - function has_ethereum_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Ethereum); - } - - function has_bsc_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Bsc); - } - - function has_bitcoin_p2tr_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.BitcoinP2tr); - } - - function has_bitcoin_p2pkh_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.BitcoinP2pkh); - } - - function has_bitcoin_p2sh_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.BitcoinP2sh); - } - - function has_bitcoin_p2wpkh_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.BitcoinP2wpkh); - } - - function has_bitcoin_p2wsh_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.BitcoinP2wsh); - } - - function has_polygon_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Polygon); - } - - function has_arbitrum_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Arbitrum); - } - - function has_solana_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Solana); - } - - function has_combo_network(Identity memory identity_type) - internal - pure - returns (bool) - { - return has_network(identity_type, Web3Networks.Combo); - } - - function has_network(Identity memory identity_type, uint32 network) - internal - pure - returns (bool) - { - for (uint256 i = 0; i < identity_type.networks.length; i++) { - if (identity_type.networks[i] == network) { - return (true); - } - } - return (false); - } + function from( + uint32 identity_type, + bytes memory value, + uint32[] memory networks + ) internal pure returns (Identity memory) { + return (Identity(identity_type, value, networks)); + } + + function is_web3( + Identity memory identity_type + ) internal pure returns (bool) { + return (is_substrate(identity_type) || + is_evm(identity_type) || + is_bitcoin(identity_type)); + } + + function is_web2( + Identity memory identity_type + ) internal pure returns (bool) { + return (is_twitter(identity_type) || + is_discord(identity_type) || + is_github(identity_type)); + } + + function is_twitter(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Twitter); + } + + function is_discord(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Discord); + } + + function is_github(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Github); + } + + function is_substrate( + Identity memory identity + ) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Substrate); + } + + function is_evm(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Evm); + } + + function is_bitcoin(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Bitcoin); + } + + function is_solana(Identity memory identity) internal pure returns (bool) { + return is_of_type(identity, IdentityTypes.Solana); + } + + function is_of_type( + Identity memory identity, + uint32 identity_type + ) internal pure returns (bool) { + if (identity.identity_type == identity_type) { + return (true); + } else { + return (false); + } + } + + function has_polkadot_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Polkadot); + } + + function has_kusama_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Kusama); + } + + function has_litentry_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Litentry); + } + + function has_litmus_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Litmus); + } + + function has_litentry_rococo_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.LitentryRococo); + } + + function has_khala_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Khala); + } + + function has_substrate_testnet_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.SubstrateTestnet); + } + + function has_ethereum_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Ethereum); + } + + function has_bsc_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Bsc); + } + + function has_bitcoin_p2tr_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.BitcoinP2tr); + } + + function has_bitcoin_p2pkh_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.BitcoinP2pkh); + } + + function has_bitcoin_p2sh_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.BitcoinP2sh); + } + + function has_bitcoin_p2wpkh_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.BitcoinP2wpkh); + } + + function has_bitcoin_p2wsh_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.BitcoinP2wsh); + } + + function has_polygon_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Polygon); + } + + function has_arbitrum_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Arbitrum); + } + + function has_solana_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Solana); + } + + function has_combo_network( + Identity memory identity_type + ) internal pure returns (bool) { + return has_network(identity_type, Web3Networks.Combo); + } + + function has_network( + Identity memory identity_type, + uint32 network + ) internal pure returns (bool) { + for (uint256 i = 0; i < identity_type.networks.length; i++) { + if (identity_type.networks[i] == network) { + return (true); + } + } + return (false); + } } diff --git a/contracts/libraries/Utils.sol b/contracts/libraries/Utils.sol index 6ab2c5a..249861c 100644 --- a/contracts/libraries/Utils.sol +++ b/contracts/libraries/Utils.sol @@ -19,153 +19,150 @@ pragma solidity ^0.8.8; library Utils { - function toHex(bytes memory bytes_value) - internal - returns (bool success, string memory value) - { - bytes memory encoded_params = abi.encode(bytes_value); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x041B, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x1000 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := add(memPtr, 0x40) - mstore(0x40, add(memPtr, 0x1000)) - } - - return (success, value); - } - - function identityToString(uint32 network_type, bytes memory identity_value) - internal - returns (bool success, string memory value) - { - bytes memory encoded_params = abi.encode(network_type, identity_value); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x041C, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x1000 - ) - ) { - revert(0, 0) - } - success := memPtr - value := add(memPtr, 0x40) - mstore(0x40, add(memPtr, 0x1000)) - } - - return (success, value); - } - - function hexToNumber(string memory string_value) - internal - returns (bool success, uint256 value) - { - bytes memory encoded_params = abi.encode(string_value); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x041D, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x82 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := mload(add(memPtr, 0x20)) - mstore(0x40, add(memPtr, 0x82)) - } - - return (success, value); - } - - function parseDecimal(string memory string_value, uint8 decimals) - internal - returns (bool success, uint256 value) - { - bytes memory encoded_params = abi.encode(string_value, decimals); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x041E, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x82 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := mload(add(memPtr, 0x20)) - mstore(0x40, add(memPtr, 0x82)) - } - - return (success, value); - } - - function parseInt(string memory string_value) - internal - returns (bool success, uint256 value) - { - bytes memory encoded_params = abi.encode(string_value); - uint256 encoded_params_len = encoded_params.length; - - assembly { - let memPtr := mload(0x40) - if iszero( - call( - not(0), - 0x041F, - 0, - add(encoded_params, 0x20), - encoded_params_len, - memPtr, - 0x82 - ) - ) { - revert(0, 0) - } - success := mload(memPtr) - value := mload(add(memPtr, 0x20)) - mstore(0x40, add(memPtr, 0x82)) - } - - return (success, value); - } + function toHex( + bytes memory bytes_value + ) internal returns (bool success, string memory value) { + bytes memory encoded_params = abi.encode(bytes_value); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041B, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x1000 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := add(memPtr, 0x40) + mstore(0x40, add(memPtr, 0x1000)) + } + + return (success, value); + } + + function identityToString( + uint32 network_type, + bytes memory identity_value + ) internal returns (bool success, string memory value) { + bytes memory encoded_params = abi.encode(network_type, identity_value); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041C, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x1000 + ) + ) { + revert(0, 0) + } + success := memPtr + value := add(memPtr, 0x40) + mstore(0x40, add(memPtr, 0x1000)) + } + + return (success, value); + } + + function hexToNumber( + string memory string_value + ) internal returns (bool success, uint256 value) { + bytes memory encoded_params = abi.encode(string_value); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041D, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x82 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x82)) + } + + return (success, value); + } + + function parseDecimal( + string memory string_value, + uint8 decimals + ) internal returns (bool success, uint256 value) { + bytes memory encoded_params = abi.encode(string_value, decimals); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041E, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x82 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x82)) + } + + return (success, value); + } + + function parseInt( + string memory string_value + ) internal returns (bool success, uint256 value) { + bytes memory encoded_params = abi.encode(string_value); + uint256 encoded_params_len = encoded_params.length; + + assembly { + let memPtr := mload(0x40) + if iszero( + call( + not(0), + 0x041F, + 0, + add(encoded_params, 0x20), + encoded_params_len, + memPtr, + 0x82 + ) + ) { + revert(0, 0) + } + success := mload(memPtr) + value := mload(add(memPtr, 0x20)) + mstore(0x40, add(memPtr, 0x82)) + } + + return (success, value); + } } diff --git a/contracts/tests/GetBool.sol b/contracts/tests/GetBool.sol index 62bad35..b43c1d8 100644 --- a/contracts/tests/GetBool.sol +++ b/contracts/tests/GetBool.sol @@ -21,23 +21,23 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; contract GetI64 { - function callGetBool(string memory url, string memory jsonPointer) - public - returns (bool, bool) - { - HttpHeader[] memory headers = new HttpHeader[](0); - return Http.GetBool(url, jsonPointer, headers); - } + function callGetBool( + string memory url, + string memory jsonPointer + ) public returns (bool, bool) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.GetBool(url, jsonPointer, headers); + } - function callGetBoolTwiceAndReturnSecondResult( - string memory firstUrl, - string memory firstJsonPointer, - string memory secondUrl, - string memory secondJsonPointer - ) public returns (bool, bool) { - HttpHeader[] memory headers = new HttpHeader[](0); - Http.GetBool(firstUrl, firstJsonPointer, headers); - (firstUrl, firstJsonPointer, headers); - return Http.GetBool(secondUrl, secondJsonPointer, headers); - } + function callGetBoolTwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory secondUrl, + string memory secondJsonPointer + ) public returns (bool, bool) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.GetBool(firstUrl, firstJsonPointer, headers); + (firstUrl, firstJsonPointer, headers); + return Http.GetBool(secondUrl, secondJsonPointer, headers); + } } diff --git a/contracts/tests/GetI64.sol b/contracts/tests/GetI64.sol index d7e0d98..70b2243 100644 --- a/contracts/tests/GetI64.sol +++ b/contracts/tests/GetI64.sol @@ -21,22 +21,22 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; contract GetI64 { - function callGetI64(string memory url, string memory jsonPointer) - public - returns (bool, int64) - { - HttpHeader[] memory headers = new HttpHeader[](0); - return Http.GetI64(url, jsonPointer, headers); - } + function callGetI64( + string memory url, + string memory jsonPointer + ) public returns (bool, int64) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.GetI64(url, jsonPointer, headers); + } - function callGetI64TwiceAndReturnSecondResult( - string memory firstUrl, - string memory firstJsonPointer, - string memory secondUrl, - string memory secondJsonPointer - ) public returns (bool, int64) { - HttpHeader[] memory headers = new HttpHeader[](0); - Http.GetI64(firstUrl, firstJsonPointer, headers); - return Http.GetI64(secondUrl, secondJsonPointer, headers); - } + function callGetI64TwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory secondUrl, + string memory secondJsonPointer + ) public returns (bool, int64) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.GetI64(firstUrl, firstJsonPointer, headers); + return Http.GetI64(secondUrl, secondJsonPointer, headers); + } } diff --git a/contracts/tests/GetString.sol b/contracts/tests/GetString.sol index c6a6a47..1abaa59 100644 --- a/contracts/tests/GetString.sol +++ b/contracts/tests/GetString.sol @@ -21,22 +21,22 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; contract GetString { - function callGetString(string memory url, string memory jsonPointer) - public - returns (bool, string memory) - { - HttpHeader[] memory headers = new HttpHeader[](0); - return Http.GetString(url, jsonPointer, headers); - } + function callGetString( + string memory url, + string memory jsonPointer + ) public returns (bool, string memory) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.GetString(url, jsonPointer, headers); + } - function callGetStringTwiceAndReturnSecondResult( - string memory firstUrl, - string memory firstJsonPointer, - string memory secondUrl, - string memory secondJsonPointer - ) public returns (bool, string memory) { - HttpHeader[] memory headers = new HttpHeader[](0); - Http.GetI64(firstUrl, firstJsonPointer, headers); - return Http.GetString(secondUrl, secondJsonPointer, headers); - } + function callGetStringTwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory secondUrl, + string memory secondJsonPointer + ) public returns (bool, string memory) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.GetI64(firstUrl, firstJsonPointer, headers); + return Http.GetString(secondUrl, secondJsonPointer, headers); + } } diff --git a/contracts/tests/HexToNumber.sol b/contracts/tests/HexToNumber.sol index 7161bd1..91487cc 100644 --- a/contracts/tests/HexToNumber.sol +++ b/contracts/tests/HexToNumber.sol @@ -21,10 +21,9 @@ pragma solidity ^0.8.8; import "../libraries/Utils.sol"; contract HexToNumber { - function callHexToNumber(string memory text) - public - returns (bool, uint256) - { - return Utils.hexToNumber(text); - } + function callHexToNumber( + string memory text + ) public returns (bool, uint256) { + return Utils.hexToNumber(text); + } } diff --git a/contracts/tests/IdentityToString.sol b/contracts/tests/IdentityToString.sol index f934dd8..aab8874 100644 --- a/contracts/tests/IdentityToString.sol +++ b/contracts/tests/IdentityToString.sol @@ -21,10 +21,10 @@ pragma solidity ^0.8.8; import "../libraries/Utils.sol"; contract IdentityToString { - function callIdentityToString( - uint32 network_type, - bytes memory identity_value - ) public returns (bool, string memory) { - return Utils.identityToString(network_type, identity_value); - } + function callIdentityToString( + uint32 network_type, + bytes memory identity_value + ) public returns (bool, string memory) { + return Utils.identityToString(network_type, identity_value); + } } diff --git a/contracts/tests/ParseDecimal.sol b/contracts/tests/ParseDecimal.sol index 81c9b05..be1d7d0 100644 --- a/contracts/tests/ParseDecimal.sol +++ b/contracts/tests/ParseDecimal.sol @@ -21,10 +21,10 @@ pragma solidity ^0.8.8; import "../libraries/Utils.sol"; contract ParseDecimal { - function callParseDecimal(string memory text, uint8 decimals) - public - returns (bool, uint256) - { - return Utils.parseDecimal(text, decimals); - } + function callParseDecimal( + string memory text, + uint8 decimals + ) public returns (bool, uint256) { + return Utils.parseDecimal(text, decimals); + } } diff --git a/contracts/tests/ParseInt.sol b/contracts/tests/ParseInt.sol index bc2dc94..413c896 100644 --- a/contracts/tests/ParseInt.sol +++ b/contracts/tests/ParseInt.sol @@ -21,7 +21,7 @@ pragma solidity ^0.8.8; import "../libraries/Utils.sol"; contract ParseInt { - function callParseInt(string memory text) public returns (bool, uint256) { - return Utils.parseInt(text); - } + function callParseInt(string memory text) public returns (bool, uint256) { + return Utils.parseInt(text); + } } diff --git a/contracts/tests/PostBool.sol b/contracts/tests/PostBool.sol index 825da42..baf8b65 100644 --- a/contracts/tests/PostBool.sol +++ b/contracts/tests/PostBool.sol @@ -21,26 +21,26 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; contract PostBool { - function callPostBool( - string memory url, - string memory jsonPointer, - string memory payload - ) public returns (bool, bool) { - HttpHeader[] memory headers = new HttpHeader[](0); - return Http.PostBool(url, jsonPointer, payload, headers); - } + function callPostBool( + string memory url, + string memory jsonPointer, + string memory payload + ) public returns (bool, bool) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.PostBool(url, jsonPointer, payload, headers); + } - function callPostBoolTwiceAndReturnSecondResult( - string memory firstUrl, - string memory firstJsonPointer, - string memory firstPayload, - string memory secondUrl, - string memory secondJsonPointer, - string memory secondPayload - ) public returns (bool, bool) { - HttpHeader[] memory headers = new HttpHeader[](0); - Http.PostBool(firstUrl, firstJsonPointer, firstPayload, headers); - return - Http.PostBool(secondUrl, secondJsonPointer, secondPayload, headers); - } + function callPostBoolTwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory firstPayload, + string memory secondUrl, + string memory secondJsonPointer, + string memory secondPayload + ) public returns (bool, bool) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.PostBool(firstUrl, firstJsonPointer, firstPayload, headers); + return + Http.PostBool(secondUrl, secondJsonPointer, secondPayload, headers); + } } diff --git a/contracts/tests/PostI64.sol b/contracts/tests/PostI64.sol index fcd0012..2ee6b4f 100644 --- a/contracts/tests/PostI64.sol +++ b/contracts/tests/PostI64.sol @@ -21,26 +21,26 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; contract PostI64 { - function callPostI64( - string memory url, - string memory jsonPointer, - string memory payload - ) public returns (bool, int64) { - HttpHeader[] memory headers = new HttpHeader[](0); - return Http.PostI64(url, jsonPointer, payload, headers); - } + function callPostI64( + string memory url, + string memory jsonPointer, + string memory payload + ) public returns (bool, int64) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.PostI64(url, jsonPointer, payload, headers); + } - function callPostI64TwiceAndReturnSecondResult( - string memory firstUrl, - string memory firstJsonPointer, - string memory firstPayload, - string memory secondUrl, - string memory secondJsonPointer, - string memory secondPayload - ) public returns (bool, int64) { - HttpHeader[] memory headers = new HttpHeader[](0); - Http.PostI64(firstUrl, firstJsonPointer, firstPayload, headers); - return - Http.PostI64(secondUrl, secondJsonPointer, secondPayload, headers); - } + function callPostI64TwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory firstPayload, + string memory secondUrl, + string memory secondJsonPointer, + string memory secondPayload + ) public returns (bool, int64) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.PostI64(firstUrl, firstJsonPointer, firstPayload, headers); + return + Http.PostI64(secondUrl, secondJsonPointer, secondPayload, headers); + } } diff --git a/contracts/tests/PostString.sol b/contracts/tests/PostString.sol index 195222a..7681ac8 100644 --- a/contracts/tests/PostString.sol +++ b/contracts/tests/PostString.sol @@ -21,31 +21,31 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; contract PostString { - function callPostString( - string memory url, - string memory jsonPointer, - string memory payload - ) public returns (bool, string memory) { - HttpHeader[] memory headers = new HttpHeader[](0); - return Http.PostString(url, jsonPointer, payload, headers); - } + function callPostString( + string memory url, + string memory jsonPointer, + string memory payload + ) public returns (bool, string memory) { + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.PostString(url, jsonPointer, payload, headers); + } - function callPostStringTwiceAndReturnSecondResult( - string memory firstUrl, - string memory firstJsonPointer, - string memory firstPayload, - string memory secondUrl, - string memory secondJsonPointer, - string memory secondPayload - ) public returns (bool, string memory) { - HttpHeader[] memory headers = new HttpHeader[](0); - Http.PostString(firstUrl, firstJsonPointer, firstPayload, headers); - return - Http.PostString( - secondUrl, - secondJsonPointer, - secondPayload, - headers - ); - } + function callPostStringTwiceAndReturnSecondResult( + string memory firstUrl, + string memory firstJsonPointer, + string memory firstPayload, + string memory secondUrl, + string memory secondJsonPointer, + string memory secondPayload + ) public returns (bool, string memory) { + HttpHeader[] memory headers = new HttpHeader[](0); + Http.PostString(firstUrl, firstJsonPointer, firstPayload, headers); + return + Http.PostString( + secondUrl, + secondJsonPointer, + secondPayload, + headers + ); + } } diff --git a/contracts/tests/ToHex.sol b/contracts/tests/ToHex.sol index 4c80629..9ad8e61 100644 --- a/contracts/tests/ToHex.sol +++ b/contracts/tests/ToHex.sol @@ -21,10 +21,9 @@ pragma solidity ^0.8.8; import "../libraries/Utils.sol"; contract ToHex { - function callToHex(string memory text) - public - returns (bool, string memory) - { - return Utils.toHex(bytes(text)); - } + function callToHex( + string memory text + ) public returns (bool, string memory) { + return Utils.toHex(bytes(text)); + } } diff --git a/contracts/token_holding_amount/BRC20.sol b/contracts/token_holding_amount/BRC20.sol index 4f6af27..d8c9fc5 100644 --- a/contracts/token_holding_amount/BRC20.sol +++ b/contracts/token_holding_amount/BRC20.sol @@ -21,62 +21,59 @@ pragma solidity ^0.8.8; import "../libraries/Identities.sol"; import "../libraries/Http.sol"; import "../libraries/Utils.sol"; -import {TokenHoldingAmount} from "./TokenHoldingAmount.sol"; +import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; abstract contract BRC20 is TokenHoldingAmount { - function getTokenDecimals() internal pure override returns (uint8) { - return 18; - } + function getTokenDecimals() internal pure override returns (uint8) { + return 18; + } - function queryBalance( - Identity memory identity, - uint32 network, - string[] memory secrets - ) internal virtual override returns (uint256) { - (bool identityToStringSuccess, string memory identityString) = Utils - .identityToString(network, identity.value); - if (identityToStringSuccess) { - // https://geniidata.readme.io/reference/get-brc20-tick-list-copy - string memory url = string( - abi.encodePacked( - "https://api.geniidata.com/api/1/brc20/balance", - // below url is used for test against mock server - // "http://localhost:19529/api/1/brc20/balance", - "?tick=", - getTokenName(), - "&address=", - identityString - ) - ); + function queryBalance( + Identity memory identity, + uint32 network, + string[] memory secrets + ) internal virtual override returns (uint256) { + (bool identityToStringSuccess, string memory identityString) = Utils + .identityToString(network, identity.value); + if (identityToStringSuccess) { + // https://geniidata.readme.io/reference/get-brc20-tick-list-copy + string memory url = string( + abi.encodePacked( + // "https://api.geniidata.com/api/1/brc20/balance", + // below url is used for test against mock server + "http://localhost:19529/api/1/brc20/balance", + "?tick=", + getTokenName(), + "&address=", + identityString + ) + ); - HttpHeader[] memory headers = new HttpHeader[](1); - headers[0] = HttpHeader("api-key", secrets[0]); + HttpHeader[] memory headers = new HttpHeader[](1); + headers[0] = HttpHeader("api-key", secrets[0]); - (bool success, string memory value) = Http.GetString( - url, - "/data/list/0/available_balance", - headers - ); + (bool success, string memory value) = Http.GetString( + url, + "/data/list/0/available_balance", + headers + ); - if (success) { - (bool parseDecimalSuccess, uint256 result) = Utils.parseDecimal( - value, - getTokenDecimals() - ); - if (parseDecimalSuccess) { - return result; - } - } - } - return 0; - } + if (success) { + (bool parseDecimalSuccess, uint256 result) = Utils.parseDecimal( + value, + getTokenDecimals() + ); + if (parseDecimalSuccess) { + return result; + } + } + } + return 0; + } - function isSupportedNetwork(uint32 network) - internal - pure - override - returns (bool) - { - return network == Web3Networks.BitcoinP2tr; - } + function isSupportedNetwork( + uint32 network + ) internal pure override returns (bool) { + return network == Web3Networks.BitcoinP2tr; + } } diff --git a/contracts/token_holding_amount/BlockchainInfoClient.sol b/contracts/token_holding_amount/BlockchainInfoClient.sol index 17a27c5..540a9b5 100644 --- a/contracts/token_holding_amount/BlockchainInfoClient.sol +++ b/contracts/token_holding_amount/BlockchainInfoClient.sol @@ -22,28 +22,28 @@ import "../libraries/Http.sol"; import "../libraries/Utils.sol"; library BlockchainInfoClient { - function getMultiAddress(string memory url, string[] memory accounts) - internal - returns (bool, int64) - { - string memory activeQueryParam = ""; + function getMultiAddress( + string memory url, + string[] memory accounts + ) internal returns (bool, int64) { + string memory activeQueryParam = ""; - for (uint256 i = 0; i < accounts.length; i++) { - activeQueryParam = string( - abi.encodePacked(activeQueryParam, accounts[i]) - ); - if (i != accounts.length - 1) { - activeQueryParam = string( - abi.encodePacked(activeQueryParam, "|") - ); - } - } + for (uint256 i = 0; i < accounts.length; i++) { + activeQueryParam = string( + abi.encodePacked(activeQueryParam, accounts[i]) + ); + if (i != accounts.length - 1) { + activeQueryParam = string( + abi.encodePacked(activeQueryParam, "|") + ); + } + } - url = string( - abi.encodePacked(url, "?active=", activeQueryParam, "&n=", "0") - ); + url = string( + abi.encodePacked(url, "?active=", activeQueryParam, "&n=", "0") + ); - HttpHeader[] memory headers = new HttpHeader[](0); - return Http.GetI64(url, "/wallet/final_balance", headers); - } + HttpHeader[] memory headers = new HttpHeader[](0); + return Http.GetI64(url, "/wallet/final_balance", headers); + } } diff --git a/contracts/token_holding_amount/NativeToken.sol b/contracts/token_holding_amount/NativeToken.sol new file mode 100644 index 0000000..71effad --- /dev/null +++ b/contracts/token_holding_amount/NativeToken.sol @@ -0,0 +1,77 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; +import "../libraries/Identities.sol"; +import "../libraries/Utils.sol"; +import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; +import { NoderealClient } from "./NoderealClient.sol"; + +abstract contract NativeToken is TokenHoldingAmount { + function getTokenDecimals() internal pure override returns (uint8) { + return 18; + } + + function queryBalance( + Identity memory identity, + uint32 network, + string[] memory secrets + ) internal virtual override returns (uint256) { + (bool identityToStringSuccess, string memory identityString) = Utils + .identityToString(network, identity.value); + if (identityToStringSuccess) { + string memory url; + + // For BNB balance + if (network == Web3Networks.Bsc) { + url = string( + abi.encodePacked( + // "https://bsc-mainnet.nodereal.io/v1/", + "http://localhost:19530/nodereal_jsonrpc/v1/", + secrets[0] + ) + ); + } else if ( + // For ETH balance + network == Web3Networks.Ethereum + ) { + url = string( + abi.encodePacked( + // "https://ethereum-mainnet.nodereal.io/v1/", + "http://localhost:19530/nodereal_jsonrpc/v1/", + secrets[0] + ) + ); + } + (bool success, uint256 balance) = NoderealClient.getEthBalance( + url, + identityString + ); + if (success) { + return balance; + } + } + return 0; + } + + function isSupportedNetwork( + uint32 network + ) internal pure override returns (bool) { + return network == Web3Networks.Bsc || network == Web3Networks.Ethereum; + } +} diff --git a/contracts/token_holding_amount/NoderealClient.sol b/contracts/token_holding_amount/NoderealClient.sol index a86a216..210f689 100644 --- a/contracts/token_holding_amount/NoderealClient.sol +++ b/contracts/token_holding_amount/NoderealClient.sol @@ -22,56 +22,56 @@ import "../libraries/Http.sol"; import "../libraries/Utils.sol"; library NoderealClient { - function getEthBalance(string memory url, string memory account) - internal - returns (bool, uint256) - { - HttpHeader[] memory headers = new HttpHeader[](0); - string memory request = string( - abi.encodePacked( - '{"jsonrpc": "2.0", "method": "eth_getBalance", "id": 1, "params": ["', - account, - '", "latest"]}' - ) - ); - (bool result, string memory balance) = Http.PostString( - url, - "/result", - request, - headers - ); - if (result) { - return Utils.hexToNumber(balance); - } else { - return (false, 0); - } - } + function getEthBalance( + string memory url, + string memory account + ) internal returns (bool, uint256) { + HttpHeader[] memory headers = new HttpHeader[](0); + string memory request = string( + abi.encodePacked( + '{"jsonrpc": "2.0", "method": "eth_getBalance", "id": 1, "params": ["', + account, + '", "latest"]}' + ) + ); + (bool result, string memory balance) = Http.PostString( + url, + "/result", + request, + headers + ); + if (result) { + return Utils.hexToNumber(balance); + } else { + return (false, 0); + } + } - function getErc20Balance( - string memory url, - string memory tokenContractAddress, - string memory account - ) internal returns (bool, uint256) { - HttpHeader[] memory headers = new HttpHeader[](0); - string memory request = string( - abi.encodePacked( - '{"jsonrpc": "2.0", "method": "nr_getTokenBalance20", "id": 1, "params": ["', - tokenContractAddress, - '","', - account, - '", "latest"]}' - ) - ); - (bool result, string memory balance) = Http.PostString( - url, - "/result", - request, - headers - ); - if (result) { - return Utils.hexToNumber(balance); - } else { - return (false, 0); - } - } + function getErc20Balance( + string memory url, + string memory tokenContractAddress, + string memory account + ) internal returns (bool, uint256) { + HttpHeader[] memory headers = new HttpHeader[](0); + string memory request = string( + abi.encodePacked( + '{"jsonrpc": "2.0", "method": "nr_getTokenBalance20", "id": 1, "params": ["', + tokenContractAddress, + '","', + account, + '", "latest"]}' + ) + ); + (bool result, string memory balance) = Http.PostString( + url, + "/result", + request, + headers + ); + if (result) { + return Utils.hexToNumber(balance); + } else { + return (false, 0); + } + } } diff --git a/contracts/token_holding_amount/TokenHoldingAmount.sol b/contracts/token_holding_amount/TokenHoldingAmount.sol index da1f847..936815d 100644 --- a/contracts/token_holding_amount/TokenHoldingAmount.sol +++ b/contracts/token_holding_amount/TokenHoldingAmount.sol @@ -24,142 +24,136 @@ import "../libraries/Identities.sol"; import "../DynamicAssertion.sol"; abstract contract TokenHoldingAmount is DynamicAssertion { - function execute(Identity[] memory identities, string[] memory secrets) - public - override - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ) - { - string - memory description = "The amount of a particular token you are holding"; - string memory assertion_type = "Token Holding Amount"; - schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/25-token-holding-amount/1-1-0.json"; - - uint256 balance = queryTotalBalance(identities, secrets); - - (uint256 index, uint256 min, int256 max) = calculateRange(balance); - - string[] memory assertions = assembleAssertions(min, max); - - bool result = index > 0 || balance > 0; - - return (description, assertion_type, assertions, schema_url, result); - } - - function queryTotalBalance( - Identity[] memory identities, - string[] memory secrets - ) internal virtual returns (uint256) { - uint256 total_balance = 0; - uint256 identitiesLength = identities.length; - - for (uint256 i = 0; i < identitiesLength; i++) { - Identity memory identity = identities[i]; - uint256 networksLength = identity.networks.length; - for (uint32 j = 0; j < networksLength; j++) { - uint32 network = identity.networks[j]; - if (isSupportedNetwork(network)) { - total_balance += queryBalance(identity, network, secrets); - } - } - } - - return total_balance; - } - - function calculateRange(uint256 balance) - private - pure - returns ( - uint256, - uint256, - int256 - ) - { - uint256[] memory ranges = getTokenRanges(); - uint256 index = ranges.length - 1; - uint256 min = 0; - int256 max = 0; - - for (uint32 i = 1; i < ranges.length; i++) { - if (balance < ranges[i] * 10**getTokenDecimals()) { - index = i - 1; - break; - } - } - - if (index == ranges.length - 1) { - min = ranges[index]; - max = -1; - } else { - min = ranges[index]; - max = int256(ranges[index + 1]); - } - - return (index, min, max); - } - - function assembleAssertions(uint256 min, int256 max) - private - pure - returns (string[] memory) - { - string memory variable = "$holding_amount"; - AssertionLogic.CompositeCondition memory cc = AssertionLogic - .CompositeCondition( - new AssertionLogic.Condition[](max > 0 ? 3 : 2), - true - ); - AssertionLogic.andOp( - cc, - 0, - "$token", - AssertionLogic.Op.Equal, - getTokenName() - ); - AssertionLogic.andOp( - cc, - 1, - variable, - AssertionLogic.Op.GreaterEq, - Strings.toString(min) - ); - if (max > 0) { - AssertionLogic.andOp( - cc, - 2, - variable, - AssertionLogic.Op.LessThan, - Strings.toString(max) - ); - } - - string[] memory assertions = new string[](1); - assertions[0] = AssertionLogic.toString(cc); - - return assertions; - } - - function getTokenName() internal pure virtual returns (string memory); - - function getTokenRanges() internal pure virtual returns (uint256[] memory); - - function getTokenDecimals() internal pure virtual returns (uint8); - - function isSupportedNetwork(uint32 network) - internal - pure - virtual - returns (bool); - - function queryBalance( - Identity memory identity, - uint32 network, - string[] memory secrets - ) internal virtual returns (uint256); + function execute( + Identity[] memory identities, + string[] memory secrets + ) + public + override + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ) + { + string + memory description = "The amount of a particular token you are holding"; + string memory assertion_type = "Token Holding Amount"; + schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/25-token-holding-amount/1-1-0.json"; + + uint256 balance = queryTotalBalance(identities, secrets); + + (uint256 index, uint256 min, int256 max) = calculateRange(balance); + + string[] memory assertions = assembleAssertions(min, max); + + bool result = index > 0 || balance > 0; + + return (description, assertion_type, assertions, schema_url, result); + } + + function queryTotalBalance( + Identity[] memory identities, + string[] memory secrets + ) internal virtual returns (uint256) { + uint256 total_balance = 0; + uint256 identitiesLength = identities.length; + + for (uint256 i = 0; i < identitiesLength; i++) { + Identity memory identity = identities[i]; + uint256 networksLength = identity.networks.length; + for (uint32 j = 0; j < networksLength; j++) { + uint32 network = identity.networks[j]; + if (isSupportedNetwork(network)) { + total_balance += queryBalance(identity, network, secrets); + } + } + } + + return total_balance; + } + + function calculateRange( + uint256 balance + ) private pure returns (uint256, uint256, int256) { + uint256[] memory ranges = getTokenRanges(); + uint256 index = ranges.length - 1; + uint256 min = 0; + int256 max = 0; + + for (uint32 i = 1; i < ranges.length; i++) { + if (balance < ranges[i] * 10 ** getTokenDecimals()) { + index = i - 1; + break; + } + } + + if (index == ranges.length - 1) { + min = ranges[index]; + max = -1; + } else { + min = ranges[index]; + max = int256(ranges[index + 1]); + } + + return (index, min, max); + } + + function assembleAssertions( + uint256 min, + int256 max + ) private pure returns (string[] memory) { + string memory variable = "$holding_amount"; + AssertionLogic.CompositeCondition memory cc = AssertionLogic + .CompositeCondition( + new AssertionLogic.Condition[](max > 0 ? 3 : 2), + true + ); + AssertionLogic.andOp( + cc, + 0, + "$token", + AssertionLogic.Op.Equal, + getTokenName() + ); + AssertionLogic.andOp( + cc, + 1, + variable, + AssertionLogic.Op.GreaterEq, + Strings.toString(min) + ); + if (max > 0) { + AssertionLogic.andOp( + cc, + 2, + variable, + AssertionLogic.Op.LessThan, + Strings.toString(max) + ); + } + + string[] memory assertions = new string[](1); + assertions[0] = AssertionLogic.toString(cc); + + return assertions; + } + + function getTokenName() internal pure virtual returns (string memory); + + function getTokenRanges() internal pure virtual returns (uint256[] memory); + + function getTokenDecimals() internal pure virtual returns (uint8); + + function isSupportedNetwork( + uint32 network + ) internal pure virtual returns (bool); + + function queryBalance( + Identity memory identity, + uint32 network, + string[] memory secrets + ) internal virtual returns (uint256); } diff --git a/contracts/token_holding_amount/tokens/BNB.sol b/contracts/token_holding_amount/tokens/BNB.sol new file mode 100644 index 0000000..783c119 --- /dev/null +++ b/contracts/token_holding_amount/tokens/BNB.sol @@ -0,0 +1,48 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { NativeToken } from "../NativeToken.sol"; + +contract BNB is NativeToken { + function getTokenName() internal pure override returns (string memory) { + return "bnb"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 50; + ranges[3] = 100; + ranges[4] = 200; + ranges[5] = 500; + ranges[6] = 800; + ranges[7] = 1200; + ranges[8] = 1600; + ranges[9] = 3000; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/tokens/Btcs.sol b/contracts/token_holding_amount/tokens/Btcs.sol index 1204ba1..0337f67 100644 --- a/contracts/token_holding_amount/tokens/Btcs.sol +++ b/contracts/token_holding_amount/tokens/Btcs.sol @@ -18,29 +18,29 @@ pragma solidity ^0.8.8; -import {BRC20} from "../BRC20.sol"; +import { BRC20 } from "../BRC20.sol"; contract Btcs is BRC20 { - function getTokenName() internal pure override returns (string memory) { - return "btcs"; - } + function getTokenName() internal pure override returns (string memory) { + return "btcs"; + } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { - uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 5; - ranges[3] = 20; - ranges[4] = 50; - ranges[5] = 100; - ranges[6] = 200; - ranges[7] = 500; - ranges[8] = 800; - return ranges; - } + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 5; + ranges[3] = 20; + ranges[4] = 50; + ranges[5] = 100; + ranges[6] = 200; + ranges[7] = 500; + ranges[8] = 800; + return ranges; + } } diff --git a/contracts/token_holding_amount/tokens/Cats.sol b/contracts/token_holding_amount/tokens/Cats.sol index 0c737a3..3e39daf 100644 --- a/contracts/token_holding_amount/tokens/Cats.sol +++ b/contracts/token_holding_amount/tokens/Cats.sol @@ -18,28 +18,28 @@ pragma solidity ^0.8.8; -import {BRC20} from "../BRC20.sol"; +import { BRC20 } from "../BRC20.sol"; contract Cats is BRC20 { - function getTokenName() internal pure override returns (string memory) { - return "cats"; - } + function getTokenName() internal pure override returns (string memory) { + return "cats"; + } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { - uint256[] memory ranges = new uint256[](8); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 10000; - ranges[3] = 50000; - ranges[4] = 100000; - ranges[5] = 200000; - ranges[6] = 500000; - ranges[7] = 800000; - return ranges; - } + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](8); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 10000; + ranges[3] = 50000; + ranges[4] = 100000; + ranges[5] = 200000; + ranges[6] = 500000; + ranges[7] = 800000; + return ranges; + } } diff --git a/contracts/token_holding_amount/tokens/Long.sol b/contracts/token_holding_amount/tokens/Long.sol index 8ec3681..d0d5fb3 100644 --- a/contracts/token_holding_amount/tokens/Long.sol +++ b/contracts/token_holding_amount/tokens/Long.sol @@ -18,29 +18,29 @@ pragma solidity ^0.8.8; -import {BRC20} from "../BRC20.sol"; +import { BRC20 } from "../BRC20.sol"; contract Long is BRC20 { - function getTokenName() internal pure override returns (string memory) { - return "long"; - } + function getTokenName() internal pure override returns (string memory) { + return "long"; + } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { - uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 20; - ranges[3] = 50; - ranges[4] = 200; - ranges[5] = 500; - ranges[6] = 1000; - ranges[7] = 2000; - ranges[8] = 3000; - return ranges; - } + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 20; + ranges[3] = 50; + ranges[4] = 200; + ranges[5] = 500; + ranges[6] = 1000; + ranges[7] = 2000; + ranges[8] = 3000; + return ranges; + } } diff --git a/contracts/token_holding_amount/tokens/Mmss.sol b/contracts/token_holding_amount/tokens/Mmss.sol index 4cf9030..beae1da 100644 --- a/contracts/token_holding_amount/tokens/Mmss.sol +++ b/contracts/token_holding_amount/tokens/Mmss.sol @@ -18,29 +18,29 @@ pragma solidity ^0.8.8; -import {BRC20} from "../BRC20.sol"; +import { BRC20 } from "../BRC20.sol"; contract Mmss is BRC20 { - function getTokenName() internal pure override returns (string memory) { - return "mmss"; - } + function getTokenName() internal pure override returns (string memory) { + return "mmss"; + } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { - uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 20; - ranges[3] = 50; - ranges[4] = 100; - ranges[5] = 200; - ranges[6] = 500; - ranges[7] = 1000; - ranges[8] = 2000; - return ranges; - } + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 20; + ranges[3] = 50; + ranges[4] = 100; + ranges[5] = 200; + ranges[6] = 500; + ranges[7] = 1000; + ranges[8] = 2000; + return ranges; + } } diff --git a/contracts/token_holding_amount/tokens/Ordi.sol b/contracts/token_holding_amount/tokens/Ordi.sol index eb337df..6b51cf0 100644 --- a/contracts/token_holding_amount/tokens/Ordi.sol +++ b/contracts/token_holding_amount/tokens/Ordi.sol @@ -18,28 +18,28 @@ pragma solidity ^0.8.8; -import {BRC20} from "../BRC20.sol"; +import { BRC20 } from "../BRC20.sol"; contract Ordi is BRC20 { - function getTokenName() internal pure override returns (string memory) { - return "ordi"; - } + function getTokenName() internal pure override returns (string memory) { + return "ordi"; + } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { - uint256[] memory ranges = new uint256[](8); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 5; - ranges[3] = 20; - ranges[4] = 50; - ranges[5] = 100; - ranges[6] = 200; - ranges[7] = 500; - return ranges; - } + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](8); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 5; + ranges[3] = 20; + ranges[4] = 50; + ranges[5] = 100; + ranges[6] = 200; + ranges[7] = 500; + return ranges; + } } diff --git a/contracts/token_holding_amount/tokens/Rats.sol b/contracts/token_holding_amount/tokens/Rats.sol index 27a27f4..3bcf59d 100644 --- a/contracts/token_holding_amount/tokens/Rats.sol +++ b/contracts/token_holding_amount/tokens/Rats.sol @@ -18,29 +18,29 @@ pragma solidity ^0.8.8; -import {BRC20} from "../BRC20.sol"; +import { BRC20 } from "../BRC20.sol"; contract Rats is BRC20 { - function getTokenName() internal pure override returns (string memory) { - return "rats"; - } + function getTokenName() internal pure override returns (string memory) { + return "rats"; + } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { - uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 40000; - ranges[3] = 200000; - ranges[4] = 1000000; - ranges[5] = 2000000; - ranges[6] = 4000000; - ranges[7] = 10000000; - ranges[8] = 2000000; - return ranges; - } + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 40000; + ranges[3] = 200000; + ranges[4] = 1000000; + ranges[5] = 2000000; + ranges[6] = 4000000; + ranges[7] = 10000000; + ranges[8] = 2000000; + return ranges; + } } diff --git a/contracts/token_holding_amount/tokens/Sats.sol b/contracts/token_holding_amount/tokens/Sats.sol index 3b86677..f868a1f 100644 --- a/contracts/token_holding_amount/tokens/Sats.sol +++ b/contracts/token_holding_amount/tokens/Sats.sol @@ -18,29 +18,29 @@ pragma solidity ^0.8.8; -import {BRC20} from "../BRC20.sol"; +import { BRC20 } from "../BRC20.sol"; contract Sats is BRC20 { - function getTokenName() internal pure override returns (string memory) { - return "sats"; - } + function getTokenName() internal pure override returns (string memory) { + return "sats"; + } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { - uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 40000000; - ranges[3] = 200000000; - ranges[4] = 500000000; - ranges[5] = 1000000000; - ranges[6] = 2000000000; - ranges[7] = 4000000000; - ranges[8] = 6000000000; - return ranges; - } + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 40000000; + ranges[3] = 200000000; + ranges[4] = 500000000; + ranges[5] = 1000000000; + ranges[6] = 2000000000; + ranges[7] = 4000000000; + ranges[8] = 6000000000; + return ranges; + } } From 75136e3f5566851c4103fffc4fb8095b0e35a4bc Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Tue, 18 Jun 2024 10:38:29 +0800 Subject: [PATCH 17/23] paramers --- .prettierrc | 2 +- contracts/DynamicAssertion.sol | 29 +++---- .../{NativeToken.sol => ERC20.sol} | 79 ++++++++++++------- .../token_holding_amount/NoderealClient.sol | 59 ++++++-------- .../TokenHoldingAmount.sol | 13 +-- .../{tokens => brc20}/Btcs.sol | 18 ++--- .../{tokens => brc20}/Cats.sol | 16 ++-- .../{tokens => brc20}/Long.sol | 18 ++--- .../{tokens => brc20}/Mmss.sol | 18 ++--- .../{tokens => brc20}/Ordi.sol | 16 ++-- .../{tokens => brc20}/Rats.sol | 18 ++--- .../{tokens => brc20}/Sats.sol | 18 ++--- contracts/token_holding_amount/erc20/Ada.sol | 56 +++++++++++++ contracts/token_holding_amount/erc20/Amp.sol | 59 ++++++++++++++ contracts/token_holding_amount/erc20/Atom.sol | 56 +++++++++++++ contracts/token_holding_amount/erc20/Bch.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Bean.sol | 55 +++++++++++++ contracts/token_holding_amount/erc20/Bnb.sol | 57 +++++++++++++ contracts/token_holding_amount/erc20/Comp.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Cro.sol | 57 +++++++++++++ contracts/token_holding_amount/erc20/Crv.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Cvx.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Dai.sol | 59 ++++++++++++++ contracts/token_holding_amount/erc20/Doge.sol | 56 +++++++++++++ contracts/token_holding_amount/erc20/Dydx.sol | 60 ++++++++++++++ .../{tokens/BNB.sol => erc20/Etc.sol} | 36 +++++---- contracts/token_holding_amount/erc20/Eth.sol | 61 ++++++++++++++ contracts/token_holding_amount/erc20/Fil.sol | 56 +++++++++++++ contracts/token_holding_amount/erc20/Grt.sol | 59 ++++++++++++++ contracts/token_holding_amount/erc20/Gtc.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Gusd.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Imx.sol | 58 ++++++++++++++ contracts/token_holding_amount/erc20/Inj.sol | 56 +++++++++++++ contracts/token_holding_amount/erc20/Leo.sol | 56 +++++++++++++ contracts/token_holding_amount/erc20/Link.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Lit.sol | 60 ++++++++++++++ .../token_holding_amount/erc20/Matic.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Mcrt.sol | 56 +++++++++++++ contracts/token_holding_amount/erc20/Nfp.sol | 60 ++++++++++++++ .../token_holding_amount/erc20/People.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Shib.sol | 58 ++++++++++++++ contracts/token_holding_amount/erc20/Sol.sol | 59 ++++++++++++++ .../token_holding_amount/erc20/SpaceId.sol | 59 ++++++++++++++ contracts/token_holding_amount/erc20/Ton.sol | 59 ++++++++++++++ contracts/token_holding_amount/erc20/Trx.sol | 59 ++++++++++++++ contracts/token_holding_amount/erc20/Tusd.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Uni.sol | 59 ++++++++++++++ contracts/token_holding_amount/erc20/Usdc.sol | 43 ++++++++++ contracts/token_holding_amount/erc20/Usdd.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Usdt.sol | 60 ++++++++++++++ contracts/token_holding_amount/erc20/Wbtc.sol | 66 ++++++++++++++++ 51 files changed, 2402 insertions(+), 157 deletions(-) rename contracts/token_holding_amount/{NativeToken.sol => ERC20.sol} (51%) rename contracts/token_holding_amount/{tokens => brc20}/Btcs.sol (77%) rename contracts/token_holding_amount/{tokens => brc20}/Cats.sol (78%) rename contracts/token_holding_amount/{tokens => brc20}/Long.sol (76%) rename contracts/token_holding_amount/{tokens => brc20}/Mmss.sol (77%) rename contracts/token_holding_amount/{tokens => brc20}/Ordi.sol (79%) rename contracts/token_holding_amount/{tokens => brc20}/Rats.sol (75%) rename contracts/token_holding_amount/{tokens => brc20}/Sats.sol (74%) create mode 100644 contracts/token_holding_amount/erc20/Ada.sol create mode 100644 contracts/token_holding_amount/erc20/Amp.sol create mode 100644 contracts/token_holding_amount/erc20/Atom.sol create mode 100644 contracts/token_holding_amount/erc20/Bch.sol create mode 100644 contracts/token_holding_amount/erc20/Bean.sol create mode 100644 contracts/token_holding_amount/erc20/Bnb.sol create mode 100644 contracts/token_holding_amount/erc20/Comp.sol create mode 100644 contracts/token_holding_amount/erc20/Cro.sol create mode 100644 contracts/token_holding_amount/erc20/Crv.sol create mode 100644 contracts/token_holding_amount/erc20/Cvx.sol create mode 100644 contracts/token_holding_amount/erc20/Dai.sol create mode 100644 contracts/token_holding_amount/erc20/Doge.sol create mode 100644 contracts/token_holding_amount/erc20/Dydx.sol rename contracts/token_holding_amount/{tokens/BNB.sol => erc20/Etc.sol} (60%) create mode 100644 contracts/token_holding_amount/erc20/Eth.sol create mode 100644 contracts/token_holding_amount/erc20/Fil.sol create mode 100644 contracts/token_holding_amount/erc20/Grt.sol create mode 100644 contracts/token_holding_amount/erc20/Gtc.sol create mode 100644 contracts/token_holding_amount/erc20/Gusd.sol create mode 100644 contracts/token_holding_amount/erc20/Imx.sol create mode 100644 contracts/token_holding_amount/erc20/Inj.sol create mode 100644 contracts/token_holding_amount/erc20/Leo.sol create mode 100644 contracts/token_holding_amount/erc20/Link.sol create mode 100644 contracts/token_holding_amount/erc20/Lit.sol create mode 100644 contracts/token_holding_amount/erc20/Matic.sol create mode 100644 contracts/token_holding_amount/erc20/Mcrt.sol create mode 100644 contracts/token_holding_amount/erc20/Nfp.sol create mode 100644 contracts/token_holding_amount/erc20/People.sol create mode 100644 contracts/token_holding_amount/erc20/Shib.sol create mode 100644 contracts/token_holding_amount/erc20/Sol.sol create mode 100644 contracts/token_holding_amount/erc20/SpaceId.sol create mode 100644 contracts/token_holding_amount/erc20/Ton.sol create mode 100644 contracts/token_holding_amount/erc20/Trx.sol create mode 100644 contracts/token_holding_amount/erc20/Tusd.sol create mode 100644 contracts/token_holding_amount/erc20/Uni.sol create mode 100644 contracts/token_holding_amount/erc20/Usdc.sol create mode 100644 contracts/token_holding_amount/erc20/Usdd.sol create mode 100644 contracts/token_holding_amount/erc20/Usdt.sol create mode 100644 contracts/token_holding_amount/erc20/Wbtc.sol diff --git a/.prettierrc b/.prettierrc index 4b51fe3..dd11f48 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,7 +5,7 @@ "semi": false, "singleQuote": false, "useTabs": true, - "printWidth": 120, + "printWidth": 80, "overrides": [ { "files": "*.sol", diff --git a/contracts/DynamicAssertion.sol b/contracts/DynamicAssertion.sol index f062ca7..c641908 100644 --- a/contracts/DynamicAssertion.sol +++ b/contracts/DynamicAssertion.sol @@ -21,19 +21,20 @@ pragma solidity ^0.8.8; import "./libraries/Identities.sol"; abstract contract DynamicAssertion { - string schema_url; + string schema_url; - function execute( - Identity[] memory identities, - string[] memory secrets - ) - public - virtual - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ); + function execute( + Identity[] memory identities, + string[] memory secrets, + bytes memory params + ) + public + virtual + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ); } diff --git a/contracts/token_holding_amount/NativeToken.sol b/contracts/token_holding_amount/ERC20.sol similarity index 51% rename from contracts/token_holding_amount/NativeToken.sol rename to contracts/token_holding_amount/ERC20.sol index 71effad..428fd39 100644 --- a/contracts/token_holding_amount/NativeToken.sol +++ b/contracts/token_holding_amount/ERC20.sol @@ -21,8 +21,22 @@ import "../libraries/Identities.sol"; import "../libraries/Utils.sol"; import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; import { NoderealClient } from "./NoderealClient.sol"; +abstract contract ERC20 is TokenHoldingAmount { + mapping(uint32 => string) internal networkTokenAddresses; -abstract contract NativeToken is TokenHoldingAmount { + mapping(uint32 => string) internal networkUrls; + mapping(uint32 => bool) private queriedNetworks; + constructor() { + networkUrls[ + Web3Networks.Bsc + ] = "https://bsc-mainnet.nodereal.io/v1/"; + networkUrls[ + Web3Networks.Ethereum + ] = "https://eth-mainnet.nodereal.io/v1/"; + // Add more networks as needed + // below url is used for test against mock server + // "http://localhost:19530/nodereal_jsonrpc/v1/", + } function getTokenDecimals() internal pure override returns (uint8) { return 18; } @@ -34,41 +48,50 @@ abstract contract NativeToken is TokenHoldingAmount { ) internal virtual override returns (uint256) { (bool identityToStringSuccess, string memory identityString) = Utils .identityToString(network, identity.value); + if (identityToStringSuccess) { string memory url; + uint32[] memory networks = getTokenNetworks(); + uint256 totalBalance = 0; - // For BNB balance - if (network == Web3Networks.Bsc) { - url = string( - abi.encodePacked( - // "https://bsc-mainnet.nodereal.io/v1/", - "http://localhost:19530/nodereal_jsonrpc/v1/", - secrets[0] - ) - ); - } else if ( - // For ETH balance - network == Web3Networks.Ethereum - ) { - url = string( - abi.encodePacked( - // "https://ethereum-mainnet.nodereal.io/v1/", - "http://localhost:19530/nodereal_jsonrpc/v1/", - secrets[0] - ) - ); - } - (bool success, uint256 balance) = NoderealClient.getEthBalance( - url, - identityString - ); - if (success) { - return balance; + for (uint32 i = 0; i < networks.length; i++) { + // Check if this network has been queried + if (!queriedNetworks[network]) { + string memory _tokenContractAddress = networkTokenAddresses[ + network + ]; + + url = string( + abi.encodePacked(networkUrls[networks[i]], secrets[0]) + ); + + (bool success, uint256 balance) = NoderealClient + .getTokenBalance( + url, + _tokenContractAddress, + identityString + ); + + if (success) { + totalBalance += balance; + } + // Mark this network as queried + queriedNetworks[network] = true; + } } + return totalBalance; } return 0; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + // Add more networks as needed + return networks; + } + function isSupportedNetwork( uint32 network ) internal pure override returns (bool) { diff --git a/contracts/token_holding_amount/NoderealClient.sol b/contracts/token_holding_amount/NoderealClient.sol index 210f689..e0b5fd7 100644 --- a/contracts/token_holding_amount/NoderealClient.sol +++ b/contracts/token_holding_amount/NoderealClient.sol @@ -20,48 +20,39 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; import "../libraries/Utils.sol"; - library NoderealClient { - function getEthBalance( + function getTokenBalance( string memory url, + string memory tokenContractAddress, string memory account ) internal returns (bool, uint256) { HttpHeader[] memory headers = new HttpHeader[](0); - string memory request = string( - abi.encodePacked( - '{"jsonrpc": "2.0", "method": "eth_getBalance", "id": 1, "params": ["', - account, - '", "latest"]}' - ) - ); - (bool result, string memory balance) = Http.PostString( - url, - "/result", - request, - headers - ); - if (result) { - return Utils.hexToNumber(balance); + string memory request; + if ( + keccak256(bytes(tokenContractAddress)) == keccak256("Native Token") + ) { + // Use eth_getBalance method + request = string( + abi.encodePacked( + '{"jsonrpc": "2.0", "method": "eth_getBalance", "id": 1, "params": ["', + account, + '", "latest"]}' + ) + ); + } else if (bytes(tokenContractAddress).length == 42) { + // Use nr_getTokenBalance20 method + request = string( + abi.encodePacked( + '{"jsonrpc": "2.0", "method": "nr_getTokenBalance20", "id": 1, "params": ["', + tokenContractAddress, + '","', + account, + '", "latest"]}' + ) + ); } else { return (false, 0); } - } - - function getErc20Balance( - string memory url, - string memory tokenContractAddress, - string memory account - ) internal returns (bool, uint256) { - HttpHeader[] memory headers = new HttpHeader[](0); - string memory request = string( - abi.encodePacked( - '{"jsonrpc": "2.0", "method": "nr_getTokenBalance20", "id": 1, "params": ["', - tokenContractAddress, - '","', - account, - '", "latest"]}' - ) - ); (bool result, string memory balance) = Http.PostString( url, "/result", diff --git a/contracts/token_holding_amount/TokenHoldingAmount.sol b/contracts/token_holding_amount/TokenHoldingAmount.sol index 936815d..18a5871 100644 --- a/contracts/token_holding_amount/TokenHoldingAmount.sol +++ b/contracts/token_holding_amount/TokenHoldingAmount.sol @@ -22,11 +22,12 @@ import "@openzeppelin/contracts/utils/Strings.sol"; import "../libraries/AssertionLogic.sol"; import "../libraries/Identities.sol"; import "../DynamicAssertion.sol"; - abstract contract TokenHoldingAmount is DynamicAssertion { + uint256 constant decimals_factor = 1000; function execute( Identity[] memory identities, - string[] memory secrets + string[] memory secrets, + bytes memory /*params*/ ) public override @@ -84,7 +85,9 @@ abstract contract TokenHoldingAmount is DynamicAssertion { int256 max = 0; for (uint32 i = 1; i < ranges.length; i++) { - if (balance < ranges[i] * 10 ** getTokenDecimals()) { + if ( + balance * decimals_factor < ranges[i] * 10 ** getTokenDecimals() + ) { index = i - 1; break; } @@ -123,7 +126,7 @@ abstract contract TokenHoldingAmount is DynamicAssertion { 1, variable, AssertionLogic.Op.GreaterEq, - Strings.toString(min) + Strings.toString(min / decimals_factor) ); if (max > 0) { AssertionLogic.andOp( @@ -131,7 +134,7 @@ abstract contract TokenHoldingAmount is DynamicAssertion { 2, variable, AssertionLogic.Op.LessThan, - Strings.toString(max) + Strings.toString(uint256(max) / decimals_factor) ); } diff --git a/contracts/token_holding_amount/tokens/Btcs.sol b/contracts/token_holding_amount/brc20/Btcs.sol similarity index 77% rename from contracts/token_holding_amount/tokens/Btcs.sol rename to contracts/token_holding_amount/brc20/Btcs.sol index 0337f67..2561eff 100644 --- a/contracts/token_holding_amount/tokens/Btcs.sol +++ b/contracts/token_holding_amount/brc20/Btcs.sol @@ -32,15 +32,15 @@ contract Btcs is BRC20 { returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 5; - ranges[3] = 20; - ranges[4] = 50; - ranges[5] = 100; - ranges[6] = 200; - ranges[7] = 500; - ranges[8] = 800; + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 5 * decimals_factor; + ranges[3] = 20 * decimals_factor; + ranges[4] = 50 * decimals_factor; + ranges[5] = 100 * decimals_factor; + ranges[6] = 200 * decimals_factor; + ranges[7] = 500 * decimals_factor; + ranges[8] = 800 * decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/tokens/Cats.sol b/contracts/token_holding_amount/brc20/Cats.sol similarity index 78% rename from contracts/token_holding_amount/tokens/Cats.sol rename to contracts/token_holding_amount/brc20/Cats.sol index 3e39daf..06f1722 100644 --- a/contracts/token_holding_amount/tokens/Cats.sol +++ b/contracts/token_holding_amount/brc20/Cats.sol @@ -32,14 +32,14 @@ contract Cats is BRC20 { returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 10000; - ranges[3] = 50000; - ranges[4] = 100000; - ranges[5] = 200000; - ranges[6] = 500000; - ranges[7] = 800000; + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 10000 * decimals_factor; + ranges[3] = 50000 * decimals_factor; + ranges[4] = 100000 * decimals_factor; + ranges[5] = 200000 * decimals_factor; + ranges[6] = 500000 * decimals_factor; + ranges[7] = 800000 * decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/tokens/Long.sol b/contracts/token_holding_amount/brc20/Long.sol similarity index 76% rename from contracts/token_holding_amount/tokens/Long.sol rename to contracts/token_holding_amount/brc20/Long.sol index d0d5fb3..38d0ef5 100644 --- a/contracts/token_holding_amount/tokens/Long.sol +++ b/contracts/token_holding_amount/brc20/Long.sol @@ -32,15 +32,15 @@ contract Long is BRC20 { returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 20; - ranges[3] = 50; - ranges[4] = 200; - ranges[5] = 500; - ranges[6] = 1000; - ranges[7] = 2000; - ranges[8] = 3000; + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 20 * decimals_factor; + ranges[3] = 50 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 1000 * decimals_factor; + ranges[7] = 2000 * decimals_factor; + ranges[8] = 3000 * decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/tokens/Mmss.sol b/contracts/token_holding_amount/brc20/Mmss.sol similarity index 77% rename from contracts/token_holding_amount/tokens/Mmss.sol rename to contracts/token_holding_amount/brc20/Mmss.sol index beae1da..41b363c 100644 --- a/contracts/token_holding_amount/tokens/Mmss.sol +++ b/contracts/token_holding_amount/brc20/Mmss.sol @@ -32,15 +32,15 @@ contract Mmss is BRC20 { returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 20; - ranges[3] = 50; - ranges[4] = 100; - ranges[5] = 200; - ranges[6] = 500; - ranges[7] = 1000; - ranges[8] = 2000; + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 20 * decimals_factor; + ranges[3] = 50 * decimals_factor; + ranges[4] = 100 * decimals_factor; + ranges[5] = 200 * decimals_factor; + ranges[6] = 500 * decimals_factor; + ranges[7] = 1000 * decimals_factor; + ranges[8] = 2000 * decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/tokens/Ordi.sol b/contracts/token_holding_amount/brc20/Ordi.sol similarity index 79% rename from contracts/token_holding_amount/tokens/Ordi.sol rename to contracts/token_holding_amount/brc20/Ordi.sol index 6b51cf0..53c5b4e 100644 --- a/contracts/token_holding_amount/tokens/Ordi.sol +++ b/contracts/token_holding_amount/brc20/Ordi.sol @@ -32,14 +32,14 @@ contract Ordi is BRC20 { returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 5; - ranges[3] = 20; - ranges[4] = 50; - ranges[5] = 100; - ranges[6] = 200; - ranges[7] = 500; + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 5 * decimals_factor; + ranges[3] = 20 * decimals_factor; + ranges[4] = 50 * decimals_factor; + ranges[5] = 100 * decimals_factor; + ranges[6] = 200 * decimals_factor; + ranges[7] = 500 * decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/tokens/Rats.sol b/contracts/token_holding_amount/brc20/Rats.sol similarity index 75% rename from contracts/token_holding_amount/tokens/Rats.sol rename to contracts/token_holding_amount/brc20/Rats.sol index 3bcf59d..8044dd1 100644 --- a/contracts/token_holding_amount/tokens/Rats.sol +++ b/contracts/token_holding_amount/brc20/Rats.sol @@ -32,15 +32,15 @@ contract Rats is BRC20 { returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 40000; - ranges[3] = 200000; - ranges[4] = 1000000; - ranges[5] = 2000000; - ranges[6] = 4000000; - ranges[7] = 10000000; - ranges[8] = 2000000; + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 40000 * decimals_factor; + ranges[3] = 200000 * decimals_factor; + ranges[4] = 1000000 * decimals_factor; + ranges[5] = 2000000 * decimals_factor; + ranges[6] = 4000000 * decimals_factor; + ranges[7] = 10000000 * decimals_factor; + ranges[8] = 2000000 * decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/tokens/Sats.sol b/contracts/token_holding_amount/brc20/Sats.sol similarity index 74% rename from contracts/token_holding_amount/tokens/Sats.sol rename to contracts/token_holding_amount/brc20/Sats.sol index f868a1f..cb6671f 100644 --- a/contracts/token_holding_amount/tokens/Sats.sol +++ b/contracts/token_holding_amount/brc20/Sats.sol @@ -32,15 +32,15 @@ contract Sats is BRC20 { returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 40000000; - ranges[3] = 200000000; - ranges[4] = 500000000; - ranges[5] = 1000000000; - ranges[6] = 2000000000; - ranges[7] = 4000000000; - ranges[8] = 6000000000; + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 40000000 * decimals_factor; + ranges[3] = 200000000 * decimals_factor; + ranges[4] = 500000000 * decimals_factor; + ranges[5] = 1000000000 * decimals_factor; + ranges[6] = 2000000000 * decimals_factor; + ranges[7] = 4000000000 * decimals_factor; + ranges[8] = 6000000000 * decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/erc20/Ada.sol b/contracts/token_holding_amount/erc20/Ada.sol new file mode 100644 index 0000000..ff4c7df --- /dev/null +++ b/contracts/token_holding_amount/erc20/Ada.sol @@ -0,0 +1,56 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Ada is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = ""; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x3EE2200Efb3400fAbB9AacF31297cBdD1d435D47"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "ada"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](7); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1000 * decimals_factor; + ranges[2] = 5000 * decimals_factor; + ranges[3] = 20000* decimals_factor; + ranges[4] = 50000 * decimals_factor; + ranges[5] = 100000 * decimals_factor; + ranges[6] = 300000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Amp.sol b/contracts/token_holding_amount/erc20/Amp.sol new file mode 100644 index 0000000..80a60f0 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Amp.sol @@ -0,0 +1,59 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Amp is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xff20817765cb7f73d4bde2e66e067e58d11095c2"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "amp"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Atom.sol b/contracts/token_holding_amount/erc20/Atom.sol new file mode 100644 index 0000000..8fc38c8 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Atom.sol @@ -0,0 +1,56 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Atom is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x8D983cb9388EaC77af0474fA441C4815500Cb7BB"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x0eb3a705fc54725037cc9e008bdede697f62f335"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "atom"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](6); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 5 * decimals_factor; + ranges[3] = 20 * decimals_factor; + ranges[4] = 50 * decimals_factor; + ranges[5] = 80 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Bch.sol b/contracts/token_holding_amount/erc20/Bch.sol new file mode 100644 index 0000000..64f2f10 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Bch.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Bch is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = ""; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x8fF795a6F4D97E7887C79beA79aba5cc76444aDf"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "bch"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](6); + + // all ranges multiplied by decimals_factor(1000). + // pub const BCH_AMOUNT_RANGE: [f64; 6] = [0.0, 0.1, 0.5, 2.0, 6.0, 12.0]; + + ranges[0] = 0; + ranges[1] = 100; + ranges[2] = 500; + ranges[3] = 2000; + ranges[4] = 6000; + ranges[5] = 12000; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Bean.sol b/contracts/token_holding_amount/erc20/Bean.sol new file mode 100644 index 0000000..7751737 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Bean.sol @@ -0,0 +1,55 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Bean is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xba7b9936a965fac23bb7a8190364fa60622b3cff"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x07da81e9a684ab87fad7206b3bc8d0866f48cc7c"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "bean"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](5); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1500 * decimals_factor; + ranges[2] = 5000 * decimals_factor; + ranges[3] = 10000 * decimals_factor; + ranges[4] = 50000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Bnb.sol b/contracts/token_holding_amount/erc20/Bnb.sol new file mode 100644 index 0000000..e37303e --- /dev/null +++ b/contracts/token_holding_amount/erc20/Bnb.sol @@ -0,0 +1,57 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Bnb is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xb8c77482e45f1f44de1745f52c74426c631bdd52"; + networkTokenAddresses[Web3Networks.Bsc] = "Native Token"; + // Add more addresses as needed + } + function getTokenName() internal pure override returns (string memory) { + return "bnb"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Comp.sol b/contracts/token_holding_amount/erc20/Comp.sol new file mode 100644 index 0000000..adf3514 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Comp.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Comp is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xc00e94cb662c3520282e6f5717214004a7f26888"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "comp"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Cro.sol b/contracts/token_holding_amount/erc20/Cro.sol new file mode 100644 index 0000000..549629f --- /dev/null +++ b/contracts/token_holding_amount/erc20/Cro.sol @@ -0,0 +1,57 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Cro is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "cro"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](7); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1000 * decimals_factor; + ranges[2] = 5000 * decimals_factor; + ranges[3] = 20000 * decimals_factor; + ranges[4] = 50000 * decimals_factor; + ranges[5] = 100000 * decimals_factor; + ranges[6] = 300000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Crv.sol b/contracts/token_holding_amount/erc20/Crv.sol new file mode 100644 index 0000000..256d102 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Crv.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Crv is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xdac17f958d2ee523a2206206994597c13d831ec7"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "crv"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Cvx.sol b/contracts/token_holding_amount/erc20/Cvx.sol new file mode 100644 index 0000000..1418959 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Cvx.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Cvx is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "cvx"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Dai.sol b/contracts/token_holding_amount/erc20/Dai.sol new file mode 100644 index 0000000..04699e4 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Dai.sol @@ -0,0 +1,59 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Dai is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x6b175474e89094c44da98b954eedeac495271d0f"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "dai"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0 * decimals_factor; + ranges[1] = 10 * decimals_factor; + ranges[2] = 30 * decimals_factor; + ranges[3] = 80 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 1000 * decimals_factor; + ranges[7] = 2000 * decimals_factor; + ranges[8] = 5000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Doge.sol b/contracts/token_holding_amount/erc20/Doge.sol new file mode 100644 index 0000000..c19fb5f --- /dev/null +++ b/contracts/token_holding_amount/erc20/Doge.sol @@ -0,0 +1,56 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Doge is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = ""; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0xba2ae424d960c26247dd6c32edc70b295c744c43"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "doge"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](7); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1000 * decimals_factor; + ranges[2] = 5000 * decimals_factor; + ranges[3] = 20000 * decimals_factor; + ranges[4] = 50000 * decimals_factor; + ranges[5] = 100000 * decimals_factor; + ranges[6] = 300000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Dydx.sol b/contracts/token_holding_amount/erc20/Dydx.sol new file mode 100644 index 0000000..e4b9498 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Dydx.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Dydx is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x92d6c1e31e14520e676a687f0a93788b716beff5"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "dydx"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/tokens/BNB.sol b/contracts/token_holding_amount/erc20/Etc.sol similarity index 60% rename from contracts/token_holding_amount/tokens/BNB.sol rename to contracts/token_holding_amount/erc20/Etc.sol index 783c119..a5cc9e1 100644 --- a/contracts/token_holding_amount/tokens/BNB.sol +++ b/contracts/token_holding_amount/erc20/Etc.sol @@ -18,11 +18,23 @@ pragma solidity ^0.8.8; -import { NativeToken } from "../NativeToken.sol"; +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Etc is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = ""; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x3d6545b08693dae087e957cb1180ee38b9e3c25e"; + // Add more addresses as needed + } -contract BNB is NativeToken { function getTokenName() internal pure override returns (string memory) { - return "bnb"; + return "etc"; } function getTokenRanges() @@ -31,17 +43,13 @@ contract BNB is NativeToken { override returns (uint256[] memory) { - uint256[] memory ranges = new uint256[](10); - ranges[0] = 0; - ranges[1] = 1; - ranges[2] = 50; - ranges[3] = 100; - ranges[4] = 200; - ranges[5] = 500; - ranges[6] = 800; - ranges[7] = 1200; - ranges[8] = 1600; - ranges[9] = 3000; + uint256[] memory ranges = new uint256[](6); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 5 * decimals_factor; + ranges[3] = 20 * decimals_factor; + ranges[4] = 50 * decimals_factor; + ranges[5] = 80 * decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Eth.sol b/contracts/token_holding_amount/erc20/Eth.sol new file mode 100644 index 0000000..39d4ff2 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Eth.sol @@ -0,0 +1,61 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Eth is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[Web3Networks.Ethereum] = "Native Token"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x2170ed0880ac9a755fd29b2688956bd959f933f8"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "eth"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + + // all ranges multiplied by decimals_factor(1000). + // pub const ETH_AMOUNT_RANGE: [f64; 10] = [0.0, 0.01, 0.05, 0.2, 0.6, 1.2, 3.0, 8.0, 20.0, 50.0]; + ranges[0] = 0; + ranges[1] = 10; + ranges[2] = 50; + ranges[3] = 200; + ranges[4] = 600; + ranges[5] = 1200; + ranges[6] = 3000; + ranges[7] = 8000; + ranges[8] = 20000; + ranges[9] = 50000; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Fil.sol b/contracts/token_holding_amount/erc20/Fil.sol new file mode 100644 index 0000000..96c99db --- /dev/null +++ b/contracts/token_holding_amount/erc20/Fil.sol @@ -0,0 +1,56 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Fil is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = ""; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x0d8ce2a99bb6e3b7db580ed848240e4a0f9ae153"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "fil"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](6); + ranges[0] = 0 * decimals_factor; + ranges[1] = 10 * decimals_factor; + ranges[2] = 30 * decimals_factor; + ranges[3] = 80 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Grt.sol b/contracts/token_holding_amount/erc20/Grt.sol new file mode 100644 index 0000000..2dc1f05 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Grt.sol @@ -0,0 +1,59 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Grt is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xc944e90c64b2c07662a292be6244bdf05cda44a7"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x52ce071bd9b1c4b00a0b92d298c512478cad67e8"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "grt"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Gtc.sol b/contracts/token_holding_amount/erc20/Gtc.sol new file mode 100644 index 0000000..e3dde8d --- /dev/null +++ b/contracts/token_holding_amount/erc20/Gtc.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Gtc is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xde30da39c46104798bb5aa3fe8b9e0e1f348163f"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "gtc"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Gusd.sol b/contracts/token_holding_amount/erc20/Gusd.sol new file mode 100644 index 0000000..d2701f6 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Gusd.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Gusd is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "gusd"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Imx.sol b/contracts/token_holding_amount/erc20/Imx.sol new file mode 100644 index 0000000..6dc12e1 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Imx.sol @@ -0,0 +1,58 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Imx is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xf57e7e7c23978c3caec3c3548e3d615c346e79ff"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "imx"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](8); + ranges[0] = 0 * decimals_factor; + ranges[1] = 10 * decimals_factor; + ranges[2] = 30 * decimals_factor; + ranges[3] = 80 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 1000 * decimals_factor; + ranges[7] = 2000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Inj.sol b/contracts/token_holding_amount/erc20/Inj.sol new file mode 100644 index 0000000..c645961 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Inj.sol @@ -0,0 +1,56 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Inj is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "inj"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](6); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 5 * decimals_factor; + ranges[3] = 20 * decimals_factor; + ranges[4] = 50 * decimals_factor; + ranges[5] = 80 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Leo.sol b/contracts/token_holding_amount/erc20/Leo.sol new file mode 100644 index 0000000..e027aed --- /dev/null +++ b/contracts/token_holding_amount/erc20/Leo.sol @@ -0,0 +1,56 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Leo is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x2af5d2ad76741191d15dfe7bf6ac92d4bd912ca3"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "leo"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](6); + ranges[0] = 0 * decimals_factor; + ranges[1] = 10 * decimals_factor; + ranges[2] = 30 * decimals_factor; + ranges[3] = 80 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Link.sol b/contracts/token_holding_amount/erc20/Link.sol new file mode 100644 index 0000000..7a02565 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Link.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Link is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x514910771af9ca656af840dff83e8264ecf986ca"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "link"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Lit.sol b/contracts/token_holding_amount/erc20/Lit.sol new file mode 100644 index 0000000..72a32f0 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Lit.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Lit is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xb59490ab09a0f526cc7305822ac65f2ab12f9723"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0xb59490ab09a0f526cc7305822ac65f2ab12f9723"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "lit"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Matic.sol b/contracts/token_holding_amount/erc20/Matic.sol new file mode 100644 index 0000000..35e5a31 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Matic.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Matic is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0xcc42724c6683b7e57334c4e856f4c9965ed682bd"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "matic"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Mcrt.sol b/contracts/token_holding_amount/erc20/Mcrt.sol new file mode 100644 index 0000000..3050a42 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Mcrt.sol @@ -0,0 +1,56 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Mcrt is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xde16ce60804a881e9f8c4ebb3824646edecd478d"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x4b8285aB433D8f69CB48d5Ad62b415ed1a221e4f"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "mcrt"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](6); + ranges[0] = 0 * decimals_factor; + ranges[1] = 2000 * decimals_factor; + ranges[2] = 10000 * decimals_factor; + ranges[3] = 50000 * decimals_factor; + ranges[4] = 150000 * decimals_factor; + ranges[5] = 500000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Nfp.sol b/contracts/token_holding_amount/erc20/Nfp.sol new file mode 100644 index 0000000..64e1de9 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Nfp.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Nfp is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = ""; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x75e8ddb518bb757b4282cd5b83bb70d4101d12fb"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "nfp"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/People.sol b/contracts/token_holding_amount/erc20/People.sol new file mode 100644 index 0000000..e8e324e --- /dev/null +++ b/contracts/token_holding_amount/erc20/People.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract People is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x7a58c0be72be218b41c608b7fe7c5bb630736c71"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "people"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Shib.sol b/contracts/token_holding_amount/erc20/Shib.sol new file mode 100644 index 0000000..4f99b35 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Shib.sol @@ -0,0 +1,58 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Shib is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "shib"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](8); + ranges[0] = 0 * decimals_factor; + ranges[1] = 400000 * decimals_factor; + ranges[2] = 2000000 * decimals_factor; + ranges[3] = 10000000 * decimals_factor; + ranges[4] = 20000000 * decimals_factor; + ranges[5] = 40000000 * decimals_factor; + ranges[6] = 100000000 * decimals_factor; + ranges[7] = 200000000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Sol.sol b/contracts/token_holding_amount/erc20/Sol.sol new file mode 100644 index 0000000..e360f97 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Sol.sol @@ -0,0 +1,59 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Sol is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x5288738df1aeb0894713de903e1d0c001eeb7644"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x570a5d26f7765ecb712c0924e4de545b89fd43df"; + // Add more addresses as needed + } + function getTokenName() internal pure override returns (string memory) { + return "sol"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/SpaceId.sol b/contracts/token_holding_amount/erc20/SpaceId.sol new file mode 100644 index 0000000..fe54df7 --- /dev/null +++ b/contracts/token_holding_amount/erc20/SpaceId.sol @@ -0,0 +1,59 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract SpaceId is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x2dff88a56767223a5529ea5960da7a3f5f766406"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x2dff88a56767223a5529ea5960da7a3f5f766406"; + // Add more addresses as needed + } + function getTokenName() internal pure override returns (string memory) { + return "SpaceId"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Ton.sol b/contracts/token_holding_amount/erc20/Ton.sol new file mode 100644 index 0000000..3c5fdd7 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Ton.sol @@ -0,0 +1,59 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Ton is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x582d872a1b094fc48f5de31d3b73f2d9be47def1"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x76a797a59ba2c17726896976b7b3747bfd1d220f"; + // Add more addresses as needed + } + function getTokenName() internal pure override returns (string memory) { + return "ton"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Trx.sol b/contracts/token_holding_amount/erc20/Trx.sol new file mode 100644 index 0000000..7da1d4d --- /dev/null +++ b/contracts/token_holding_amount/erc20/Trx.sol @@ -0,0 +1,59 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Trx is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x50327c6c5a14dcade707abad2e27eb517df87ab5"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3"; + // Add more addresses as needed + } + function getTokenName() internal pure override returns (string memory) { + return "trx"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Tusd.sol b/contracts/token_holding_amount/erc20/Tusd.sol new file mode 100644 index 0000000..3521a0f --- /dev/null +++ b/contracts/token_holding_amount/erc20/Tusd.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Tusd is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x0000000000085d4780b73119b644ae5ecd22b376"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x40af3827F39D0EAcBF4A168f8D4ee67c121D11c9"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "tusd"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Uni.sol b/contracts/token_holding_amount/erc20/Uni.sol new file mode 100644 index 0000000..4a13b94 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Uni.sol @@ -0,0 +1,59 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Uni is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0xbf5140a22578168fd562dccf235e5d43a02ce9b1"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "uni"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0 * decimals_factor; + ranges[1] = 10 * decimals_factor; + ranges[2] = 30 * decimals_factor; + ranges[3] = 80 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 1000 * decimals_factor; + ranges[7] = 2000 * decimals_factor; + ranges[8] = 5000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Usdc.sol b/contracts/token_holding_amount/erc20/Usdc.sol new file mode 100644 index 0000000..c256b4a --- /dev/null +++ b/contracts/token_holding_amount/erc20/Usdc.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Usdc is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "usdc"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](9); + ranges[0] = 0 * decimals_factor; + ranges[1] = 10 * decimals_factor; + ranges[2] = 30 * decimals_factor; + ranges[3] = 80 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 1000 * decimals_factor; + ranges[7] = 2000 * decimals_factor; + ranges[8] = 5000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Usdd.sol b/contracts/token_holding_amount/erc20/Usdd.sol new file mode 100644 index 0000000..6f8cb8f --- /dev/null +++ b/contracts/token_holding_amount/erc20/Usdd.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Usdd is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x0c10bf8fcb7bf5412187a595ab97a3609160b5c6"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0xd17479997f34dd9156deef8f95a52d81d265be9c"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "usdd"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Usdt.sol b/contracts/token_holding_amount/erc20/Usdt.sol new file mode 100644 index 0000000..245c4e8 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Usdt.sol @@ -0,0 +1,60 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract Usdt is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0xdac17f958d2ee523a2206206994597c13d831ec7"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = "0x55d398326f99059ff775485246999027b3197955"; + // Add more addresses as needed + } + + function getTokenName() internal pure override returns (string memory) { + return "usdt"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](10); + ranges[0] = 0 * decimals_factor; + ranges[1] = 1 * decimals_factor; + ranges[2] = 50 * decimals_factor; + ranges[3] = 100 * decimals_factor; + ranges[4] = 200 * decimals_factor; + ranges[5] = 500 * decimals_factor; + ranges[6] = 800 * decimals_factor; + ranges[7] = 1200 * decimals_factor; + ranges[8] = 1600 * decimals_factor; + ranges[9] = 3000 * decimals_factor; + + return ranges; + } +} diff --git a/contracts/token_holding_amount/erc20/Wbtc.sol b/contracts/token_holding_amount/erc20/Wbtc.sol new file mode 100644 index 0000000..b3fd609 --- /dev/null +++ b/contracts/token_holding_amount/erc20/Wbtc.sol @@ -0,0 +1,66 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Identities.sol"; + +contract SpaceId is ERC20 { + constructor() { + // Initialize network token addresses + networkTokenAddresses[ + Web3Networks.Ethereum + ] = "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"; + networkTokenAddresses[ + Web3Networks.Bsc + ] = ""; + // Add more addresses as needed + } + function getTokenName() internal pure override returns (string memory) { + return "wbtc"; + } + + function getTokenRanges() + internal + pure + override + returns (uint256[] memory) + { + uint256[] memory ranges = new uint256[](14); + + // all ranges multiplied by decimals_factor(1000). + // pub const BTC_AMOUNT_RANGE: [f64; 14] =[0.0, 0.001, 0.1, 0.3, 0.6, 1.0, 2.0, 5.0, 10.0, 15.0, 25.0, 30.0, 40.0, 50.0]; + ranges[0] = 0; + ranges[1] = 1; + ranges[2] = 100; + ranges[3] = 300; + ranges[4] = 600; + ranges[5] = 1000; + ranges[6] = 2000; + ranges[7] = 5000; + ranges[8] = 10000; + ranges[9] = 15000; + ranges[10] = 25000; + ranges[11] = 30000; + ranges[12] = 40000; + ranges[13] = 50000; + + return ranges; + } +} From e1020a59815077205546621fdc915fcb48be8b11 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Thu, 20 Jun 2024 11:40:47 +0800 Subject: [PATCH 18/23] refactor token info --- contracts/DynamicAssertion.sol | 30 +- contracts/libraries/Constants.sol | 23 + contracts/libraries/Utils.sol | 7 + contracts/token_holding_amount/BRC20.sol | 43 +- contracts/token_holding_amount/ERC20.sol | 308 +++++++++++- .../TokenHoldingAmount.sol | 65 ++- .../brc20/BRC20TokenLibrary.sol | 99 ++++ contracts/token_holding_amount/brc20/Btcs.sol | 30 +- contracts/token_holding_amount/brc20/Cats.sol | 28 +- contracts/token_holding_amount/brc20/Long.sol | 30 +- contracts/token_holding_amount/brc20/Mmss.sol | 30 +- contracts/token_holding_amount/brc20/Ordi.sol | 28 +- contracts/token_holding_amount/brc20/Rats.sol | 30 +- contracts/token_holding_amount/brc20/Sats.sol | 30 +- contracts/token_holding_amount/erc20/Ada.sol | 40 +- contracts/token_holding_amount/erc20/Amp.sol | 47 +- contracts/token_holding_amount/erc20/Atom.sol | 39 +- contracts/token_holding_amount/erc20/Bch.sol | 27 +- contracts/token_holding_amount/erc20/Bean.sol | 38 +- contracts/token_holding_amount/erc20/Bnb.sol | 46 +- contracts/token_holding_amount/erc20/Comp.sol | 48 +- contracts/token_holding_amount/erc20/Cro.sol | 40 +- contracts/token_holding_amount/erc20/Crv.sol | 46 +- contracts/token_holding_amount/erc20/Cvx.sol | 47 +- contracts/token_holding_amount/erc20/Dai.sol | 44 +- contracts/token_holding_amount/erc20/Doge.sol | 40 +- contracts/token_holding_amount/erc20/Dydx.sol | 46 +- .../erc20/ERC20TokenLibrary.sol | 468 ++++++++++++++++++ contracts/token_holding_amount/erc20/Etc.sol | 38 +- contracts/token_holding_amount/erc20/Eth.sol | 23 +- contracts/token_holding_amount/erc20/Fil.sol | 38 +- contracts/token_holding_amount/erc20/Grt.sol | 46 +- contracts/token_holding_amount/erc20/Gtc.sol | 46 +- contracts/token_holding_amount/erc20/Gusd.sol | 46 +- contracts/token_holding_amount/erc20/Imx.sol | 42 +- contracts/token_holding_amount/erc20/Inj.sol | 38 +- contracts/token_holding_amount/erc20/Leo.sol | 38 +- contracts/token_holding_amount/erc20/Link.sol | 46 +- contracts/token_holding_amount/erc20/Lit.sol | 46 +- .../token_holding_amount/erc20/Matic.sol | 46 +- contracts/token_holding_amount/erc20/Mcrt.sol | 39 +- contracts/token_holding_amount/erc20/Nfp.sol | 46 +- .../token_holding_amount/erc20/People.sol | 46 +- contracts/token_holding_amount/erc20/Shib.sol | 42 +- contracts/token_holding_amount/erc20/Sol.sol | 47 +- .../token_holding_amount/erc20/SpaceId.sol | 49 +- contracts/token_holding_amount/erc20/Ton.sol | 47 +- contracts/token_holding_amount/erc20/Trx.sol | 47 +- contracts/token_holding_amount/erc20/Tusd.sol | 47 +- contracts/token_holding_amount/erc20/Uni.sol | 45 +- contracts/token_holding_amount/erc20/Usdc.sol | 45 +- contracts/token_holding_amount/erc20/Usdd.sol | 47 +- contracts/token_holding_amount/erc20/Usdt.sol | 46 +- contracts/token_holding_amount/erc20/Wbtc.sol | 27 +- 54 files changed, 1758 insertions(+), 1152 deletions(-) create mode 100644 contracts/libraries/Constants.sol create mode 100644 contracts/token_holding_amount/brc20/BRC20TokenLibrary.sol create mode 100644 contracts/token_holding_amount/erc20/ERC20TokenLibrary.sol diff --git a/contracts/DynamicAssertion.sol b/contracts/DynamicAssertion.sol index c641908..e3f04a8 100644 --- a/contracts/DynamicAssertion.sol +++ b/contracts/DynamicAssertion.sol @@ -21,20 +21,20 @@ pragma solidity ^0.8.8; import "./libraries/Identities.sol"; abstract contract DynamicAssertion { - string schema_url; + string schema_url; - function execute( - Identity[] memory identities, - string[] memory secrets, - bytes memory params - ) - public - virtual - returns ( - string memory, - string memory, - string[] memory, - string memory, - bool - ); + function execute( + Identity[] memory identities, + string[] memory secrets, + bytes memory params + ) + public + virtual + returns ( + string memory, + string memory, + string[] memory, + string memory, + bool + ); } diff --git a/contracts/libraries/Constants.sol b/contracts/libraries/Constants.sol new file mode 100644 index 0000000..1d2abea --- /dev/null +++ b/contracts/libraries/Constants.sol @@ -0,0 +1,23 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +library Constants { + uint256 constant decimals_factor = 1000; +} diff --git a/contracts/libraries/Utils.sol b/contracts/libraries/Utils.sol index 249861c..42dbbb7 100644 --- a/contracts/libraries/Utils.sol +++ b/contracts/libraries/Utils.sol @@ -165,4 +165,11 @@ library Utils { return (success, value); } + + function isStringsEqual( + string memory a, + string memory b + ) internal pure returns (bool) { + return keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b)); + } } diff --git a/contracts/token_holding_amount/BRC20.sol b/contracts/token_holding_amount/BRC20.sol index d8c9fc5..92494dc 100644 --- a/contracts/token_holding_amount/BRC20.sol +++ b/contracts/token_holding_amount/BRC20.sol @@ -22,8 +22,8 @@ import "../libraries/Identities.sol"; import "../libraries/Http.sol"; import "../libraries/Utils.sol"; import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; - -abstract contract BRC20 is TokenHoldingAmount { +import "./brc20/BRC20TokenLibrary.sol"; +contract BRC20 is TokenHoldingAmount { function getTokenDecimals() internal pure override returns (uint8) { return 18; } @@ -31,7 +31,8 @@ abstract contract BRC20 is TokenHoldingAmount { function queryBalance( Identity memory identity, uint32 network, - string[] memory secrets + string[] memory secrets, + string memory tokenName ) internal virtual override returns (uint256) { (bool identityToStringSuccess, string memory identityString) = Utils .identityToString(network, identity.value); @@ -43,7 +44,7 @@ abstract contract BRC20 is TokenHoldingAmount { // below url is used for test against mock server "http://localhost:19529/api/1/brc20/balance", "?tick=", - getTokenName(), + tokenName, "&address=", identityString ) @@ -76,4 +77,38 @@ abstract contract BRC20 is TokenHoldingAmount { ) internal pure override returns (bool) { return network == Web3Networks.BitcoinP2tr; } + + function getTokenInfo( + string memory decodedParams + ) + internal + pure + override + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName; + uint256[] memory ranges; + string memory tokenBscAddress = ""; + string memory tokenEthereumAddress = ""; + + if (Utils.isStringsEqual(decodedParams, "btcs")) { + (tokenName, ranges) = BRC0TokenLibrary.getBtcsInfo(); + } else if (Utils.isStringsEqual(decodedParams, "cats")) { + (tokenName, ranges) = BRC0TokenLibrary.getCatsInfo(); + } else if (Utils.isStringsEqual(decodedParams, "long")) { + (tokenName, ranges) = BRC0TokenLibrary.getLongInfo(); + } else if (Utils.isStringsEqual(decodedParams, "mmss")) { + (tokenName, ranges) = BRC0TokenLibrary.getMmssInfo(); + } else if (Utils.isStringsEqual(decodedParams, "ordi")) { + (tokenName, ranges) = BRC0TokenLibrary.getOrdiInfo(); + } else if (Utils.isStringsEqual(decodedParams, "rats")) { + (tokenName, ranges) = BRC0TokenLibrary.getRatsInfo(); + } else if (Utils.isStringsEqual(decodedParams, "sats")) { + (tokenName, ranges) = BRC0TokenLibrary.getSatsInfo(); + } else { + revert("Unsupported token"); + } + + return (tokenName, ranges, tokenBscAddress, tokenEthereumAddress); + } } diff --git a/contracts/token_holding_amount/ERC20.sol b/contracts/token_holding_amount/ERC20.sol index 428fd39..561a436 100644 --- a/contracts/token_holding_amount/ERC20.sol +++ b/contracts/token_holding_amount/ERC20.sol @@ -17,26 +17,28 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.8; + import "../libraries/Identities.sol"; import "../libraries/Utils.sol"; import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; import { NoderealClient } from "./NoderealClient.sol"; -abstract contract ERC20 is TokenHoldingAmount { - mapping(uint32 => string) internal networkTokenAddresses; - +import { ERC20TokenLibrary } from "./erc20/ERC20TokenLibrary.sol"; +contract ERC20 is TokenHoldingAmount { mapping(uint32 => string) internal networkUrls; mapping(uint32 => bool) private queriedNetworks; + constructor() { - networkUrls[ - Web3Networks.Bsc - ] = "https://bsc-mainnet.nodereal.io/v1/"; + networkUrls[Web3Networks.Bsc] = "https://bsc-mainnet.nodereal.io/v1/"; networkUrls[ Web3Networks.Ethereum ] = "https://eth-mainnet.nodereal.io/v1/"; // Add more networks as needed - // below url is used for test against mock server + // below url is used for test against mock server // "http://localhost:19530/nodereal_jsonrpc/v1/", + + // Initialize network token addresses using Ada library } + function getTokenDecimals() internal pure override returns (uint8) { return 18; } @@ -44,8 +46,9 @@ abstract contract ERC20 is TokenHoldingAmount { function queryBalance( Identity memory identity, uint32 network, - string[] memory secrets - ) internal virtual override returns (uint256) { + string[] memory secrets, + string memory /*tokenName*/ + ) internal override returns (uint256) { (bool identityToStringSuccess, string memory identityString) = Utils .identityToString(network, identity.value); @@ -56,9 +59,9 @@ abstract contract ERC20 is TokenHoldingAmount { for (uint32 i = 0; i < networks.length; i++) { // Check if this network has been queried - if (!queriedNetworks[network]) { - string memory _tokenContractAddress = networkTokenAddresses[ - network + if (!queriedNetworks[networks[i]]) { + string memory _tokenContractAddress = tokenAddresses[ + networks[i] ]; url = string( @@ -76,7 +79,7 @@ abstract contract ERC20 is TokenHoldingAmount { totalBalance += balance; } // Mark this network as queried - queriedNetworks[network] = true; + queriedNetworks[networks[i]] = true; } } return totalBalance; @@ -97,4 +100,283 @@ abstract contract ERC20 is TokenHoldingAmount { ) internal pure override returns (bool) { return network == Web3Networks.Bsc || network == Web3Networks.Ethereum; } + + function getTokenInfo( + string memory decodedParams + ) + internal + pure + override + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName; + uint256[] memory ranges; + string memory tokenBscAddress; + string memory tokenEthereumAddress; + + if (Utils.isStringsEqual(decodedParams, "ada")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getAdaInfo(); + } else if (Utils.isStringsEqual(decodedParams, "amp")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getAmpInfo(); + } else if (Utils.isStringsEqual(decodedParams, "atom")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getAtomInfo(); + } else if (Utils.isStringsEqual(decodedParams, "bch")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getBchInfo(); + } else if (Utils.isStringsEqual(decodedParams, "bean")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getBeanInfo(); + } else if (Utils.isStringsEqual(decodedParams, "bnb")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getBnbInfo(); + } else if (Utils.isStringsEqual(decodedParams, "comp")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getCompInfo(); + } else if (Utils.isStringsEqual(decodedParams, "cro")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getCroInfo(); + } else if (Utils.isStringsEqual(decodedParams, "crv")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getCrvInfo(); + } else if (Utils.isStringsEqual(decodedParams, "dai")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getDaiInfo(); + } else if (Utils.isStringsEqual(decodedParams, "doge")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getDogeInfo(); + } else if (Utils.isStringsEqual(decodedParams, "dydx")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getDydxInfo(); + } else if (Utils.isStringsEqual(decodedParams, "etc")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getEtcInfo(); + } else if (Utils.isStringsEqual(decodedParams, "eth")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getEthInfo(); + } else if (Utils.isStringsEqual(decodedParams, "fil")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getFilInfo(); + } else if (Utils.isStringsEqual(decodedParams, "grt")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getGrtInfo(); + } else if (Utils.isStringsEqual(decodedParams, "gtc")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getGtcInfo(); + } else if (Utils.isStringsEqual(decodedParams, "gusd")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getGusdInfo(); + } else if (Utils.isStringsEqual(decodedParams, "imx")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getImxInfo(); + } else if (Utils.isStringsEqual(decodedParams, "inj")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getInjInfo(); + } else if (Utils.isStringsEqual(decodedParams, "leo")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getLeoInfo(); + } else if (Utils.isStringsEqual(decodedParams, "link")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getLinkInfo(); + } else if (Utils.isStringsEqual(decodedParams, "lit")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getLitInfo(); + } else if (Utils.isStringsEqual(decodedParams, "matic")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getMaticInfo(); + } else if (Utils.isStringsEqual(decodedParams, "mcrt")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getMcrtInfo(); + } else if (Utils.isStringsEqual(decodedParams, "nfp")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getNfpInfo(); + } else if (Utils.isStringsEqual(decodedParams, "people")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getPeopleInfo(); + } else if (Utils.isStringsEqual(decodedParams, "shib")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getShibInfo(); + } else if (Utils.isStringsEqual(decodedParams, "sol")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getSolInfo(); + } else if (Utils.isStringsEqual(decodedParams, "spaceid")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getSpaceIdInfo(); + } else if (Utils.isStringsEqual(decodedParams, "ton")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getTonInfo(); + } else if (Utils.isStringsEqual(decodedParams, "trx")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getTrxInfo(); + } else if (Utils.isStringsEqual(decodedParams, "tusd")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getTusdInfo(); + } else if (Utils.isStringsEqual(decodedParams, "uni")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getUniInfo(); + } else if (Utils.isStringsEqual(decodedParams, "usdc")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getUsdcInfo(); + } else if (Utils.isStringsEqual(decodedParams, "usdt")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getUsdtInfo(); + } else if (Utils.isStringsEqual(decodedParams, "wbtc")) { + ( + tokenName, + ranges, + tokenBscAddress, + tokenEthereumAddress + ) = ERC20TokenLibrary.getWbtcInfo(); + } else { + revert("Unsupported token"); + } + + return (tokenName, ranges, tokenBscAddress, tokenEthereumAddress); + } } diff --git a/contracts/token_holding_amount/TokenHoldingAmount.sol b/contracts/token_holding_amount/TokenHoldingAmount.sol index 18a5871..b3acad8 100644 --- a/contracts/token_holding_amount/TokenHoldingAmount.sol +++ b/contracts/token_holding_amount/TokenHoldingAmount.sol @@ -18,16 +18,24 @@ pragma solidity ^0.8.8; +// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.0/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "../libraries/AssertionLogic.sol"; import "../libraries/Identities.sol"; import "../DynamicAssertion.sol"; +import "../libraries/Constants.sol"; + abstract contract TokenHoldingAmount is DynamicAssertion { - uint256 constant decimals_factor = 1000; + mapping(uint32 => string) tokenAddresses; + string tokenName; + uint256[] tokenRanges; + string tokenBscAddress; + string tokenEthereumAddress; + function execute( Identity[] memory identities, string[] memory secrets, - bytes memory /*params*/ + bytes memory params ) public override @@ -44,9 +52,23 @@ abstract contract TokenHoldingAmount is DynamicAssertion { string memory assertion_type = "Token Holding Amount"; schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/25-token-holding-amount/1-1-0.json"; + string memory decodedParams = abi.decode(params, (string)); + + ( + tokenName, + tokenRanges, + tokenBscAddress, + tokenEthereumAddress + ) = getTokenInfo(decodedParams); + tokenAddresses[Web3Networks.Bsc] = tokenBscAddress; + tokenAddresses[Web3Networks.Ethereum] = tokenEthereumAddress; + uint256 balance = queryTotalBalance(identities, secrets); - (uint256 index, uint256 min, int256 max) = calculateRange(balance); + (uint256 index, uint256 min, int256 max) = calculateRange( + balance, + tokenRanges + ); string[] memory assertions = assembleAssertions(min, max); @@ -68,7 +90,12 @@ abstract contract TokenHoldingAmount is DynamicAssertion { for (uint32 j = 0; j < networksLength; j++) { uint32 network = identity.networks[j]; if (isSupportedNetwork(network)) { - total_balance += queryBalance(identity, network, secrets); + total_balance += queryBalance( + identity, + network, + secrets, + tokenName + ); } } } @@ -77,16 +104,17 @@ abstract contract TokenHoldingAmount is DynamicAssertion { } function calculateRange( - uint256 balance + uint256 balance, + uint256[] memory ranges ) private pure returns (uint256, uint256, int256) { - uint256[] memory ranges = getTokenRanges(); uint256 index = ranges.length - 1; uint256 min = 0; int256 max = 0; for (uint32 i = 1; i < ranges.length; i++) { if ( - balance * decimals_factor < ranges[i] * 10 ** getTokenDecimals() + balance * Constants.decimals_factor < + ranges[i] * 10 ** getTokenDecimals() ) { index = i - 1; break; @@ -107,7 +135,7 @@ abstract contract TokenHoldingAmount is DynamicAssertion { function assembleAssertions( uint256 min, int256 max - ) private pure returns (string[] memory) { + ) private view returns (string[] memory) { string memory variable = "$holding_amount"; AssertionLogic.CompositeCondition memory cc = AssertionLogic .CompositeCondition( @@ -119,14 +147,14 @@ abstract contract TokenHoldingAmount is DynamicAssertion { 0, "$token", AssertionLogic.Op.Equal, - getTokenName() + tokenName ); AssertionLogic.andOp( cc, 1, variable, AssertionLogic.Op.GreaterEq, - Strings.toString(min / decimals_factor) + Strings.toString(min / Constants.decimals_factor) ); if (max > 0) { AssertionLogic.andOp( @@ -134,7 +162,7 @@ abstract contract TokenHoldingAmount is DynamicAssertion { 2, variable, AssertionLogic.Op.LessThan, - Strings.toString(uint256(max) / decimals_factor) + Strings.toString(uint256(max) / Constants.decimals_factor) ); } @@ -144,10 +172,6 @@ abstract contract TokenHoldingAmount is DynamicAssertion { return assertions; } - function getTokenName() internal pure virtual returns (string memory); - - function getTokenRanges() internal pure virtual returns (uint256[] memory); - function getTokenDecimals() internal pure virtual returns (uint8); function isSupportedNetwork( @@ -157,6 +181,15 @@ abstract contract TokenHoldingAmount is DynamicAssertion { function queryBalance( Identity memory identity, uint32 network, - string[] memory secrets + string[] memory secrets, + string memory tokenName ) internal virtual returns (uint256); + + function getTokenInfo( + string memory decodedParams + ) + internal + pure + virtual + returns (string memory, uint256[] memory, string memory, string memory); } diff --git a/contracts/token_holding_amount/brc20/BRC20TokenLibrary.sol b/contracts/token_holding_amount/brc20/BRC20TokenLibrary.sol new file mode 100644 index 0000000..bfb1d42 --- /dev/null +++ b/contracts/token_holding_amount/brc20/BRC20TokenLibrary.sol @@ -0,0 +1,99 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { Btcs } from "./Btcs.sol"; +import { Cats } from "./Cats.sol"; +import { Long } from "./Long.sol"; +import { Mmss } from "./Mmss.sol"; +import { Ordi } from "./Ordi.sol"; +import { Rats } from "./Rats.sol"; +import { Sats } from "./Sats.sol"; + +library BRC0TokenLibrary { + function getBtcsInfo() + public + pure + returns (string memory, uint256[] memory) + { + string memory tokenName = Btcs.getTokenName(); + uint256[] memory ranges = Btcs.getTokenRanges(); + + return (tokenName, ranges); + } + function getCatsInfo() + public + pure + returns (string memory, uint256[] memory) + { + string memory tokenName = Cats.getTokenName(); + uint256[] memory ranges = Cats.getTokenRanges(); + + return (tokenName, ranges); + } + + function getLongInfo() + public + pure + returns (string memory, uint256[] memory) + { + string memory tokenName = Long.getTokenName(); + uint256[] memory ranges = Long.getTokenRanges(); + + return (tokenName, ranges); + } + + function getMmssInfo() + public + pure + returns (string memory, uint256[] memory) + { + string memory tokenName = Mmss.getTokenName(); + uint256[] memory ranges = Mmss.getTokenRanges(); + + return (tokenName, ranges); + } + function getOrdiInfo() + public + pure + returns (string memory, uint256[] memory) + { + string memory tokenName = Ordi.getTokenName(); + uint256[] memory ranges = Ordi.getTokenRanges(); + return (tokenName, ranges); + } + function getRatsInfo() + public + pure + returns (string memory, uint256[] memory) + { + string memory tokenName = Rats.getTokenName(); + uint256[] memory ranges = Rats.getTokenRanges(); + return (tokenName, ranges); + } + function getSatsInfo() + public + pure + returns (string memory, uint256[] memory) + { + string memory tokenName = Sats.getTokenName(); + uint256[] memory ranges = Sats.getTokenRanges(); + return (tokenName, ranges); + } +} diff --git a/contracts/token_holding_amount/brc20/Btcs.sol b/contracts/token_holding_amount/brc20/Btcs.sol index 2561eff..e888748 100644 --- a/contracts/token_holding_amount/brc20/Btcs.sol +++ b/contracts/token_holding_amount/brc20/Btcs.sol @@ -19,28 +19,24 @@ pragma solidity ^0.8.8; import { BRC20 } from "../BRC20.sol"; +import "../../libraries/Constants.sol"; -contract Btcs is BRC20 { - function getTokenName() internal pure override returns (string memory) { +library Btcs { + function getTokenName() internal pure returns (string memory) { return "btcs"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 5 * decimals_factor; - ranges[3] = 20 * decimals_factor; - ranges[4] = 50 * decimals_factor; - ranges[5] = 100 * decimals_factor; - ranges[6] = 200 * decimals_factor; - ranges[7] = 500 * decimals_factor; - ranges[8] = 800 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 5 * Constants.decimals_factor; + ranges[3] = 20 * Constants.decimals_factor; + ranges[4] = 50 * Constants.decimals_factor; + ranges[5] = 100 * Constants.decimals_factor; + ranges[6] = 200 * Constants.decimals_factor; + ranges[7] = 500 * Constants.decimals_factor; + ranges[8] = 800 * Constants.decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/brc20/Cats.sol b/contracts/token_holding_amount/brc20/Cats.sol index 06f1722..3448b86 100644 --- a/contracts/token_holding_amount/brc20/Cats.sol +++ b/contracts/token_holding_amount/brc20/Cats.sol @@ -19,27 +19,23 @@ pragma solidity ^0.8.8; import { BRC20 } from "../BRC20.sol"; +import "../../libraries/Constants.sol"; -contract Cats is BRC20 { - function getTokenName() internal pure override returns (string memory) { +library Cats { + function getTokenName() internal pure returns (string memory) { return "cats"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 10000 * decimals_factor; - ranges[3] = 50000 * decimals_factor; - ranges[4] = 100000 * decimals_factor; - ranges[5] = 200000 * decimals_factor; - ranges[6] = 500000 * decimals_factor; - ranges[7] = 800000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 10000 * Constants.decimals_factor; + ranges[3] = 50000 * Constants.decimals_factor; + ranges[4] = 100000 * Constants.decimals_factor; + ranges[5] = 200000 * Constants.decimals_factor; + ranges[6] = 500000 * Constants.decimals_factor; + ranges[7] = 800000 * Constants.decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/brc20/Long.sol b/contracts/token_holding_amount/brc20/Long.sol index 38d0ef5..7a77fc2 100644 --- a/contracts/token_holding_amount/brc20/Long.sol +++ b/contracts/token_holding_amount/brc20/Long.sol @@ -19,28 +19,24 @@ pragma solidity ^0.8.8; import { BRC20 } from "../BRC20.sol"; +import "../../libraries/Constants.sol"; -contract Long is BRC20 { - function getTokenName() internal pure override returns (string memory) { +library Long { + function getTokenName() internal pure returns (string memory) { return "long"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 20 * decimals_factor; - ranges[3] = 50 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 1000 * decimals_factor; - ranges[7] = 2000 * decimals_factor; - ranges[8] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 20 * Constants.decimals_factor; + ranges[3] = 50 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 1000 * Constants.decimals_factor; + ranges[7] = 2000 * Constants.decimals_factor; + ranges[8] = 3000 * Constants.decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/brc20/Mmss.sol b/contracts/token_holding_amount/brc20/Mmss.sol index 41b363c..47b212c 100644 --- a/contracts/token_holding_amount/brc20/Mmss.sol +++ b/contracts/token_holding_amount/brc20/Mmss.sol @@ -19,28 +19,24 @@ pragma solidity ^0.8.8; import { BRC20 } from "../BRC20.sol"; +import "../../libraries/Constants.sol"; -contract Mmss is BRC20 { - function getTokenName() internal pure override returns (string memory) { +library Mmss { + function getTokenName() internal pure returns (string memory) { return "mmss"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 20 * decimals_factor; - ranges[3] = 50 * decimals_factor; - ranges[4] = 100 * decimals_factor; - ranges[5] = 200 * decimals_factor; - ranges[6] = 500 * decimals_factor; - ranges[7] = 1000 * decimals_factor; - ranges[8] = 2000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 20 * Constants.decimals_factor; + ranges[3] = 50 * Constants.decimals_factor; + ranges[4] = 100 * Constants.decimals_factor; + ranges[5] = 200 * Constants.decimals_factor; + ranges[6] = 500 * Constants.decimals_factor; + ranges[7] = 1000 * Constants.decimals_factor; + ranges[8] = 2000 * Constants.decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/brc20/Ordi.sol b/contracts/token_holding_amount/brc20/Ordi.sol index 53c5b4e..c26b27a 100644 --- a/contracts/token_holding_amount/brc20/Ordi.sol +++ b/contracts/token_holding_amount/brc20/Ordi.sol @@ -19,27 +19,23 @@ pragma solidity ^0.8.8; import { BRC20 } from "../BRC20.sol"; +import "../../libraries/Constants.sol"; -contract Ordi is BRC20 { - function getTokenName() internal pure override returns (string memory) { +library Ordi { + function getTokenName() internal pure returns (string memory) { return "ordi"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 5 * decimals_factor; - ranges[3] = 20 * decimals_factor; - ranges[4] = 50 * decimals_factor; - ranges[5] = 100 * decimals_factor; - ranges[6] = 200 * decimals_factor; - ranges[7] = 500 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 5 * Constants.decimals_factor; + ranges[3] = 20 * Constants.decimals_factor; + ranges[4] = 50 * Constants.decimals_factor; + ranges[5] = 100 * Constants.decimals_factor; + ranges[6] = 200 * Constants.decimals_factor; + ranges[7] = 500 * Constants.decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/brc20/Rats.sol b/contracts/token_holding_amount/brc20/Rats.sol index 8044dd1..aff13bd 100644 --- a/contracts/token_holding_amount/brc20/Rats.sol +++ b/contracts/token_holding_amount/brc20/Rats.sol @@ -19,28 +19,24 @@ pragma solidity ^0.8.8; import { BRC20 } from "../BRC20.sol"; +import "../../libraries/Constants.sol"; -contract Rats is BRC20 { - function getTokenName() internal pure override returns (string memory) { +library Rats { + function getTokenName() internal pure returns (string memory) { return "rats"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 40000 * decimals_factor; - ranges[3] = 200000 * decimals_factor; - ranges[4] = 1000000 * decimals_factor; - ranges[5] = 2000000 * decimals_factor; - ranges[6] = 4000000 * decimals_factor; - ranges[7] = 10000000 * decimals_factor; - ranges[8] = 2000000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 40000 * Constants.decimals_factor; + ranges[3] = 200000 * Constants.decimals_factor; + ranges[4] = 1000000 * Constants.decimals_factor; + ranges[5] = 2000000 * Constants.decimals_factor; + ranges[6] = 4000000 * Constants.decimals_factor; + ranges[7] = 10000000 * Constants.decimals_factor; + ranges[8] = 2000000 * Constants.decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/brc20/Sats.sol b/contracts/token_holding_amount/brc20/Sats.sol index cb6671f..0f3519e 100644 --- a/contracts/token_holding_amount/brc20/Sats.sol +++ b/contracts/token_holding_amount/brc20/Sats.sol @@ -19,28 +19,24 @@ pragma solidity ^0.8.8; import { BRC20 } from "../BRC20.sol"; +import "../../libraries/Constants.sol"; -contract Sats is BRC20 { - function getTokenName() internal pure override returns (string memory) { +library Sats { + function getTokenName() internal pure returns (string memory) { return "sats"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 40000000 * decimals_factor; - ranges[3] = 200000000 * decimals_factor; - ranges[4] = 500000000 * decimals_factor; - ranges[5] = 1000000000 * decimals_factor; - ranges[6] = 2000000000 * decimals_factor; - ranges[7] = 4000000000 * decimals_factor; - ranges[8] = 6000000000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 40000000 * Constants.decimals_factor; + ranges[3] = 200000000 * Constants.decimals_factor; + ranges[4] = 500000000 * Constants.decimals_factor; + ranges[5] = 1000000000 * Constants.decimals_factor; + ranges[6] = 2000000000 * Constants.decimals_factor; + ranges[7] = 4000000000 * Constants.decimals_factor; + ranges[8] = 6000000000 * Constants.decimals_factor; return ranges; } } diff --git a/contracts/token_holding_amount/erc20/Ada.sol b/contracts/token_holding_amount/erc20/Ada.sol index ff4c7df..4fdbd83 100644 --- a/contracts/token_holding_amount/erc20/Ada.sol +++ b/contracts/token_holding_amount/erc20/Ada.sol @@ -19,37 +19,29 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; +library Ada { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x3EE2200Efb3400fAbB9AacF31297cBdD1d435D47"; + } -contract Ada is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = ""; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x3EE2200Efb3400fAbB9AacF31297cBdD1d435D47"; - // Add more addresses as needed + function getTokenEthereumAddress() internal pure returns (string memory) { + return ""; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "ada"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](7); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1000 * decimals_factor; - ranges[2] = 5000 * decimals_factor; - ranges[3] = 20000* decimals_factor; - ranges[4] = 50000 * decimals_factor; - ranges[5] = 100000 * decimals_factor; - ranges[6] = 300000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1000 * Constants.decimals_factor; + ranges[2] = 5000 * Constants.decimals_factor; + ranges[3] = 20000 * Constants.decimals_factor; + ranges[4] = 50000 * Constants.decimals_factor; + ranges[5] = 100000 * Constants.decimals_factor; + ranges[6] = 300000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Amp.sol b/contracts/token_holding_amount/erc20/Amp.sol index 80a60f0..4812b2d 100644 --- a/contracts/token_holding_amount/erc20/Amp.sol +++ b/contracts/token_holding_amount/erc20/Amp.sol @@ -19,40 +19,33 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Amp is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xff20817765cb7f73d4bde2e66e067e58d11095c2"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Amp { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; } - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xff20817765cb7f73d4bde2e66e067e58d11095c2"; + } + + function getTokenName() internal pure returns (string memory) { return "amp"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Atom.sol b/contracts/token_holding_amount/erc20/Atom.sol index 8fc38c8..4595f09 100644 --- a/contracts/token_holding_amount/erc20/Atom.sol +++ b/contracts/token_holding_amount/erc20/Atom.sol @@ -20,36 +20,29 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Atom is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x8D983cb9388EaC77af0474fA441C4815500Cb7BB"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x0eb3a705fc54725037cc9e008bdede697f62f335"; - // Add more addresses as needed +library Atom { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x0eb3a705fc54725037cc9e008bdede697f62f335"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x8D983cb9388EaC77af0474fA441C4815500Cb7BB"; + } + + function getTokenName() internal pure returns (string memory) { return "atom"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 5 * decimals_factor; - ranges[3] = 20 * decimals_factor; - ranges[4] = 50 * decimals_factor; - ranges[5] = 80 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 5 * Constants.decimals_factor; + ranges[3] = 20 * Constants.decimals_factor; + ranges[4] = 50 * Constants.decimals_factor; + ranges[5] = 80 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Bch.sol b/contracts/token_holding_amount/erc20/Bch.sol index 64f2f10..c192cef 100644 --- a/contracts/token_holding_amount/erc20/Bch.sol +++ b/contracts/token_holding_amount/erc20/Bch.sol @@ -21,31 +21,22 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -contract Bch is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = ""; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x8fF795a6F4D97E7887C79beA79aba5cc76444aDf"; - // Add more addresses as needed +library Bch { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x8fF795a6F4D97E7887C79beA79aba5cc76444aDf"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return ""; + } + function getTokenName() internal pure returns (string memory) { return "bch"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); - // all ranges multiplied by decimals_factor(1000). + // all ranges multiplied by decimals_factor(1000). // pub const BCH_AMOUNT_RANGE: [f64; 6] = [0.0, 0.1, 0.5, 2.0, 6.0, 12.0]; ranges[0] = 0; diff --git a/contracts/token_holding_amount/erc20/Bean.sol b/contracts/token_holding_amount/erc20/Bean.sol index 7751737..815e3db 100644 --- a/contracts/token_holding_amount/erc20/Bean.sol +++ b/contracts/token_holding_amount/erc20/Bean.sol @@ -20,35 +20,25 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Bean is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xba7b9936a965fac23bb7a8190364fa60622b3cff"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x07da81e9a684ab87fad7206b3bc8d0866f48cc7c"; - // Add more addresses as needed +library Bean { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x07da81e9a684ab87fad7206b3bc8d0866f48cc7c"; } - - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xba7b9936a965fac23bb7a8190364fa60622b3cff"; + } + function getTokenName() internal pure returns (string memory) { return "bean"; } - - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](5); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1500 * decimals_factor; - ranges[2] = 5000 * decimals_factor; - ranges[3] = 10000 * decimals_factor; - ranges[4] = 50000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1500 * Constants.decimals_factor; + ranges[2] = 5000 * Constants.decimals_factor; + ranges[3] = 10000 * Constants.decimals_factor; + ranges[4] = 50000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Bnb.sol b/contracts/token_holding_amount/erc20/Bnb.sol index e37303e..7a05cbd 100644 --- a/contracts/token_holding_amount/erc20/Bnb.sol +++ b/contracts/token_holding_amount/erc20/Bnb.sol @@ -20,37 +20,31 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Bnb is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xb8c77482e45f1f44de1745f52c74426c631bdd52"; - networkTokenAddresses[Web3Networks.Bsc] = "Native Token"; - // Add more addresses as needed +library Bnb { + function getTokenBscAddress() internal pure returns (string memory) { + return "Native Token"; } - function getTokenName() internal pure override returns (string memory) { - return "bnb"; + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xb8c77482e45f1f44de1745f52c74426c631bdd52"; + } + function getTokenName() internal pure returns (string memory) { + return "Bnb"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Comp.sol b/contracts/token_holding_amount/erc20/Comp.sol index adf3514..e9094a0 100644 --- a/contracts/token_holding_amount/erc20/Comp.sol +++ b/contracts/token_holding_amount/erc20/Comp.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Comp is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xc00e94cb662c3520282e6f5717214004a7f26888"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Comp { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xc00e94cb662c3520282e6f5717214004a7f26888"; } - function getTokenName() internal pure override returns (string memory) { - return "comp"; + function getTokenName() internal pure returns (string memory) { + return "bnb"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Cro.sol b/contracts/token_holding_amount/erc20/Cro.sol index 549629f..d5d0b41 100644 --- a/contracts/token_holding_amount/erc20/Cro.sol +++ b/contracts/token_holding_amount/erc20/Cro.sol @@ -20,37 +20,29 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Cro is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Cro { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "cro"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](7); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1000 * decimals_factor; - ranges[2] = 5000 * decimals_factor; - ranges[3] = 20000 * decimals_factor; - ranges[4] = 50000 * decimals_factor; - ranges[5] = 100000 * decimals_factor; - ranges[6] = 300000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1000 * Constants.decimals_factor; + ranges[2] = 5000 * Constants.decimals_factor; + ranges[3] = 20000 * Constants.decimals_factor; + ranges[4] = 50000 * Constants.decimals_factor; + ranges[5] = 100000 * Constants.decimals_factor; + ranges[6] = 300000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Crv.sol b/contracts/token_holding_amount/erc20/Crv.sol index 256d102..82c3a8c 100644 --- a/contracts/token_holding_amount/erc20/Crv.sol +++ b/contracts/token_holding_amount/erc20/Crv.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Crv is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xdac17f958d2ee523a2206206994597c13d831ec7"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Crv { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xdac17f958d2ee523a2206206994597c13d831ec7"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "crv"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Cvx.sol b/contracts/token_holding_amount/erc20/Cvx.sol index 1418959..2bb734e 100644 --- a/contracts/token_holding_amount/erc20/Cvx.sol +++ b/contracts/token_holding_amount/erc20/Cvx.sol @@ -20,40 +20,31 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Cvx is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Cvx { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; } - - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b"; + } + function getTokenName() internal pure returns (string memory) { return "cvx"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Dai.sol b/contracts/token_holding_amount/erc20/Dai.sol index 04699e4..3e11878 100644 --- a/contracts/token_holding_amount/erc20/Dai.sol +++ b/contracts/token_holding_amount/erc20/Dai.sol @@ -19,40 +19,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; +import "../../libraries/Constants.sol"; import "../../libraries/Identities.sol"; -contract Dai is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x6b175474e89094c44da98b954eedeac495271d0f"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3"; - // Add more addresses as needed +library Dai { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x6b175474e89094c44da98b954eedeac495271d0f"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "dai"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0 * decimals_factor; - ranges[1] = 10 * decimals_factor; - ranges[2] = 30 * decimals_factor; - ranges[3] = 80 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 1000 * decimals_factor; - ranges[7] = 2000 * decimals_factor; - ranges[8] = 5000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 10 * Constants.decimals_factor; + ranges[2] = 30 * Constants.decimals_factor; + ranges[3] = 80 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 1000 * Constants.decimals_factor; + ranges[7] = 2000 * Constants.decimals_factor; + ranges[8] = 5000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Doge.sol b/contracts/token_holding_amount/erc20/Doge.sol index c19fb5f..fb830a7 100644 --- a/contracts/token_holding_amount/erc20/Doge.sol +++ b/contracts/token_holding_amount/erc20/Doge.sol @@ -19,37 +19,29 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Doge is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = ""; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0xba2ae424d960c26247dd6c32edc70b295c744c43"; - // Add more addresses as needed +library Doge { + function getTokenBscAddress() internal pure returns (string memory) { + return "0xba2ae424d960c26247dd6c32edc70b295c744c43"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return ""; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "doge"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](7); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1000 * decimals_factor; - ranges[2] = 5000 * decimals_factor; - ranges[3] = 20000 * decimals_factor; - ranges[4] = 50000 * decimals_factor; - ranges[5] = 100000 * decimals_factor; - ranges[6] = 300000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1000 * Constants.decimals_factor; + ranges[2] = 5000 * Constants.decimals_factor; + ranges[3] = 20000 * Constants.decimals_factor; + ranges[4] = 50000 * Constants.decimals_factor; + ranges[5] = 100000 * Constants.decimals_factor; + ranges[6] = 300000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Dydx.sol b/contracts/token_holding_amount/erc20/Dydx.sol index e4b9498..910d5c1 100644 --- a/contracts/token_holding_amount/erc20/Dydx.sol +++ b/contracts/token_holding_amount/erc20/Dydx.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Dydx is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x92d6c1e31e14520e676a687f0a93788b716beff5"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Dydx { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x92d6c1e31e14520e676a687f0a93788b716beff5"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "dydx"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/ERC20TokenLibrary.sol b/contracts/token_holding_amount/erc20/ERC20TokenLibrary.sol new file mode 100644 index 0000000..0f904fd --- /dev/null +++ b/contracts/token_holding_amount/erc20/ERC20TokenLibrary.sol @@ -0,0 +1,468 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import { Ada } from "./Ada.sol"; +import { Amp } from "./Amp.sol"; +import { Atom } from "./Atom.sol"; +import { Bch } from "./Bch.sol"; +import { Bean } from "./Bean.sol"; +import { Bnb } from "./Bnb.sol"; +import { Comp } from "./Comp.sol"; +import { Cro } from "./Cro.sol"; +import { Crv } from "./Crv.sol"; +import { Dai } from "./Dai.sol"; +import { Doge } from "./Doge.sol"; +import { Dydx } from "./Dydx.sol"; +import { Etc } from "./Etc.sol"; +import { Eth } from "./Eth.sol"; +import { Fil } from "./Fil.sol"; +import { Grt } from "./Grt.sol"; +import { Gtc } from "./Gtc.sol"; +import { Gusd } from "./Gusd.sol"; +import { Imx } from "./Imx.sol"; +import { Inj } from "./Inj.sol"; +import { Leo } from "./Leo.sol"; +import { Link } from "./Link.sol"; +import { Lit } from "./Lit.sol"; +import { Matic } from "./Matic.sol"; +import { Mcrt } from "./Mcrt.sol"; +import { Nfp } from "./Nfp.sol"; +import { People } from "./People.sol"; +import { Shib } from "./Shib.sol"; +import { Sol } from "./Sol.sol"; +import { SpaceId } from "./SpaceId.sol"; +import { Ton } from "./Ton.sol"; +import { Trx } from "./Trx.sol"; +import { Tusd } from "./Tusd.sol"; +import { Uni } from "./Uni.sol"; +import { Usdc } from "./Usdc.sol"; +import { Usdt } from "./Usdt.sol"; +import { Wbtc } from "./Wbtc.sol"; +library ERC20TokenLibrary { + function getAdaInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Ada.getTokenName(); + uint256[] memory ranges = Ada.getTokenRanges(); + string memory bscAddress = Ada.getTokenBscAddress(); + string memory ethereumAddress = Ada.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getAmpInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Amp.getTokenName(); + uint256[] memory ranges = Amp.getTokenRanges(); + string memory bscAddress = Amp.getTokenBscAddress(); + string memory ethereumAddress = Amp.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + + function getAtomInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Atom.getTokenName(); + uint256[] memory ranges = Atom.getTokenRanges(); + string memory bscAddress = Atom.getTokenBscAddress(); + string memory ethereumAddress = Atom.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getBchInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Bch.getTokenName(); + uint256[] memory ranges = Bch.getTokenRanges(); + string memory bscAddress = Bch.getTokenBscAddress(); + string memory ethereumAddress = Bch.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getBeanInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Bean.getTokenName(); + uint256[] memory ranges = Bean.getTokenRanges(); + string memory bscAddress = Bean.getTokenBscAddress(); + string memory ethereumAddress = Bean.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getBnbInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Bnb.getTokenName(); + uint256[] memory ranges = Bnb.getTokenRanges(); + string memory bscAddress = Bnb.getTokenBscAddress(); + string memory ethereumAddress = Bnb.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getCompInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Comp.getTokenName(); + uint256[] memory ranges = Comp.getTokenRanges(); + string memory bscAddress = Comp.getTokenBscAddress(); + string memory ethereumAddress = Comp.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getCroInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Cro.getTokenName(); + uint256[] memory ranges = Cro.getTokenRanges(); + string memory bscAddress = Cro.getTokenBscAddress(); + string memory ethereumAddress = Cro.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getCrvInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Crv.getTokenName(); + uint256[] memory ranges = Crv.getTokenRanges(); + string memory bscAddress = Crv.getTokenBscAddress(); + string memory ethereumAddress = Crv.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getDaiInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Dai.getTokenName(); + uint256[] memory ranges = Dai.getTokenRanges(); + string memory bscAddress = Dai.getTokenBscAddress(); + string memory ethereumAddress = Dai.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getDogeInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Doge.getTokenName(); + uint256[] memory ranges = Doge.getTokenRanges(); + string memory bscAddress = Doge.getTokenBscAddress(); + string memory ethereumAddress = Doge.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + + function getDydxInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Dydx.getTokenName(); + uint256[] memory ranges = Dydx.getTokenRanges(); + string memory bscAddress = Dydx.getTokenBscAddress(); + string memory ethereumAddress = Dydx.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getEtcInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Etc.getTokenName(); + uint256[] memory ranges = Etc.getTokenRanges(); + string memory bscAddress = Etc.getTokenBscAddress(); + string memory ethereumAddress = Etc.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getEthInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Eth.getTokenName(); + uint256[] memory ranges = Eth.getTokenRanges(); + string memory bscAddress = Eth.getTokenBscAddress(); + string memory ethereumAddress = Eth.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getFilInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Fil.getTokenName(); + uint256[] memory ranges = Fil.getTokenRanges(); + string memory bscAddress = Fil.getTokenBscAddress(); + string memory ethereumAddress = Fil.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getGrtInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Grt.getTokenName(); + uint256[] memory ranges = Grt.getTokenRanges(); + string memory bscAddress = Grt.getTokenBscAddress(); + string memory ethereumAddress = Grt.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getGtcInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Gtc.getTokenName(); + uint256[] memory ranges = Gtc.getTokenRanges(); + string memory bscAddress = Gtc.getTokenBscAddress(); + string memory ethereumAddress = Gtc.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getGusdInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Gusd.getTokenName(); + uint256[] memory ranges = Gusd.getTokenRanges(); + string memory bscAddress = Gusd.getTokenBscAddress(); + string memory ethereumAddress = Gusd.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getImxInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Imx.getTokenName(); + uint256[] memory ranges = Imx.getTokenRanges(); + string memory bscAddress = Imx.getTokenBscAddress(); + string memory ethereumAddress = Imx.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getInjInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Inj.getTokenName(); + uint256[] memory ranges = Inj.getTokenRanges(); + string memory bscAddress = Inj.getTokenBscAddress(); + string memory ethereumAddress = Inj.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getLeoInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Leo.getTokenName(); + uint256[] memory ranges = Leo.getTokenRanges(); + string memory bscAddress = Leo.getTokenBscAddress(); + string memory ethereumAddress = Leo.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getLinkInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Link.getTokenName(); + uint256[] memory ranges = Link.getTokenRanges(); + string memory bscAddress = Link.getTokenBscAddress(); + string memory ethereumAddress = Link.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getLitInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Lit.getTokenName(); + uint256[] memory ranges = Lit.getTokenRanges(); + string memory bscAddress = Lit.getTokenBscAddress(); + string memory ethereumAddress = Lit.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getMaticInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Matic.getTokenName(); + uint256[] memory ranges = Matic.getTokenRanges(); + string memory bscAddress = Matic.getTokenBscAddress(); + string memory ethereumAddress = Matic.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getMcrtInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Mcrt.getTokenName(); + uint256[] memory ranges = Mcrt.getTokenRanges(); + string memory bscAddress = Mcrt.getTokenBscAddress(); + string memory ethereumAddress = Mcrt.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getNfpInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Nfp.getTokenName(); + uint256[] memory ranges = Nfp.getTokenRanges(); + string memory bscAddress = Nfp.getTokenBscAddress(); + string memory ethereumAddress = Nfp.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getPeopleInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = People.getTokenName(); + uint256[] memory ranges = People.getTokenRanges(); + string memory bscAddress = People.getTokenBscAddress(); + string memory ethereumAddress = People.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getShibInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Shib.getTokenName(); + uint256[] memory ranges = Shib.getTokenRanges(); + string memory bscAddress = Shib.getTokenBscAddress(); + string memory ethereumAddress = Shib.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getSolInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Sol.getTokenName(); + uint256[] memory ranges = Sol.getTokenRanges(); + string memory bscAddress = Sol.getTokenBscAddress(); + string memory ethereumAddress = Sol.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getSpaceIdInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = SpaceId.getTokenName(); + uint256[] memory ranges = SpaceId.getTokenRanges(); + string memory bscAddress = SpaceId.getTokenBscAddress(); + string memory ethereumAddress = SpaceId.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getTonInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Ton.getTokenName(); + uint256[] memory ranges = Ton.getTokenRanges(); + string memory bscAddress = Ton.getTokenBscAddress(); + string memory ethereumAddress = Ton.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getTrxInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Trx.getTokenName(); + uint256[] memory ranges = Trx.getTokenRanges(); + string memory bscAddress = Trx.getTokenBscAddress(); + string memory ethereumAddress = Trx.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getTusdInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Tusd.getTokenName(); + uint256[] memory ranges = Tusd.getTokenRanges(); + string memory bscAddress = Tusd.getTokenBscAddress(); + string memory ethereumAddress = Tusd.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getUniInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Uni.getTokenName(); + uint256[] memory ranges = Uni.getTokenRanges(); + string memory bscAddress = Uni.getTokenBscAddress(); + string memory ethereumAddress = Uni.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getUsdcInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Usdc.getTokenName(); + uint256[] memory ranges = Usdc.getTokenRanges(); + string memory bscAddress = Usdc.getTokenBscAddress(); + string memory ethereumAddress = Usdc.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getUsdtInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Usdt.getTokenName(); + uint256[] memory ranges = Usdt.getTokenRanges(); + string memory bscAddress = Usdt.getTokenBscAddress(); + string memory ethereumAddress = Usdt.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } + function getWbtcInfo() + internal + pure + returns (string memory, uint256[] memory, string memory, string memory) + { + string memory tokenName = Wbtc.getTokenName(); + uint256[] memory ranges = Wbtc.getTokenRanges(); + string memory bscAddress = Wbtc.getTokenBscAddress(); + string memory ethereumAddress = Wbtc.getTokenEthereumAddress(); + return (tokenName, ranges, bscAddress, ethereumAddress); + } +} diff --git a/contracts/token_holding_amount/erc20/Etc.sol b/contracts/token_holding_amount/erc20/Etc.sol index a5cc9e1..77d665d 100644 --- a/contracts/token_holding_amount/erc20/Etc.sol +++ b/contracts/token_holding_amount/erc20/Etc.sol @@ -20,36 +20,28 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Etc is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = ""; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x3d6545b08693dae087e957cb1180ee38b9e3c25e"; - // Add more addresses as needed +library Etc { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x3d6545b08693dae087e957cb1180ee38b9e3c25e"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return ""; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "etc"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 5 * decimals_factor; - ranges[3] = 20 * decimals_factor; - ranges[4] = 50 * decimals_factor; - ranges[5] = 80 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 5 * Constants.decimals_factor; + ranges[3] = 20 * Constants.decimals_factor; + ranges[4] = 50 * Constants.decimals_factor; + ranges[5] = 80 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Eth.sol b/contracts/token_holding_amount/erc20/Eth.sol index 39d4ff2..c79f9fb 100644 --- a/contracts/token_holding_amount/erc20/Eth.sol +++ b/contracts/token_holding_amount/erc20/Eth.sol @@ -21,26 +21,19 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -contract Eth is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[Web3Networks.Ethereum] = "Native Token"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x2170ed0880ac9a755fd29b2688956bd959f933f8"; - // Add more addresses as needed +library Eth { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x2170ed0880ac9a755fd29b2688956bd959f933f8"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "Native Token"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "eth"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); // all ranges multiplied by decimals_factor(1000). diff --git a/contracts/token_holding_amount/erc20/Fil.sol b/contracts/token_holding_amount/erc20/Fil.sol index 96c99db..9db12c8 100644 --- a/contracts/token_holding_amount/erc20/Fil.sol +++ b/contracts/token_holding_amount/erc20/Fil.sol @@ -20,36 +20,28 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Fil is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = ""; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x0d8ce2a99bb6e3b7db580ed848240e4a0f9ae153"; - // Add more addresses as needed +library Fil { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x0d8ce2a99bb6e3b7db580ed848240e4a0f9ae153"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return ""; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "fil"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); - ranges[0] = 0 * decimals_factor; - ranges[1] = 10 * decimals_factor; - ranges[2] = 30 * decimals_factor; - ranges[3] = 80 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 10 * Constants.decimals_factor; + ranges[2] = 30 * Constants.decimals_factor; + ranges[3] = 80 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Grt.sol b/contracts/token_holding_amount/erc20/Grt.sol index 2dc1f05..005e574 100644 --- a/contracts/token_holding_amount/erc20/Grt.sol +++ b/contracts/token_holding_amount/erc20/Grt.sol @@ -19,40 +19,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Grt is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xc944e90c64b2c07662a292be6244bdf05cda44a7"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x52ce071bd9b1c4b00a0b92d298c512478cad67e8"; - // Add more addresses as needed +library Grt { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x52ce071bd9b1c4b00a0b92d298c512478cad67e8"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xc944e90c64b2c07662a292be6244bdf05cda44a7"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "grt"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Gtc.sol b/contracts/token_holding_amount/erc20/Gtc.sol index e3dde8d..24f25de 100644 --- a/contracts/token_holding_amount/erc20/Gtc.sol +++ b/contracts/token_holding_amount/erc20/Gtc.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Gtc is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xde30da39c46104798bb5aa3fe8b9e0e1f348163f"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Gtc { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xde30da39c46104798bb5aa3fe8b9e0e1f348163f"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "gtc"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Gusd.sol b/contracts/token_holding_amount/erc20/Gusd.sol index d2701f6..498d70f 100644 --- a/contracts/token_holding_amount/erc20/Gusd.sol +++ b/contracts/token_holding_amount/erc20/Gusd.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Gusd is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Gusd { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "gusd"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Imx.sol b/contracts/token_holding_amount/erc20/Imx.sol index 6dc12e1..99e20b6 100644 --- a/contracts/token_holding_amount/erc20/Imx.sol +++ b/contracts/token_holding_amount/erc20/Imx.sol @@ -20,38 +20,30 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Imx is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xf57e7e7c23978c3caec3c3548e3d615c346e79ff"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Imx { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xf57e7e7c23978c3caec3c3548e3d615c346e79ff"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "imx"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); - ranges[0] = 0 * decimals_factor; - ranges[1] = 10 * decimals_factor; - ranges[2] = 30 * decimals_factor; - ranges[3] = 80 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 1000 * decimals_factor; - ranges[7] = 2000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 10 * Constants.decimals_factor; + ranges[2] = 30 * Constants.decimals_factor; + ranges[3] = 80 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 1000 * Constants.decimals_factor; + ranges[7] = 2000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Inj.sol b/contracts/token_holding_amount/erc20/Inj.sol index c645961..6484753 100644 --- a/contracts/token_holding_amount/erc20/Inj.sol +++ b/contracts/token_holding_amount/erc20/Inj.sol @@ -20,36 +20,28 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Inj is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Inj { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "inj"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 5 * decimals_factor; - ranges[3] = 20 * decimals_factor; - ranges[4] = 50 * decimals_factor; - ranges[5] = 80 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 5 * Constants.decimals_factor; + ranges[3] = 20 * Constants.decimals_factor; + ranges[4] = 50 * Constants.decimals_factor; + ranges[5] = 80 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Leo.sol b/contracts/token_holding_amount/erc20/Leo.sol index e027aed..b4a7459 100644 --- a/contracts/token_holding_amount/erc20/Leo.sol +++ b/contracts/token_holding_amount/erc20/Leo.sol @@ -20,36 +20,28 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Leo is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x2af5d2ad76741191d15dfe7bf6ac92d4bd912ca3"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Leo { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x2af5d2ad76741191d15dfe7bf6ac92d4bd912ca3"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "leo"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); - ranges[0] = 0 * decimals_factor; - ranges[1] = 10 * decimals_factor; - ranges[2] = 30 * decimals_factor; - ranges[3] = 80 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 10 * Constants.decimals_factor; + ranges[2] = 30 * Constants.decimals_factor; + ranges[3] = 80 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Link.sol b/contracts/token_holding_amount/erc20/Link.sol index 7a02565..8307cb0 100644 --- a/contracts/token_holding_amount/erc20/Link.sol +++ b/contracts/token_holding_amount/erc20/Link.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Link is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x514910771af9ca656af840dff83e8264ecf986ca"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd"; - // Add more addresses as needed +library Link { + function getTokenBscAddress() internal pure returns (string memory) { + return "0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x514910771af9ca656af840dff83e8264ecf986ca"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "link"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Lit.sol b/contracts/token_holding_amount/erc20/Lit.sol index 72a32f0..f0dfd76 100644 --- a/contracts/token_holding_amount/erc20/Lit.sol +++ b/contracts/token_holding_amount/erc20/Lit.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Lit is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xb59490ab09a0f526cc7305822ac65f2ab12f9723"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0xb59490ab09a0f526cc7305822ac65f2ab12f9723"; - // Add more addresses as needed +library Lit { + function getTokenBscAddress() internal pure returns (string memory) { + return "0xb59490ab09a0f526cc7305822ac65f2ab12f9723"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xb59490ab09a0f526cc7305822ac65f2ab12f9723"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "lit"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Matic.sol b/contracts/token_holding_amount/erc20/Matic.sol index 35e5a31..9630928 100644 --- a/contracts/token_holding_amount/erc20/Matic.sol +++ b/contracts/token_holding_amount/erc20/Matic.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Matic is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0xcc42724c6683b7e57334c4e856f4c9965ed682bd"; - // Add more addresses as needed +library Matic { + function getTokenBscAddress() internal pure returns (string memory) { + return "0xcc42724c6683b7e57334c4e856f4c9965ed682bd"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "matic"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Mcrt.sol b/contracts/token_holding_amount/erc20/Mcrt.sol index 3050a42..875df8e 100644 --- a/contracts/token_holding_amount/erc20/Mcrt.sol +++ b/contracts/token_holding_amount/erc20/Mcrt.sol @@ -20,36 +20,27 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Mcrt is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xde16ce60804a881e9f8c4ebb3824646edecd478d"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x4b8285aB433D8f69CB48d5Ad62b415ed1a221e4f"; - // Add more addresses as needed +library Mcrt { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x4b8285aB433D8f69CB48d5Ad62b415ed1a221e4f"; } - - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xde16ce60804a881e9f8c4ebb3824646edecd478d"; + } + function getTokenName() internal pure returns (string memory) { return "mcrt"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); - ranges[0] = 0 * decimals_factor; - ranges[1] = 2000 * decimals_factor; - ranges[2] = 10000 * decimals_factor; - ranges[3] = 50000 * decimals_factor; - ranges[4] = 150000 * decimals_factor; - ranges[5] = 500000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 2000 * Constants.decimals_factor; + ranges[2] = 10000 * Constants.decimals_factor; + ranges[3] = 50000 * Constants.decimals_factor; + ranges[4] = 150000 * Constants.decimals_factor; + ranges[5] = 500000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Nfp.sol b/contracts/token_holding_amount/erc20/Nfp.sol index 64e1de9..9c3089a 100644 --- a/contracts/token_holding_amount/erc20/Nfp.sol +++ b/contracts/token_holding_amount/erc20/Nfp.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Nfp is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = ""; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x75e8ddb518bb757b4282cd5b83bb70d4101d12fb"; - // Add more addresses as needed +library Nfp { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x75e8ddb518bb757b4282cd5b83bb70d4101d12fb"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return ""; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "nfp"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/People.sol b/contracts/token_holding_amount/erc20/People.sol index e8e324e..bf24f9b 100644 --- a/contracts/token_holding_amount/erc20/People.sol +++ b/contracts/token_holding_amount/erc20/People.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract People is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x7a58c0be72be218b41c608b7fe7c5bb630736c71"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library People { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x7a58c0be72be218b41c608b7fe7c5bb630736c71"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "people"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Shib.sol b/contracts/token_holding_amount/erc20/Shib.sol index 4f99b35..0e4eb70 100644 --- a/contracts/token_holding_amount/erc20/Shib.sol +++ b/contracts/token_holding_amount/erc20/Shib.sol @@ -20,38 +20,30 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Shib is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Shib { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "shib"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); - ranges[0] = 0 * decimals_factor; - ranges[1] = 400000 * decimals_factor; - ranges[2] = 2000000 * decimals_factor; - ranges[3] = 10000000 * decimals_factor; - ranges[4] = 20000000 * decimals_factor; - ranges[5] = 40000000 * decimals_factor; - ranges[6] = 100000000 * decimals_factor; - ranges[7] = 200000000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 400000 * Constants.decimals_factor; + ranges[2] = 2000000 * Constants.decimals_factor; + ranges[3] = 10000000 * Constants.decimals_factor; + ranges[4] = 20000000 * Constants.decimals_factor; + ranges[5] = 40000000 * Constants.decimals_factor; + ranges[6] = 100000000 * Constants.decimals_factor; + ranges[7] = 200000000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Sol.sol b/contracts/token_holding_amount/erc20/Sol.sol index e360f97..4fe50f7 100644 --- a/contracts/token_holding_amount/erc20/Sol.sol +++ b/contracts/token_holding_amount/erc20/Sol.sol @@ -20,39 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Sol is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x5288738df1aeb0894713de903e1d0c001eeb7644"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x570a5d26f7765ecb712c0924e4de545b89fd43df"; - // Add more addresses as needed +library Sol { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x570a5d26f7765ecb712c0924e4de545b89fd43df"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x5288738df1aeb0894713de903e1d0c001eeb7644"; + } + + function getTokenName() internal pure returns (string memory) { return "sol"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/SpaceId.sol b/contracts/token_holding_amount/erc20/SpaceId.sol index fe54df7..713f073 100644 --- a/contracts/token_holding_amount/erc20/SpaceId.sol +++ b/contracts/token_holding_amount/erc20/SpaceId.sol @@ -20,39 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract SpaceId is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x2dff88a56767223a5529ea5960da7a3f5f766406"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x2dff88a56767223a5529ea5960da7a3f5f766406"; - // Add more addresses as needed +library SpaceId { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x2dff88a56767223a5529ea5960da7a3f5f766406"; } - function getTokenName() internal pure override returns (string memory) { - return "SpaceId"; + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x2dff88a56767223a5529ea5960da7a3f5f766406"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenName() internal pure returns (string memory) { + return "spaceid"; + } + + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Ton.sol b/contracts/token_holding_amount/erc20/Ton.sol index 3c5fdd7..6da18ef 100644 --- a/contracts/token_holding_amount/erc20/Ton.sol +++ b/contracts/token_holding_amount/erc20/Ton.sol @@ -20,39 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Ton is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x582d872a1b094fc48f5de31d3b73f2d9be47def1"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x76a797a59ba2c17726896976b7b3747bfd1d220f"; - // Add more addresses as needed +library Ton { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x76a797a59ba2c17726896976b7b3747bfd1d220f"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x582d872a1b094fc48f5de31d3b73f2d9be47def1"; + } + + function getTokenName() internal pure returns (string memory) { return "ton"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Trx.sol b/contracts/token_holding_amount/erc20/Trx.sol index 7da1d4d..0321e6e 100644 --- a/contracts/token_holding_amount/erc20/Trx.sol +++ b/contracts/token_holding_amount/erc20/Trx.sol @@ -20,39 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Trx is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x50327c6c5a14dcade707abad2e27eb517df87ab5"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3"; - // Add more addresses as needed +library Trx { + function getTokenBscAddress() internal pure returns (string memory) { + return "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x50327c6c5a14dcade707abad2e27eb517df87ab5"; + } + + function getTokenName() internal pure returns (string memory) { return "trx"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Tusd.sol b/contracts/token_holding_amount/erc20/Tusd.sol index 3521a0f..7b1dd70 100644 --- a/contracts/token_holding_amount/erc20/Tusd.sol +++ b/contracts/token_holding_amount/erc20/Tusd.sol @@ -20,40 +20,31 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Tusd is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x0000000000085d4780b73119b644ae5ecd22b376"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x40af3827F39D0EAcBF4A168f8D4ee67c121D11c9"; - // Add more addresses as needed +library Tusd { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x40af3827F39D0EAcBF4A168f8D4ee67c121D11c9"; } - - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x0000000000085d4780b73119b644ae5ecd22b376"; + } + function getTokenName() internal pure returns (string memory) { return "tusd"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Uni.sol b/contracts/token_holding_amount/erc20/Uni.sol index 4a13b94..a983274 100644 --- a/contracts/token_holding_amount/erc20/Uni.sol +++ b/contracts/token_holding_amount/erc20/Uni.sol @@ -20,39 +20,30 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Uni is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0xbf5140a22578168fd562dccf235e5d43a02ce9b1"; - // Add more addresses as needed +library Uni { + function getTokenBscAddress() internal pure returns (string memory) { + return "0xbf5140a22578168fd562dccf235e5d43a02ce9b1"; } - - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"; + } + function getTokenName() internal pure returns (string memory) { return "uni"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0 * decimals_factor; - ranges[1] = 10 * decimals_factor; - ranges[2] = 30 * decimals_factor; - ranges[3] = 80 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 1000 * decimals_factor; - ranges[7] = 2000 * decimals_factor; - ranges[8] = 5000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 10 * Constants.decimals_factor; + ranges[2] = 30 * Constants.decimals_factor; + ranges[3] = 80 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 1000 * Constants.decimals_factor; + ranges[7] = 2000 * Constants.decimals_factor; + ranges[8] = 5000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Usdc.sol b/contracts/token_holding_amount/erc20/Usdc.sol index c256b4a..43caf95 100644 --- a/contracts/token_holding_amount/erc20/Usdc.sol +++ b/contracts/token_holding_amount/erc20/Usdc.sol @@ -4,39 +4,30 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Usdc is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"; - // Add more addresses as needed +library Usdc { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"; } - - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"; + } + function getTokenName() internal pure returns (string memory) { return "usdc"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); - ranges[0] = 0 * decimals_factor; - ranges[1] = 10 * decimals_factor; - ranges[2] = 30 * decimals_factor; - ranges[3] = 80 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 1000 * decimals_factor; - ranges[7] = 2000 * decimals_factor; - ranges[8] = 5000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 10 * Constants.decimals_factor; + ranges[2] = 30 * Constants.decimals_factor; + ranges[3] = 80 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 1000 * Constants.decimals_factor; + ranges[7] = 2000 * Constants.decimals_factor; + ranges[8] = 5000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Usdd.sol b/contracts/token_holding_amount/erc20/Usdd.sol index 6f8cb8f..d7df074 100644 --- a/contracts/token_holding_amount/erc20/Usdd.sol +++ b/contracts/token_holding_amount/erc20/Usdd.sol @@ -20,40 +20,31 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Usdd is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x0c10bf8fcb7bf5412187a595ab97a3609160b5c6"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0xd17479997f34dd9156deef8f95a52d81d265be9c"; - // Add more addresses as needed +library Usdd { + function getTokenBscAddress() internal pure returns (string memory) { + return "0xd17479997f34dd9156deef8f95a52d81d265be9c"; } - - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x0c10bf8fcb7bf5412187a595ab97a3609160b5c6"; + } + function getTokenName() internal pure returns (string memory) { return "usdd"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Usdt.sol b/contracts/token_holding_amount/erc20/Usdt.sol index 245c4e8..b56d98c 100644 --- a/contracts/token_holding_amount/erc20/Usdt.sol +++ b/contracts/token_holding_amount/erc20/Usdt.sol @@ -20,40 +20,32 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; +import "../../libraries/Constants.sol"; -contract Usdt is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0xdac17f958d2ee523a2206206994597c13d831ec7"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = "0x55d398326f99059ff775485246999027b3197955"; - // Add more addresses as needed +library Usdt { + function getTokenBscAddress() internal pure returns (string memory) { + return "0x55d398326f99059ff775485246999027b3197955"; + } + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0xdac17f958d2ee523a2206206994597c13d831ec7"; } - function getTokenName() internal pure override returns (string memory) { + function getTokenName() internal pure returns (string memory) { return "usdt"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); - ranges[0] = 0 * decimals_factor; - ranges[1] = 1 * decimals_factor; - ranges[2] = 50 * decimals_factor; - ranges[3] = 100 * decimals_factor; - ranges[4] = 200 * decimals_factor; - ranges[5] = 500 * decimals_factor; - ranges[6] = 800 * decimals_factor; - ranges[7] = 1200 * decimals_factor; - ranges[8] = 1600 * decimals_factor; - ranges[9] = 3000 * decimals_factor; + ranges[0] = 0 * Constants.decimals_factor; + ranges[1] = 1 * Constants.decimals_factor; + ranges[2] = 50 * Constants.decimals_factor; + ranges[3] = 100 * Constants.decimals_factor; + ranges[4] = 200 * Constants.decimals_factor; + ranges[5] = 500 * Constants.decimals_factor; + ranges[6] = 800 * Constants.decimals_factor; + ranges[7] = 1200 * Constants.decimals_factor; + ranges[8] = 1600 * Constants.decimals_factor; + ranges[9] = 3000 * Constants.decimals_factor; return ranges; } diff --git a/contracts/token_holding_amount/erc20/Wbtc.sol b/contracts/token_holding_amount/erc20/Wbtc.sol index b3fd609..f9b1d63 100644 --- a/contracts/token_holding_amount/erc20/Wbtc.sol +++ b/contracts/token_holding_amount/erc20/Wbtc.sol @@ -21,31 +21,22 @@ pragma solidity ^0.8.8; import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -contract SpaceId is ERC20 { - constructor() { - // Initialize network token addresses - networkTokenAddresses[ - Web3Networks.Ethereum - ] = "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"; - networkTokenAddresses[ - Web3Networks.Bsc - ] = ""; - // Add more addresses as needed +library Wbtc { + function getTokenBscAddress() internal pure returns (string memory) { + return ""; } - function getTokenName() internal pure override returns (string memory) { + function getTokenEthereumAddress() internal pure returns (string memory) { + return "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"; + } + function getTokenName() internal pure returns (string memory) { return "wbtc"; } - function getTokenRanges() - internal - pure - override - returns (uint256[] memory) - { + function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](14); // all ranges multiplied by decimals_factor(1000). - // pub const BTC_AMOUNT_RANGE: [f64; 14] =[0.0, 0.001, 0.1, 0.3, 0.6, 1.0, 2.0, 5.0, 10.0, 15.0, 25.0, 30.0, 40.0, 50.0]; + // pub const BTC_AMOUNT_RANGE: [f64; 14] =[0.0, 0.001, 0.1, 0.3, 0.6, 1.0, 2.0, 5.0, 10.0, 15.0, 25.0, 30.0, 40.0, 50.0]; ranges[0] = 0; ranges[1] = 1; ranges[2] = 100; From 15b115110967df2a63e2153354f54e13c076e4d2 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Fri, 21 Jun 2024 12:35:04 +0800 Subject: [PATCH 19/23] merge brc erc --- .../token_holding_amount/GeniidataClient.sol | 53 ++ .../token_holding_amount/NoderealClient.sol | 1 + .../TokenHoldingAmount.sol | 56 +-- contracts/token_holding_amount/TokenLogic.sol | 127 +++++ .../token_holding_amount/TokenMapping.sol | 335 +++++++++++++ .../brc20/BRC20TokenLibrary.sol | 99 ---- contracts/token_holding_amount/brc20/Btcs.sol | 3 +- contracts/token_holding_amount/brc20/Cats.sol | 3 +- contracts/token_holding_amount/brc20/Long.sol | 3 +- contracts/token_holding_amount/brc20/Mmss.sol | 3 +- contracts/token_holding_amount/brc20/Ordi.sol | 3 +- contracts/token_holding_amount/brc20/Rats.sol | 3 +- contracts/token_holding_amount/brc20/Sats.sol | 3 +- contracts/token_holding_amount/erc20/Ada.sol | 3 +- contracts/token_holding_amount/erc20/Amp.sol | 3 +- contracts/token_holding_amount/erc20/Atom.sol | 3 +- contracts/token_holding_amount/erc20/Bch.sol | 3 +- contracts/token_holding_amount/erc20/Bean.sol | 3 +- contracts/token_holding_amount/erc20/Bnb.sol | 6 +- contracts/token_holding_amount/erc20/Comp.sol | 6 +- contracts/token_holding_amount/erc20/Cro.sol | 3 +- contracts/token_holding_amount/erc20/Crv.sol | 4 +- contracts/token_holding_amount/erc20/Cvx.sol | 3 +- contracts/token_holding_amount/erc20/Dai.sol | 3 +- contracts/token_holding_amount/erc20/Doge.sol | 3 +- contracts/token_holding_amount/erc20/Dydx.sol | 3 +- .../erc20/ERC20TokenLibrary.sol | 468 ------------------ contracts/token_holding_amount/erc20/Etc.sol | 4 +- contracts/token_holding_amount/erc20/Eth.sol | 1 - contracts/token_holding_amount/erc20/Fil.sol | 3 +- contracts/token_holding_amount/erc20/Grt.sol | 3 +- contracts/token_holding_amount/erc20/Gtc.sol | 3 +- contracts/token_holding_amount/erc20/Gusd.sol | 3 +- contracts/token_holding_amount/erc20/Imx.sol | 3 +- contracts/token_holding_amount/erc20/Inj.sol | 3 +- contracts/token_holding_amount/erc20/Leo.sol | 3 +- contracts/token_holding_amount/erc20/Link.sol | 3 +- contracts/token_holding_amount/erc20/Lit.sol | 3 +- .../token_holding_amount/erc20/Matic.sol | 3 +- contracts/token_holding_amount/erc20/Mcrt.sol | 3 +- contracts/token_holding_amount/erc20/Nfp.sol | 3 +- .../token_holding_amount/erc20/People.sol | 3 +- contracts/token_holding_amount/erc20/Shib.sol | 3 +- contracts/token_holding_amount/erc20/Sol.sol | 3 +- .../token_holding_amount/erc20/SpaceId.sol | 3 +- contracts/token_holding_amount/erc20/Ton.sol | 3 +- contracts/token_holding_amount/erc20/Trx.sol | 3 +- contracts/token_holding_amount/erc20/Tusd.sol | 3 +- contracts/token_holding_amount/erc20/Uni.sol | 3 +- contracts/token_holding_amount/erc20/Usdc.sol | 3 +- contracts/token_holding_amount/erc20/Usdd.sol | 3 +- contracts/token_holding_amount/erc20/Usdt.sol | 3 +- contracts/token_holding_amount/erc20/Wbtc.sol | 1 - 53 files changed, 592 insertions(+), 689 deletions(-) create mode 100644 contracts/token_holding_amount/GeniidataClient.sol create mode 100644 contracts/token_holding_amount/TokenLogic.sol create mode 100644 contracts/token_holding_amount/TokenMapping.sol delete mode 100644 contracts/token_holding_amount/brc20/BRC20TokenLibrary.sol delete mode 100644 contracts/token_holding_amount/erc20/ERC20TokenLibrary.sol diff --git a/contracts/token_holding_amount/GeniidataClient.sol b/contracts/token_holding_amount/GeniidataClient.sol new file mode 100644 index 0000000..110f50c --- /dev/null +++ b/contracts/token_holding_amount/GeniidataClient.sol @@ -0,0 +1,53 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Http.sol"; +import "../libraries/Utils.sol"; +library GeniidataClient { + function getTokenDecimals() internal pure returns (uint8) { + return 18; + } + + function getTokenBalance( + string[] memory secrets, + string memory url + ) internal returns (uint256) { + HttpHeader[] memory headers = new HttpHeader[](1); + headers[0] = HttpHeader("api-key", secrets[0]); + + // https://geniidata.readme.io/reference/get-brc20-tick-list-copy + (bool success, string memory value) = Http.GetString( + url, + "/data/list/0/available_balance", + headers + ); + + if (success) { + (bool parseDecimalSuccess, uint256 result) = Utils.parseDecimal( + value, + getTokenDecimals() + ); + if (parseDecimalSuccess) { + return result; + } + } + return 0; + } +} diff --git a/contracts/token_holding_amount/NoderealClient.sol b/contracts/token_holding_amount/NoderealClient.sol index e0b5fd7..0a982ee 100644 --- a/contracts/token_holding_amount/NoderealClient.sol +++ b/contracts/token_holding_amount/NoderealClient.sol @@ -21,6 +21,7 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; import "../libraries/Utils.sol"; library NoderealClient { + function getTokenBalance( string memory url, string memory tokenContractAddress, diff --git a/contracts/token_holding_amount/TokenHoldingAmount.sol b/contracts/token_holding_amount/TokenHoldingAmount.sol index b3acad8..600e025 100644 --- a/contracts/token_holding_amount/TokenHoldingAmount.sol +++ b/contracts/token_holding_amount/TokenHoldingAmount.sol @@ -23,15 +23,11 @@ import "@openzeppelin/contracts/utils/Strings.sol"; import "../libraries/AssertionLogic.sol"; import "../libraries/Identities.sol"; import "../DynamicAssertion.sol"; -import "../libraries/Constants.sol"; +import "./Constants.sol"; abstract contract TokenHoldingAmount is DynamicAssertion { - mapping(uint32 => string) tokenAddresses; - string tokenName; - uint256[] tokenRanges; - string tokenBscAddress; - string tokenEthereumAddress; - + mapping(string => string) internal tokenNames; + mapping(string => uint256[]) internal tokenRanges; function execute( Identity[] memory identities, string[] memory secrets, @@ -52,25 +48,31 @@ abstract contract TokenHoldingAmount is DynamicAssertion { string memory assertion_type = "Token Holding Amount"; schema_url = "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/25-token-holding-amount/1-1-0.json"; - string memory decodedParams = abi.decode(params, (string)); + string memory tokenLowercaseName = abi.decode(params, (string)); - ( - tokenName, - tokenRanges, - tokenBscAddress, - tokenEthereumAddress - ) = getTokenInfo(decodedParams); - tokenAddresses[Web3Networks.Bsc] = tokenBscAddress; - tokenAddresses[Web3Networks.Ethereum] = tokenEthereumAddress; + if ( + keccak256(abi.encodePacked(tokenNames[tokenLowercaseName])) == + keccak256(abi.encodePacked("")) + ) { + revert("Token not supported or not found"); + } - uint256 balance = queryTotalBalance(identities, secrets); + uint256 balance = queryTotalBalance( + identities, + secrets, + tokenNames[tokenLowercaseName] + ); (uint256 index, uint256 min, int256 max) = calculateRange( balance, - tokenRanges + tokenRanges[tokenLowercaseName] ); - string[] memory assertions = assembleAssertions(min, max); + string[] memory assertions = assembleAssertions( + min, + max, + tokenNames[tokenLowercaseName] + ); bool result = index > 0 || balance > 0; @@ -79,7 +81,8 @@ abstract contract TokenHoldingAmount is DynamicAssertion { function queryTotalBalance( Identity[] memory identities, - string[] memory secrets + string[] memory secrets, + string memory tokenName ) internal virtual returns (uint256) { uint256 total_balance = 0; uint256 identitiesLength = identities.length; @@ -134,8 +137,9 @@ abstract contract TokenHoldingAmount is DynamicAssertion { function assembleAssertions( uint256 min, - int256 max - ) private view returns (string[] memory) { + int256 max, + string memory tokenName + ) private pure returns (string[] memory) { string memory variable = "$holding_amount"; AssertionLogic.CompositeCondition memory cc = AssertionLogic .CompositeCondition( @@ -184,12 +188,4 @@ abstract contract TokenHoldingAmount is DynamicAssertion { string[] memory secrets, string memory tokenName ) internal virtual returns (uint256); - - function getTokenInfo( - string memory decodedParams - ) - internal - pure - virtual - returns (string memory, uint256[] memory, string memory, string memory); } diff --git a/contracts/token_holding_amount/TokenLogic.sol b/contracts/token_holding_amount/TokenLogic.sol new file mode 100644 index 0000000..4c5ce20 --- /dev/null +++ b/contracts/token_holding_amount/TokenLogic.sol @@ -0,0 +1,127 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +import "../libraries/Identities.sol"; +import "../libraries/Utils.sol"; +import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; +import { NoderealClient } from "./NoderealClient.sol"; +import { GeniidataClient } from "./GeniidataClient.sol"; +abstract contract TokenLogic is TokenHoldingAmount { + mapping(uint32 => string) internal networkUrls; + mapping(uint32 => bool) private queriedNetworks; + mapping(uint32 => string) tokenAddresses; + mapping(string => string) internal tokenBscAddress; + mapping(string => string) internal tokenEthereumAddress; + + constructor() { + networkUrls[Web3Networks.Bsc] = "https://bsc-mainnet.nodereal.io/v1/"; // test against mock server => "http://localhost:19527/nodereal_jsonrpc/" + networkUrls[ + Web3Networks.Ethereum + ] = "https://eth-mainnet.nodereal.io/v1/"; // test against mock server => "hhttp://localhost:19527/nodereal_jsonrpc/" + + networkUrls[ + Web3Networks.BitcoinP2tr + ] = "https://api.geniidata.com/api/1/brc20/balance"; // test against mock server => "http://localhost:19529/api/1/brc20/balance" + // Add more networks as needed + } + + function getTokenDecimals() internal pure override returns (uint8) { + return 18; + } + + function queryBalance( + Identity memory identity, + uint32 network, + string[] memory secrets, + string memory tokenName + ) internal override returns (uint256) { + (bool identityToStringSuccess, string memory identityString) = Utils + .identityToString(network, identity.value); + + tokenAddresses[Web3Networks.Bsc] = tokenBscAddress[tokenName]; + tokenAddresses[Web3Networks.Ethereum] = tokenEthereumAddress[tokenName]; + if (identityToStringSuccess) { + string memory url; + uint32[] memory networks = getTokenNetworks(); + uint256 totalBalance = 0; + + for (uint32 i = 0; i < networks.length; i++) { + // Check if this network has been queried + if (!queriedNetworks[networks[i]]) { + string memory _tokenContractAddress = tokenAddresses[ + networks[i] + ]; + url = string( + abi.encodePacked(networkUrls[networks[i]], secrets[0]) + ); + + if (networks[i] == Web3Networks.BitcoinP2tr) { + url = string( + abi.encodePacked( + networkUrls[networks[i]], + "?tick=", + tokenName, + "&address=", + identityString + ) + ); + uint256 balance = GeniidataClient.getTokenBalance( + secrets, + url + ); + totalBalance += balance; + } else if ( + networks[i] == Web3Networks.Bsc || + networks[i] == Web3Networks.Ethereum + ) { + (bool success, uint256 balance) = NoderealClient + .getTokenBalance( + url, + _tokenContractAddress, + identityString + ); + if (success) { + totalBalance += balance; + } + } + // Mark this network as queried + queriedNetworks[networks[i]] = true; + } + } + return totalBalance; + } + return 0; + } + + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](3); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + networks[2] = Web3Networks.BitcoinP2tr; + // Add more networks as needed + return networks; + } + + function isSupportedNetwork( + uint32 network + ) internal pure override returns (bool) { + return network == Web3Networks.Bsc || network == Web3Networks.Ethereum||network == Web3Networks.BitcoinP2tr; + } +} diff --git a/contracts/token_holding_amount/TokenMapping.sol b/contracts/token_holding_amount/TokenMapping.sol new file mode 100644 index 0000000..f5c5659 --- /dev/null +++ b/contracts/token_holding_amount/TokenMapping.sol @@ -0,0 +1,335 @@ +// Copyright 2020-2024 Trust Computing GmbH. +// This file is part of Litentry. +// +// Litentry is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Litentry is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Litentry. If not, see . + +// SPDX-License-Identifier: GPL-3.0-or-later + +pragma solidity ^0.8.8; + +// brc20 +import { TokenLogic } from "./TokenLogic.sol"; +import { Btcs } from "./brc20/Btcs.sol"; +import { Cats } from "./brc20/Cats.sol"; +import { Long } from "./brc20/Long.sol"; +import { Mmss } from "./brc20/Mmss.sol"; +import { Ordi } from "./brc20/Ordi.sol"; +import { Rats } from "./brc20/Rats.sol"; +import { Sats } from "./brc20/Sats.sol"; + +// erc20 +import { Ada } from "./erc20/Ada.sol"; +import { Amp } from "./erc20/Amp.sol"; +import { Atom } from "./erc20/Atom.sol"; +import { Bch } from "./erc20/Bch.sol"; +import { Bean } from "./erc20/Bean.sol"; +import { Bnb } from "./erc20/Bnb.sol"; +import { Comp } from "./erc20/Comp.sol"; +import { Cro } from "./erc20/Cro.sol"; +import { Crv } from "./erc20/Crv.sol"; +import { Dai } from "./erc20/Dai.sol"; +import { Doge } from "./erc20/Doge.sol"; +import { Dydx } from "./erc20/Dydx.sol"; +import { Etc } from "./erc20/Etc.sol"; +import { Eth } from "./erc20/Eth.sol"; +import { Fil } from "./erc20/Fil.sol"; +import { Grt } from "./erc20/Grt.sol"; +import { Gtc } from "./erc20/Gtc.sol"; +import { Gusd } from "./erc20/Gusd.sol"; +import { Imx } from "./erc20/Imx.sol"; +import { Inj } from "./erc20/Inj.sol"; +import { Leo } from "./erc20/Leo.sol"; +import { Link } from "./erc20/Link.sol"; +import { Lit } from "./erc20/Lit.sol"; +import { Matic } from "./erc20/Matic.sol"; +import { Mcrt } from "./erc20//Mcrt.sol"; +import { Nfp } from "./erc20/Nfp.sol"; +import { People } from "./erc20/People.sol"; +import { Shib } from "./erc20//Shib.sol"; +import { Sol } from "./erc20/Sol.sol"; +import { SpaceId } from "./erc20/SpaceId.sol"; +import { Ton } from "./erc20/Ton.sol"; +import { Trx } from "./erc20/Trx.sol"; +import { Tusd } from "./erc20/Tusd.sol"; +import { Uni } from "./erc20/Uni.sol"; +import { Usdc } from "./erc20/Usdc.sol"; +import { Usdt } from "./erc20/Usdt.sol"; +import { Wbtc } from "./erc20//Wbtc.sol"; +import { Cvx } from "./erc20/Cvx.sol"; +import { Usdd } from "./erc20/Usdd.sol"; +contract BRC20Mapping is TokenLogic { + constructor() { + // btcs + tokenNames["btcs"] = Btcs.getTokenName(); + tokenRanges["btcs"] = Btcs.getTokenRanges(); + + // cats + tokenNames["cats"] = Cats.getTokenName(); + tokenRanges["cats"] = Cats.getTokenRanges(); + + // long + tokenNames["long"] = Long.getTokenName(); + tokenRanges["long"] = Long.getTokenRanges(); + + // long + tokenNames["mmss"] = Mmss.getTokenName(); + tokenRanges["mmss"] = Mmss.getTokenRanges(); + + // ordi + tokenNames["ordi"] = Ordi.getTokenName(); + tokenRanges["ordi"] = Ordi.getTokenRanges(); + + // rats + tokenNames["rats"] = Rats.getTokenName(); + tokenRanges["rats"] = Rats.getTokenRanges(); + + // sats + tokenNames["sats"] = Sats.getTokenName(); + tokenRanges["sats"] = Sats.getTokenRanges(); + + // ada + tokenNames["ada"] = Ada.getTokenName(); + tokenRanges["ada"] = Ada.getTokenRanges(); + tokenBscAddress["ada"] = Ada.getTokenBscAddress(); + tokenEthereumAddress["ada"] = Ada.getTokenEthereumAddress(); + + // amp + tokenNames["amp"] = Amp.getTokenName(); + tokenRanges["amp"] = Amp.getTokenRanges(); + tokenBscAddress["amp"] = Amp.getTokenBscAddress(); + tokenEthereumAddress["amp"] = Amp.getTokenEthereumAddress(); + + // atom + tokenNames["atom"] = Atom.getTokenName(); + tokenRanges["atom"] = Atom.getTokenRanges(); + tokenBscAddress["atom"] = Atom.getTokenBscAddress(); + tokenEthereumAddress["atom"] = Atom.getTokenEthereumAddress(); + + // bch + tokenNames["bch"] = Bch.getTokenName(); + tokenRanges["bch"] = Bch.getTokenRanges(); + tokenBscAddress["bch"] = Bch.getTokenBscAddress(); + tokenEthereumAddress["bch"] = Bch.getTokenEthereumAddress(); + + // bean + tokenNames["bean"] = Bean.getTokenName(); + tokenRanges["bean"] = Bean.getTokenRanges(); + tokenBscAddress["bean"] = Bean.getTokenBscAddress(); + tokenEthereumAddress["bean"] = Bean.getTokenEthereumAddress(); + + // bnb + tokenNames["bnb"] = Bnb.getTokenName(); + tokenRanges["bnb"] = Bnb.getTokenRanges(); + tokenBscAddress["bnb"] = Bnb.getTokenBscAddress(); + tokenEthereumAddress["bnb"] = Bnb.getTokenEthereumAddress(); + + // comp + tokenNames["comp"] = Comp.getTokenName(); + tokenRanges["comp"] = Comp.getTokenRanges(); + tokenBscAddress["comp"] = Comp.getTokenBscAddress(); + tokenEthereumAddress["comp"] = Comp.getTokenEthereumAddress(); + + // cro + tokenNames["cro"] = Cro.getTokenName(); + tokenRanges["cro"] = Cro.getTokenRanges(); + tokenBscAddress["cro"] = Cro.getTokenBscAddress(); + tokenEthereumAddress["cro"] = Cro.getTokenEthereumAddress(); + + // crv + tokenNames["crv"] = Crv.getTokenName(); + tokenRanges["crv"] = Crv.getTokenRanges(); + tokenBscAddress["crv"] = Crv.getTokenBscAddress(); + tokenEthereumAddress["crv"] = Crv.getTokenEthereumAddress(); + + // cvx + tokenNames["cvx"] = Cvx.getTokenName(); + tokenRanges["cvx"] = Cvx.getTokenRanges(); + tokenBscAddress["cvx"] = Cvx.getTokenBscAddress(); + tokenEthereumAddress["cvx"] = Cvx.getTokenEthereumAddress(); + + // dai + tokenNames["dai"] = Dai.getTokenName(); + tokenRanges["dai"] = Dai.getTokenRanges(); + tokenBscAddress["dai"] = Dai.getTokenBscAddress(); + tokenEthereumAddress["dai"] = Dai.getTokenEthereumAddress(); + + // doge + tokenNames["doge"] = Doge.getTokenName(); + tokenRanges["doge"] = Doge.getTokenRanges(); + tokenBscAddress["doge"] = Doge.getTokenBscAddress(); + tokenEthereumAddress["doge"] = Doge.getTokenEthereumAddress(); + + // dydx + tokenNames["dydx"] = Dydx.getTokenName(); + tokenRanges["dydx"] = Dydx.getTokenRanges(); + tokenBscAddress["dydx"] = Dydx.getTokenBscAddress(); + tokenEthereumAddress["dydx"] = Dydx.getTokenEthereumAddress(); + + // etc + tokenNames["etc"] = Etc.getTokenName(); + tokenRanges["etc"] = Etc.getTokenRanges(); + tokenBscAddress["etc"] = Etc.getTokenBscAddress(); + tokenEthereumAddress["etc"] = Etc.getTokenEthereumAddress(); + + // eth + tokenNames["eth"] = Eth.getTokenName(); + tokenRanges["eth"] = Eth.getTokenRanges(); + tokenBscAddress["eth"] = Eth.getTokenBscAddress(); + tokenEthereumAddress["eth"] = Eth.getTokenEthereumAddress(); + + // fil + tokenNames["fil"] = Fil.getTokenName(); + tokenRanges["fil"] = Fil.getTokenRanges(); + tokenBscAddress["fil"] = Fil.getTokenBscAddress(); + tokenEthereumAddress["fil"] = Fil.getTokenEthereumAddress(); + + // grt + tokenNames["grt"] = Grt.getTokenName(); + tokenRanges["grt"] = Grt.getTokenRanges(); + tokenBscAddress["grt"] = Grt.getTokenBscAddress(); + tokenEthereumAddress["grt"] = Grt.getTokenEthereumAddress(); + + // gtc + tokenNames["gtc"] = Gtc.getTokenName(); + tokenRanges["gtc"] = Gtc.getTokenRanges(); + tokenBscAddress["gtc"] = Gtc.getTokenBscAddress(); + tokenEthereumAddress["gtc"] = Gtc.getTokenEthereumAddress(); + + // gusd + tokenNames["gusd"] = Gusd.getTokenName(); + tokenRanges["gusd"] = Gusd.getTokenRanges(); + tokenBscAddress["gusd"] = Gusd.getTokenBscAddress(); + tokenEthereumAddress["gusd"] = Gusd.getTokenEthereumAddress(); + + // imx + tokenNames["imx"] = Imx.getTokenName(); + tokenRanges["imx"] = Imx.getTokenRanges(); + tokenBscAddress["imx"] = Imx.getTokenBscAddress(); + tokenEthereumAddress["imx"] = Imx.getTokenEthereumAddress(); + + // inj + tokenNames["inj"] = Inj.getTokenName(); + tokenRanges["inj"] = Inj.getTokenRanges(); + tokenBscAddress["inj"] = Inj.getTokenBscAddress(); + tokenEthereumAddress["inj"] = Inj.getTokenEthereumAddress(); + + // leo + tokenNames["leo"] = Leo.getTokenName(); + tokenRanges["leo"] = Leo.getTokenRanges(); + tokenBscAddress["leo"] = Leo.getTokenBscAddress(); + tokenEthereumAddress["leo"] = Leo.getTokenEthereumAddress(); + + // link + tokenNames["link"] = Link.getTokenName(); + tokenRanges["link"] = Link.getTokenRanges(); + tokenBscAddress["link"] = Link.getTokenBscAddress(); + tokenEthereumAddress["link"] = Link.getTokenEthereumAddress(); + + // lit + tokenNames["lit"] = Lit.getTokenName(); + tokenRanges["lit"] = Lit.getTokenRanges(); + tokenBscAddress["lit"] = Lit.getTokenBscAddress(); + tokenEthereumAddress["lit"] = Lit.getTokenEthereumAddress(); + + // matic + tokenNames["matic"] = Matic.getTokenName(); + tokenRanges["matic"] = Matic.getTokenRanges(); + tokenBscAddress["matic"] = Matic.getTokenBscAddress(); + tokenEthereumAddress["matic"] = Matic.getTokenEthereumAddress(); + + // mcrt + tokenNames["mcrt"] = Mcrt.getTokenName(); + tokenRanges["mcrt"] = Mcrt.getTokenRanges(); + tokenBscAddress["mcrt"] = Mcrt.getTokenBscAddress(); + tokenEthereumAddress["mcrt"] = Mcrt.getTokenEthereumAddress(); + + // nfp + tokenNames["nfp"] = Nfp.getTokenName(); + tokenRanges["nfp"] = Nfp.getTokenRanges(); + tokenBscAddress["nfp"] = Nfp.getTokenBscAddress(); + tokenEthereumAddress["nfp"] = Nfp.getTokenEthereumAddress(); + + // people + tokenNames["people"] = People.getTokenName(); + tokenRanges["people"] = People.getTokenRanges(); + tokenBscAddress["people"] = People.getTokenBscAddress(); + tokenEthereumAddress["people"] = People.getTokenEthereumAddress(); + + // shib + tokenNames["shib"] = Shib.getTokenName(); + tokenRanges["shib"] = Shib.getTokenRanges(); + tokenBscAddress["shib"] = Shib.getTokenBscAddress(); + tokenEthereumAddress["shib"] = Shib.getTokenEthereumAddress(); + + // sol + tokenNames["sol"] = Sol.getTokenName(); + tokenRanges["sol"] = Sol.getTokenRanges(); + tokenBscAddress["sol"] = Sol.getTokenBscAddress(); + tokenEthereumAddress["sol"] = Sol.getTokenEthereumAddress(); + + // spaceid + tokenNames["spaceid"] = SpaceId.getTokenName(); + tokenRanges["spaceid"] = SpaceId.getTokenRanges(); + tokenBscAddress["spaceid"] = SpaceId.getTokenBscAddress(); + tokenEthereumAddress["spaceid"] = SpaceId.getTokenEthereumAddress(); + + // ton + tokenNames["ton"] = Ton.getTokenName(); + tokenRanges["ton"] = Ton.getTokenRanges(); + tokenBscAddress["ton"] = Ton.getTokenBscAddress(); + tokenEthereumAddress["ton"] = Ton.getTokenEthereumAddress(); + + // trx + tokenNames["trx"] = Trx.getTokenName(); + tokenRanges["trx"] = Trx.getTokenRanges(); + tokenBscAddress["trx"] = Trx.getTokenBscAddress(); + tokenEthereumAddress["trx"] = Trx.getTokenEthereumAddress(); + + // tusd + tokenNames["tusd"] = Tusd.getTokenName(); + tokenRanges["tusd"] = Tusd.getTokenRanges(); + tokenBscAddress["tusd"] = Tusd.getTokenBscAddress(); + tokenEthereumAddress["tusd"] = Tusd.getTokenEthereumAddress(); + + // uni + tokenNames["uni"] = Uni.getTokenName(); + tokenRanges["uni"] = Uni.getTokenRanges(); + tokenBscAddress["uni"] = Uni.getTokenBscAddress(); + tokenEthereumAddress["uni"] = Uni.getTokenEthereumAddress(); + + // usdc + tokenNames["usdc"] = Usdc.getTokenName(); + tokenRanges["usdc"] = Usdc.getTokenRanges(); + tokenBscAddress["usdc"] = Usdc.getTokenBscAddress(); + tokenEthereumAddress["usdc"] = Usdc.getTokenEthereumAddress(); + + // usdd + tokenNames["usdd"] = Usdd.getTokenName(); + tokenRanges["usdd"] = Usdd.getTokenRanges(); + tokenBscAddress["usdd"] = Usdd.getTokenBscAddress(); + tokenEthereumAddress["usdd"] = Usdd.getTokenEthereumAddress(); + + // usdt + tokenNames["usdt"] = Usdt.getTokenName(); + tokenRanges["usdt"] = Usdt.getTokenRanges(); + tokenBscAddress["usdt"] = Usdt.getTokenBscAddress(); + tokenEthereumAddress["usdt"] = Usdt.getTokenEthereumAddress(); + + // wbtc + tokenNames["wbtc"] = Wbtc.getTokenName(); + tokenRanges["wbtc"] = Wbtc.getTokenRanges(); + tokenBscAddress["wbtc"] = Wbtc.getTokenBscAddress(); + tokenEthereumAddress["wbtc"] = Wbtc.getTokenEthereumAddress(); + } +} diff --git a/contracts/token_holding_amount/brc20/BRC20TokenLibrary.sol b/contracts/token_holding_amount/brc20/BRC20TokenLibrary.sol deleted file mode 100644 index bfb1d42..0000000 --- a/contracts/token_holding_amount/brc20/BRC20TokenLibrary.sol +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -// SPDX-License-Identifier: GPL-3.0-or-later - -pragma solidity ^0.8.8; - -import { Btcs } from "./Btcs.sol"; -import { Cats } from "./Cats.sol"; -import { Long } from "./Long.sol"; -import { Mmss } from "./Mmss.sol"; -import { Ordi } from "./Ordi.sol"; -import { Rats } from "./Rats.sol"; -import { Sats } from "./Sats.sol"; - -library BRC0TokenLibrary { - function getBtcsInfo() - public - pure - returns (string memory, uint256[] memory) - { - string memory tokenName = Btcs.getTokenName(); - uint256[] memory ranges = Btcs.getTokenRanges(); - - return (tokenName, ranges); - } - function getCatsInfo() - public - pure - returns (string memory, uint256[] memory) - { - string memory tokenName = Cats.getTokenName(); - uint256[] memory ranges = Cats.getTokenRanges(); - - return (tokenName, ranges); - } - - function getLongInfo() - public - pure - returns (string memory, uint256[] memory) - { - string memory tokenName = Long.getTokenName(); - uint256[] memory ranges = Long.getTokenRanges(); - - return (tokenName, ranges); - } - - function getMmssInfo() - public - pure - returns (string memory, uint256[] memory) - { - string memory tokenName = Mmss.getTokenName(); - uint256[] memory ranges = Mmss.getTokenRanges(); - - return (tokenName, ranges); - } - function getOrdiInfo() - public - pure - returns (string memory, uint256[] memory) - { - string memory tokenName = Ordi.getTokenName(); - uint256[] memory ranges = Ordi.getTokenRanges(); - return (tokenName, ranges); - } - function getRatsInfo() - public - pure - returns (string memory, uint256[] memory) - { - string memory tokenName = Rats.getTokenName(); - uint256[] memory ranges = Rats.getTokenRanges(); - return (tokenName, ranges); - } - function getSatsInfo() - public - pure - returns (string memory, uint256[] memory) - { - string memory tokenName = Sats.getTokenName(); - uint256[] memory ranges = Sats.getTokenRanges(); - return (tokenName, ranges); - } -} diff --git a/contracts/token_holding_amount/brc20/Btcs.sol b/contracts/token_holding_amount/brc20/Btcs.sol index e888748..0eb48a0 100644 --- a/contracts/token_holding_amount/brc20/Btcs.sol +++ b/contracts/token_holding_amount/brc20/Btcs.sol @@ -18,8 +18,7 @@ pragma solidity ^0.8.8; -import { BRC20 } from "../BRC20.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Btcs { function getTokenName() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/brc20/Cats.sol b/contracts/token_holding_amount/brc20/Cats.sol index 3448b86..0738b2f 100644 --- a/contracts/token_holding_amount/brc20/Cats.sol +++ b/contracts/token_holding_amount/brc20/Cats.sol @@ -18,8 +18,7 @@ pragma solidity ^0.8.8; -import { BRC20 } from "../BRC20.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Cats { function getTokenName() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/brc20/Long.sol b/contracts/token_holding_amount/brc20/Long.sol index 7a77fc2..5f7fba1 100644 --- a/contracts/token_holding_amount/brc20/Long.sol +++ b/contracts/token_holding_amount/brc20/Long.sol @@ -18,8 +18,7 @@ pragma solidity ^0.8.8; -import { BRC20 } from "../BRC20.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Long { function getTokenName() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/brc20/Mmss.sol b/contracts/token_holding_amount/brc20/Mmss.sol index 47b212c..31bad8a 100644 --- a/contracts/token_holding_amount/brc20/Mmss.sol +++ b/contracts/token_holding_amount/brc20/Mmss.sol @@ -18,8 +18,7 @@ pragma solidity ^0.8.8; -import { BRC20 } from "../BRC20.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Mmss { function getTokenName() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/brc20/Ordi.sol b/contracts/token_holding_amount/brc20/Ordi.sol index c26b27a..e058e67 100644 --- a/contracts/token_holding_amount/brc20/Ordi.sol +++ b/contracts/token_holding_amount/brc20/Ordi.sol @@ -18,8 +18,7 @@ pragma solidity ^0.8.8; -import { BRC20 } from "../BRC20.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Ordi { function getTokenName() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/brc20/Rats.sol b/contracts/token_holding_amount/brc20/Rats.sol index aff13bd..9e24892 100644 --- a/contracts/token_holding_amount/brc20/Rats.sol +++ b/contracts/token_holding_amount/brc20/Rats.sol @@ -18,8 +18,7 @@ pragma solidity ^0.8.8; -import { BRC20 } from "../BRC20.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Rats { function getTokenName() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/brc20/Sats.sol b/contracts/token_holding_amount/brc20/Sats.sol index 0f3519e..2cdb143 100644 --- a/contracts/token_holding_amount/brc20/Sats.sol +++ b/contracts/token_holding_amount/brc20/Sats.sol @@ -18,8 +18,7 @@ pragma solidity ^0.8.8; -import { BRC20 } from "../BRC20.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Sats { function getTokenName() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Ada.sol b/contracts/token_holding_amount/erc20/Ada.sol index 4fdbd83..7119cf3 100644 --- a/contracts/token_holding_amount/erc20/Ada.sol +++ b/contracts/token_holding_amount/erc20/Ada.sol @@ -17,9 +17,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Ada { function getTokenBscAddress() internal pure returns (string memory) { return "0x3EE2200Efb3400fAbB9AacF31297cBdD1d435D47"; diff --git a/contracts/token_holding_amount/erc20/Amp.sol b/contracts/token_holding_amount/erc20/Amp.sol index 4812b2d..cea858e 100644 --- a/contracts/token_holding_amount/erc20/Amp.sol +++ b/contracts/token_holding_amount/erc20/Amp.sol @@ -17,9 +17,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Amp { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Atom.sol b/contracts/token_holding_amount/erc20/Atom.sol index 4595f09..d1fbcb1 100644 --- a/contracts/token_holding_amount/erc20/Atom.sol +++ b/contracts/token_holding_amount/erc20/Atom.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Atom { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Bch.sol b/contracts/token_holding_amount/erc20/Bch.sol index c192cef..ddf2dbe 100644 --- a/contracts/token_holding_amount/erc20/Bch.sol +++ b/contracts/token_holding_amount/erc20/Bch.sol @@ -18,8 +18,7 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; -import "../../libraries/Identities.sol"; +import "../Constants.sol"; library Bch { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Bean.sol b/contracts/token_holding_amount/erc20/Bean.sol index 815e3db..debaa71 100644 --- a/contracts/token_holding_amount/erc20/Bean.sol +++ b/contracts/token_holding_amount/erc20/Bean.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Bean { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Bnb.sol b/contracts/token_holding_amount/erc20/Bnb.sol index 7a05cbd..f01249d 100644 --- a/contracts/token_holding_amount/erc20/Bnb.sol +++ b/contracts/token_holding_amount/erc20/Bnb.sol @@ -18,9 +18,9 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; + import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Bnb { function getTokenBscAddress() internal pure returns (string memory) { @@ -30,7 +30,7 @@ library Bnb { return "0xb8c77482e45f1f44de1745f52c74426c631bdd52"; } function getTokenName() internal pure returns (string memory) { - return "Bnb"; + return "bnb"; } function getTokenRanges() internal pure returns (uint256[] memory) { diff --git a/contracts/token_holding_amount/erc20/Comp.sol b/contracts/token_holding_amount/erc20/Comp.sol index e9094a0..f9df983 100644 --- a/contracts/token_holding_amount/erc20/Comp.sol +++ b/contracts/token_holding_amount/erc20/Comp.sol @@ -18,9 +18,9 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; + import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Comp { function getTokenBscAddress() internal pure returns (string memory) { @@ -31,7 +31,7 @@ library Comp { } function getTokenName() internal pure returns (string memory) { - return "bnb"; + return "comp"; } function getTokenRanges() internal pure returns (uint256[] memory) { diff --git a/contracts/token_holding_amount/erc20/Cro.sol b/contracts/token_holding_amount/erc20/Cro.sol index d5d0b41..fe64e32 100644 --- a/contracts/token_holding_amount/erc20/Cro.sol +++ b/contracts/token_holding_amount/erc20/Cro.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Cro { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Crv.sol b/contracts/token_holding_amount/erc20/Crv.sol index 82c3a8c..093de83 100644 --- a/contracts/token_holding_amount/erc20/Crv.sol +++ b/contracts/token_holding_amount/erc20/Crv.sol @@ -18,9 +18,9 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; + import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Crv { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Cvx.sol b/contracts/token_holding_amount/erc20/Cvx.sol index 2bb734e..d795cf9 100644 --- a/contracts/token_holding_amount/erc20/Cvx.sol +++ b/contracts/token_holding_amount/erc20/Cvx.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Cvx { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Dai.sol b/contracts/token_holding_amount/erc20/Dai.sol index 3e11878..e3f6fbb 100644 --- a/contracts/token_holding_amount/erc20/Dai.sol +++ b/contracts/token_holding_amount/erc20/Dai.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; -import "../../libraries/Constants.sol"; import "../../libraries/Identities.sol"; +import "../Constants.sol"; library Dai { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Doge.sol b/contracts/token_holding_amount/erc20/Doge.sol index fb830a7..f1c7a2e 100644 --- a/contracts/token_holding_amount/erc20/Doge.sol +++ b/contracts/token_holding_amount/erc20/Doge.sol @@ -17,9 +17,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Doge { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Dydx.sol b/contracts/token_holding_amount/erc20/Dydx.sol index 910d5c1..2e5bb03 100644 --- a/contracts/token_holding_amount/erc20/Dydx.sol +++ b/contracts/token_holding_amount/erc20/Dydx.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Dydx { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/ERC20TokenLibrary.sol b/contracts/token_holding_amount/erc20/ERC20TokenLibrary.sol deleted file mode 100644 index 0f904fd..0000000 --- a/contracts/token_holding_amount/erc20/ERC20TokenLibrary.sol +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -// SPDX-License-Identifier: GPL-3.0-or-later - -pragma solidity ^0.8.8; - -import { Ada } from "./Ada.sol"; -import { Amp } from "./Amp.sol"; -import { Atom } from "./Atom.sol"; -import { Bch } from "./Bch.sol"; -import { Bean } from "./Bean.sol"; -import { Bnb } from "./Bnb.sol"; -import { Comp } from "./Comp.sol"; -import { Cro } from "./Cro.sol"; -import { Crv } from "./Crv.sol"; -import { Dai } from "./Dai.sol"; -import { Doge } from "./Doge.sol"; -import { Dydx } from "./Dydx.sol"; -import { Etc } from "./Etc.sol"; -import { Eth } from "./Eth.sol"; -import { Fil } from "./Fil.sol"; -import { Grt } from "./Grt.sol"; -import { Gtc } from "./Gtc.sol"; -import { Gusd } from "./Gusd.sol"; -import { Imx } from "./Imx.sol"; -import { Inj } from "./Inj.sol"; -import { Leo } from "./Leo.sol"; -import { Link } from "./Link.sol"; -import { Lit } from "./Lit.sol"; -import { Matic } from "./Matic.sol"; -import { Mcrt } from "./Mcrt.sol"; -import { Nfp } from "./Nfp.sol"; -import { People } from "./People.sol"; -import { Shib } from "./Shib.sol"; -import { Sol } from "./Sol.sol"; -import { SpaceId } from "./SpaceId.sol"; -import { Ton } from "./Ton.sol"; -import { Trx } from "./Trx.sol"; -import { Tusd } from "./Tusd.sol"; -import { Uni } from "./Uni.sol"; -import { Usdc } from "./Usdc.sol"; -import { Usdt } from "./Usdt.sol"; -import { Wbtc } from "./Wbtc.sol"; -library ERC20TokenLibrary { - function getAdaInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Ada.getTokenName(); - uint256[] memory ranges = Ada.getTokenRanges(); - string memory bscAddress = Ada.getTokenBscAddress(); - string memory ethereumAddress = Ada.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getAmpInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Amp.getTokenName(); - uint256[] memory ranges = Amp.getTokenRanges(); - string memory bscAddress = Amp.getTokenBscAddress(); - string memory ethereumAddress = Amp.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - - function getAtomInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Atom.getTokenName(); - uint256[] memory ranges = Atom.getTokenRanges(); - string memory bscAddress = Atom.getTokenBscAddress(); - string memory ethereumAddress = Atom.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getBchInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Bch.getTokenName(); - uint256[] memory ranges = Bch.getTokenRanges(); - string memory bscAddress = Bch.getTokenBscAddress(); - string memory ethereumAddress = Bch.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getBeanInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Bean.getTokenName(); - uint256[] memory ranges = Bean.getTokenRanges(); - string memory bscAddress = Bean.getTokenBscAddress(); - string memory ethereumAddress = Bean.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getBnbInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Bnb.getTokenName(); - uint256[] memory ranges = Bnb.getTokenRanges(); - string memory bscAddress = Bnb.getTokenBscAddress(); - string memory ethereumAddress = Bnb.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getCompInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Comp.getTokenName(); - uint256[] memory ranges = Comp.getTokenRanges(); - string memory bscAddress = Comp.getTokenBscAddress(); - string memory ethereumAddress = Comp.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getCroInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Cro.getTokenName(); - uint256[] memory ranges = Cro.getTokenRanges(); - string memory bscAddress = Cro.getTokenBscAddress(); - string memory ethereumAddress = Cro.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getCrvInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Crv.getTokenName(); - uint256[] memory ranges = Crv.getTokenRanges(); - string memory bscAddress = Crv.getTokenBscAddress(); - string memory ethereumAddress = Crv.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getDaiInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Dai.getTokenName(); - uint256[] memory ranges = Dai.getTokenRanges(); - string memory bscAddress = Dai.getTokenBscAddress(); - string memory ethereumAddress = Dai.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getDogeInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Doge.getTokenName(); - uint256[] memory ranges = Doge.getTokenRanges(); - string memory bscAddress = Doge.getTokenBscAddress(); - string memory ethereumAddress = Doge.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - - function getDydxInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Dydx.getTokenName(); - uint256[] memory ranges = Dydx.getTokenRanges(); - string memory bscAddress = Dydx.getTokenBscAddress(); - string memory ethereumAddress = Dydx.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getEtcInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Etc.getTokenName(); - uint256[] memory ranges = Etc.getTokenRanges(); - string memory bscAddress = Etc.getTokenBscAddress(); - string memory ethereumAddress = Etc.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getEthInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Eth.getTokenName(); - uint256[] memory ranges = Eth.getTokenRanges(); - string memory bscAddress = Eth.getTokenBscAddress(); - string memory ethereumAddress = Eth.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getFilInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Fil.getTokenName(); - uint256[] memory ranges = Fil.getTokenRanges(); - string memory bscAddress = Fil.getTokenBscAddress(); - string memory ethereumAddress = Fil.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getGrtInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Grt.getTokenName(); - uint256[] memory ranges = Grt.getTokenRanges(); - string memory bscAddress = Grt.getTokenBscAddress(); - string memory ethereumAddress = Grt.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getGtcInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Gtc.getTokenName(); - uint256[] memory ranges = Gtc.getTokenRanges(); - string memory bscAddress = Gtc.getTokenBscAddress(); - string memory ethereumAddress = Gtc.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getGusdInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Gusd.getTokenName(); - uint256[] memory ranges = Gusd.getTokenRanges(); - string memory bscAddress = Gusd.getTokenBscAddress(); - string memory ethereumAddress = Gusd.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getImxInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Imx.getTokenName(); - uint256[] memory ranges = Imx.getTokenRanges(); - string memory bscAddress = Imx.getTokenBscAddress(); - string memory ethereumAddress = Imx.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getInjInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Inj.getTokenName(); - uint256[] memory ranges = Inj.getTokenRanges(); - string memory bscAddress = Inj.getTokenBscAddress(); - string memory ethereumAddress = Inj.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getLeoInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Leo.getTokenName(); - uint256[] memory ranges = Leo.getTokenRanges(); - string memory bscAddress = Leo.getTokenBscAddress(); - string memory ethereumAddress = Leo.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getLinkInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Link.getTokenName(); - uint256[] memory ranges = Link.getTokenRanges(); - string memory bscAddress = Link.getTokenBscAddress(); - string memory ethereumAddress = Link.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getLitInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Lit.getTokenName(); - uint256[] memory ranges = Lit.getTokenRanges(); - string memory bscAddress = Lit.getTokenBscAddress(); - string memory ethereumAddress = Lit.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getMaticInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Matic.getTokenName(); - uint256[] memory ranges = Matic.getTokenRanges(); - string memory bscAddress = Matic.getTokenBscAddress(); - string memory ethereumAddress = Matic.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getMcrtInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Mcrt.getTokenName(); - uint256[] memory ranges = Mcrt.getTokenRanges(); - string memory bscAddress = Mcrt.getTokenBscAddress(); - string memory ethereumAddress = Mcrt.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getNfpInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Nfp.getTokenName(); - uint256[] memory ranges = Nfp.getTokenRanges(); - string memory bscAddress = Nfp.getTokenBscAddress(); - string memory ethereumAddress = Nfp.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getPeopleInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = People.getTokenName(); - uint256[] memory ranges = People.getTokenRanges(); - string memory bscAddress = People.getTokenBscAddress(); - string memory ethereumAddress = People.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getShibInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Shib.getTokenName(); - uint256[] memory ranges = Shib.getTokenRanges(); - string memory bscAddress = Shib.getTokenBscAddress(); - string memory ethereumAddress = Shib.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getSolInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Sol.getTokenName(); - uint256[] memory ranges = Sol.getTokenRanges(); - string memory bscAddress = Sol.getTokenBscAddress(); - string memory ethereumAddress = Sol.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getSpaceIdInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = SpaceId.getTokenName(); - uint256[] memory ranges = SpaceId.getTokenRanges(); - string memory bscAddress = SpaceId.getTokenBscAddress(); - string memory ethereumAddress = SpaceId.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getTonInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Ton.getTokenName(); - uint256[] memory ranges = Ton.getTokenRanges(); - string memory bscAddress = Ton.getTokenBscAddress(); - string memory ethereumAddress = Ton.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getTrxInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Trx.getTokenName(); - uint256[] memory ranges = Trx.getTokenRanges(); - string memory bscAddress = Trx.getTokenBscAddress(); - string memory ethereumAddress = Trx.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getTusdInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Tusd.getTokenName(); - uint256[] memory ranges = Tusd.getTokenRanges(); - string memory bscAddress = Tusd.getTokenBscAddress(); - string memory ethereumAddress = Tusd.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getUniInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Uni.getTokenName(); - uint256[] memory ranges = Uni.getTokenRanges(); - string memory bscAddress = Uni.getTokenBscAddress(); - string memory ethereumAddress = Uni.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getUsdcInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Usdc.getTokenName(); - uint256[] memory ranges = Usdc.getTokenRanges(); - string memory bscAddress = Usdc.getTokenBscAddress(); - string memory ethereumAddress = Usdc.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getUsdtInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Usdt.getTokenName(); - uint256[] memory ranges = Usdt.getTokenRanges(); - string memory bscAddress = Usdt.getTokenBscAddress(); - string memory ethereumAddress = Usdt.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } - function getWbtcInfo() - internal - pure - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName = Wbtc.getTokenName(); - uint256[] memory ranges = Wbtc.getTokenRanges(); - string memory bscAddress = Wbtc.getTokenBscAddress(); - string memory ethereumAddress = Wbtc.getTokenEthereumAddress(); - return (tokenName, ranges, bscAddress, ethereumAddress); - } -} diff --git a/contracts/token_holding_amount/erc20/Etc.sol b/contracts/token_holding_amount/erc20/Etc.sol index 77d665d..88d5ace 100644 --- a/contracts/token_holding_amount/erc20/Etc.sol +++ b/contracts/token_holding_amount/erc20/Etc.sol @@ -18,9 +18,9 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; + import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Etc { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Eth.sol b/contracts/token_holding_amount/erc20/Eth.sol index c79f9fb..076f6b1 100644 --- a/contracts/token_holding_amount/erc20/Eth.sol +++ b/contracts/token_holding_amount/erc20/Eth.sol @@ -18,7 +18,6 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; library Eth { diff --git a/contracts/token_holding_amount/erc20/Fil.sol b/contracts/token_holding_amount/erc20/Fil.sol index 9db12c8..510d427 100644 --- a/contracts/token_holding_amount/erc20/Fil.sol +++ b/contracts/token_holding_amount/erc20/Fil.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Fil { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Grt.sol b/contracts/token_holding_amount/erc20/Grt.sol index 005e574..c124834 100644 --- a/contracts/token_holding_amount/erc20/Grt.sol +++ b/contracts/token_holding_amount/erc20/Grt.sol @@ -17,9 +17,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Grt { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Gtc.sol b/contracts/token_holding_amount/erc20/Gtc.sol index 24f25de..814bad6 100644 --- a/contracts/token_holding_amount/erc20/Gtc.sol +++ b/contracts/token_holding_amount/erc20/Gtc.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Gtc { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Gusd.sol b/contracts/token_holding_amount/erc20/Gusd.sol index 498d70f..103053d 100644 --- a/contracts/token_holding_amount/erc20/Gusd.sol +++ b/contracts/token_holding_amount/erc20/Gusd.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Gusd { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Imx.sol b/contracts/token_holding_amount/erc20/Imx.sol index 99e20b6..0123d61 100644 --- a/contracts/token_holding_amount/erc20/Imx.sol +++ b/contracts/token_holding_amount/erc20/Imx.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Imx { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Inj.sol b/contracts/token_holding_amount/erc20/Inj.sol index 6484753..fa2498e 100644 --- a/contracts/token_holding_amount/erc20/Inj.sol +++ b/contracts/token_holding_amount/erc20/Inj.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Inj { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Leo.sol b/contracts/token_holding_amount/erc20/Leo.sol index b4a7459..8f2381d 100644 --- a/contracts/token_holding_amount/erc20/Leo.sol +++ b/contracts/token_holding_amount/erc20/Leo.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Leo { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Link.sol b/contracts/token_holding_amount/erc20/Link.sol index 8307cb0..576f07d 100644 --- a/contracts/token_holding_amount/erc20/Link.sol +++ b/contracts/token_holding_amount/erc20/Link.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Link { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Lit.sol b/contracts/token_holding_amount/erc20/Lit.sol index f0dfd76..453baa3 100644 --- a/contracts/token_holding_amount/erc20/Lit.sol +++ b/contracts/token_holding_amount/erc20/Lit.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Lit { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Matic.sol b/contracts/token_holding_amount/erc20/Matic.sol index 9630928..8a8c07e 100644 --- a/contracts/token_holding_amount/erc20/Matic.sol +++ b/contracts/token_holding_amount/erc20/Matic.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Matic { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Mcrt.sol b/contracts/token_holding_amount/erc20/Mcrt.sol index 875df8e..07998d1 100644 --- a/contracts/token_holding_amount/erc20/Mcrt.sol +++ b/contracts/token_holding_amount/erc20/Mcrt.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Mcrt { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Nfp.sol b/contracts/token_holding_amount/erc20/Nfp.sol index 9c3089a..d74e332 100644 --- a/contracts/token_holding_amount/erc20/Nfp.sol +++ b/contracts/token_holding_amount/erc20/Nfp.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Nfp { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/People.sol b/contracts/token_holding_amount/erc20/People.sol index bf24f9b..690db03 100644 --- a/contracts/token_holding_amount/erc20/People.sol +++ b/contracts/token_holding_amount/erc20/People.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library People { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Shib.sol b/contracts/token_holding_amount/erc20/Shib.sol index 0e4eb70..96d5298 100644 --- a/contracts/token_holding_amount/erc20/Shib.sol +++ b/contracts/token_holding_amount/erc20/Shib.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Shib { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Sol.sol b/contracts/token_holding_amount/erc20/Sol.sol index 4fe50f7..9b48bee 100644 --- a/contracts/token_holding_amount/erc20/Sol.sol +++ b/contracts/token_holding_amount/erc20/Sol.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Sol { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/SpaceId.sol b/contracts/token_holding_amount/erc20/SpaceId.sol index 713f073..d651183 100644 --- a/contracts/token_holding_amount/erc20/SpaceId.sol +++ b/contracts/token_holding_amount/erc20/SpaceId.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library SpaceId { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Ton.sol b/contracts/token_holding_amount/erc20/Ton.sol index 6da18ef..31afe29 100644 --- a/contracts/token_holding_amount/erc20/Ton.sol +++ b/contracts/token_holding_amount/erc20/Ton.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Ton { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Trx.sol b/contracts/token_holding_amount/erc20/Trx.sol index 0321e6e..6a2ec49 100644 --- a/contracts/token_holding_amount/erc20/Trx.sol +++ b/contracts/token_holding_amount/erc20/Trx.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Trx { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Tusd.sol b/contracts/token_holding_amount/erc20/Tusd.sol index 7b1dd70..f3237b3 100644 --- a/contracts/token_holding_amount/erc20/Tusd.sol +++ b/contracts/token_holding_amount/erc20/Tusd.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Tusd { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Uni.sol b/contracts/token_holding_amount/erc20/Uni.sol index a983274..a86f999 100644 --- a/contracts/token_holding_amount/erc20/Uni.sol +++ b/contracts/token_holding_amount/erc20/Uni.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Uni { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Usdc.sol b/contracts/token_holding_amount/erc20/Usdc.sol index 43caf95..88e75f6 100644 --- a/contracts/token_holding_amount/erc20/Usdc.sol +++ b/contracts/token_holding_amount/erc20/Usdc.sol @@ -2,9 +2,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Usdc { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Usdd.sol b/contracts/token_holding_amount/erc20/Usdd.sol index d7df074..37993e0 100644 --- a/contracts/token_holding_amount/erc20/Usdd.sol +++ b/contracts/token_holding_amount/erc20/Usdd.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Usdd { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Usdt.sol b/contracts/token_holding_amount/erc20/Usdt.sol index b56d98c..ab928cd 100644 --- a/contracts/token_holding_amount/erc20/Usdt.sol +++ b/contracts/token_holding_amount/erc20/Usdt.sol @@ -18,9 +18,8 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; -import "../../libraries/Constants.sol"; +import "../Constants.sol"; library Usdt { function getTokenBscAddress() internal pure returns (string memory) { diff --git a/contracts/token_holding_amount/erc20/Wbtc.sol b/contracts/token_holding_amount/erc20/Wbtc.sol index f9b1d63..5d83985 100644 --- a/contracts/token_holding_amount/erc20/Wbtc.sol +++ b/contracts/token_holding_amount/erc20/Wbtc.sol @@ -18,7 +18,6 @@ pragma solidity ^0.8.8; -import { ERC20 } from "../ERC20.sol"; import "../../libraries/Identities.sol"; library Wbtc { From 024571952ecdaf2baa18cadbcce5170e623c2709 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Fri, 21 Jun 2024 12:35:34 +0800 Subject: [PATCH 20/23] remove unuse --- contracts/token_holding_amount/BRC20.sol | 114 ------ .../Constants.sol | 0 contracts/token_holding_amount/ERC20.sol | 382 ------------------ 3 files changed, 496 deletions(-) delete mode 100644 contracts/token_holding_amount/BRC20.sol rename contracts/{libraries => token_holding_amount}/Constants.sol (100%) delete mode 100644 contracts/token_holding_amount/ERC20.sol diff --git a/contracts/token_holding_amount/BRC20.sol b/contracts/token_holding_amount/BRC20.sol deleted file mode 100644 index 92494dc..0000000 --- a/contracts/token_holding_amount/BRC20.sol +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -// SPDX-License-Identifier: GPL-3.0-or-later - -pragma solidity ^0.8.8; - -import "../libraries/Identities.sol"; -import "../libraries/Http.sol"; -import "../libraries/Utils.sol"; -import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; -import "./brc20/BRC20TokenLibrary.sol"; -contract BRC20 is TokenHoldingAmount { - function getTokenDecimals() internal pure override returns (uint8) { - return 18; - } - - function queryBalance( - Identity memory identity, - uint32 network, - string[] memory secrets, - string memory tokenName - ) internal virtual override returns (uint256) { - (bool identityToStringSuccess, string memory identityString) = Utils - .identityToString(network, identity.value); - if (identityToStringSuccess) { - // https://geniidata.readme.io/reference/get-brc20-tick-list-copy - string memory url = string( - abi.encodePacked( - // "https://api.geniidata.com/api/1/brc20/balance", - // below url is used for test against mock server - "http://localhost:19529/api/1/brc20/balance", - "?tick=", - tokenName, - "&address=", - identityString - ) - ); - - HttpHeader[] memory headers = new HttpHeader[](1); - headers[0] = HttpHeader("api-key", secrets[0]); - - (bool success, string memory value) = Http.GetString( - url, - "/data/list/0/available_balance", - headers - ); - - if (success) { - (bool parseDecimalSuccess, uint256 result) = Utils.parseDecimal( - value, - getTokenDecimals() - ); - if (parseDecimalSuccess) { - return result; - } - } - } - return 0; - } - - function isSupportedNetwork( - uint32 network - ) internal pure override returns (bool) { - return network == Web3Networks.BitcoinP2tr; - } - - function getTokenInfo( - string memory decodedParams - ) - internal - pure - override - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName; - uint256[] memory ranges; - string memory tokenBscAddress = ""; - string memory tokenEthereumAddress = ""; - - if (Utils.isStringsEqual(decodedParams, "btcs")) { - (tokenName, ranges) = BRC0TokenLibrary.getBtcsInfo(); - } else if (Utils.isStringsEqual(decodedParams, "cats")) { - (tokenName, ranges) = BRC0TokenLibrary.getCatsInfo(); - } else if (Utils.isStringsEqual(decodedParams, "long")) { - (tokenName, ranges) = BRC0TokenLibrary.getLongInfo(); - } else if (Utils.isStringsEqual(decodedParams, "mmss")) { - (tokenName, ranges) = BRC0TokenLibrary.getMmssInfo(); - } else if (Utils.isStringsEqual(decodedParams, "ordi")) { - (tokenName, ranges) = BRC0TokenLibrary.getOrdiInfo(); - } else if (Utils.isStringsEqual(decodedParams, "rats")) { - (tokenName, ranges) = BRC0TokenLibrary.getRatsInfo(); - } else if (Utils.isStringsEqual(decodedParams, "sats")) { - (tokenName, ranges) = BRC0TokenLibrary.getSatsInfo(); - } else { - revert("Unsupported token"); - } - - return (tokenName, ranges, tokenBscAddress, tokenEthereumAddress); - } -} diff --git a/contracts/libraries/Constants.sol b/contracts/token_holding_amount/Constants.sol similarity index 100% rename from contracts/libraries/Constants.sol rename to contracts/token_holding_amount/Constants.sol diff --git a/contracts/token_holding_amount/ERC20.sol b/contracts/token_holding_amount/ERC20.sol deleted file mode 100644 index 561a436..0000000 --- a/contracts/token_holding_amount/ERC20.sol +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . - -// SPDX-License-Identifier: GPL-3.0-or-later - -pragma solidity ^0.8.8; - -import "../libraries/Identities.sol"; -import "../libraries/Utils.sol"; -import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; -import { NoderealClient } from "./NoderealClient.sol"; -import { ERC20TokenLibrary } from "./erc20/ERC20TokenLibrary.sol"; -contract ERC20 is TokenHoldingAmount { - mapping(uint32 => string) internal networkUrls; - mapping(uint32 => bool) private queriedNetworks; - - constructor() { - networkUrls[Web3Networks.Bsc] = "https://bsc-mainnet.nodereal.io/v1/"; - networkUrls[ - Web3Networks.Ethereum - ] = "https://eth-mainnet.nodereal.io/v1/"; - // Add more networks as needed - // below url is used for test against mock server - // "http://localhost:19530/nodereal_jsonrpc/v1/", - - // Initialize network token addresses using Ada library - } - - function getTokenDecimals() internal pure override returns (uint8) { - return 18; - } - - function queryBalance( - Identity memory identity, - uint32 network, - string[] memory secrets, - string memory /*tokenName*/ - ) internal override returns (uint256) { - (bool identityToStringSuccess, string memory identityString) = Utils - .identityToString(network, identity.value); - - if (identityToStringSuccess) { - string memory url; - uint32[] memory networks = getTokenNetworks(); - uint256 totalBalance = 0; - - for (uint32 i = 0; i < networks.length; i++) { - // Check if this network has been queried - if (!queriedNetworks[networks[i]]) { - string memory _tokenContractAddress = tokenAddresses[ - networks[i] - ]; - - url = string( - abi.encodePacked(networkUrls[networks[i]], secrets[0]) - ); - - (bool success, uint256 balance) = NoderealClient - .getTokenBalance( - url, - _tokenContractAddress, - identityString - ); - - if (success) { - totalBalance += balance; - } - // Mark this network as queried - queriedNetworks[networks[i]] = true; - } - } - return totalBalance; - } - return 0; - } - - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - // Add more networks as needed - return networks; - } - - function isSupportedNetwork( - uint32 network - ) internal pure override returns (bool) { - return network == Web3Networks.Bsc || network == Web3Networks.Ethereum; - } - - function getTokenInfo( - string memory decodedParams - ) - internal - pure - override - returns (string memory, uint256[] memory, string memory, string memory) - { - string memory tokenName; - uint256[] memory ranges; - string memory tokenBscAddress; - string memory tokenEthereumAddress; - - if (Utils.isStringsEqual(decodedParams, "ada")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getAdaInfo(); - } else if (Utils.isStringsEqual(decodedParams, "amp")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getAmpInfo(); - } else if (Utils.isStringsEqual(decodedParams, "atom")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getAtomInfo(); - } else if (Utils.isStringsEqual(decodedParams, "bch")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getBchInfo(); - } else if (Utils.isStringsEqual(decodedParams, "bean")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getBeanInfo(); - } else if (Utils.isStringsEqual(decodedParams, "bnb")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getBnbInfo(); - } else if (Utils.isStringsEqual(decodedParams, "comp")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getCompInfo(); - } else if (Utils.isStringsEqual(decodedParams, "cro")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getCroInfo(); - } else if (Utils.isStringsEqual(decodedParams, "crv")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getCrvInfo(); - } else if (Utils.isStringsEqual(decodedParams, "dai")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getDaiInfo(); - } else if (Utils.isStringsEqual(decodedParams, "doge")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getDogeInfo(); - } else if (Utils.isStringsEqual(decodedParams, "dydx")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getDydxInfo(); - } else if (Utils.isStringsEqual(decodedParams, "etc")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getEtcInfo(); - } else if (Utils.isStringsEqual(decodedParams, "eth")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getEthInfo(); - } else if (Utils.isStringsEqual(decodedParams, "fil")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getFilInfo(); - } else if (Utils.isStringsEqual(decodedParams, "grt")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getGrtInfo(); - } else if (Utils.isStringsEqual(decodedParams, "gtc")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getGtcInfo(); - } else if (Utils.isStringsEqual(decodedParams, "gusd")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getGusdInfo(); - } else if (Utils.isStringsEqual(decodedParams, "imx")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getImxInfo(); - } else if (Utils.isStringsEqual(decodedParams, "inj")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getInjInfo(); - } else if (Utils.isStringsEqual(decodedParams, "leo")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getLeoInfo(); - } else if (Utils.isStringsEqual(decodedParams, "link")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getLinkInfo(); - } else if (Utils.isStringsEqual(decodedParams, "lit")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getLitInfo(); - } else if (Utils.isStringsEqual(decodedParams, "matic")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getMaticInfo(); - } else if (Utils.isStringsEqual(decodedParams, "mcrt")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getMcrtInfo(); - } else if (Utils.isStringsEqual(decodedParams, "nfp")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getNfpInfo(); - } else if (Utils.isStringsEqual(decodedParams, "people")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getPeopleInfo(); - } else if (Utils.isStringsEqual(decodedParams, "shib")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getShibInfo(); - } else if (Utils.isStringsEqual(decodedParams, "sol")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getSolInfo(); - } else if (Utils.isStringsEqual(decodedParams, "spaceid")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getSpaceIdInfo(); - } else if (Utils.isStringsEqual(decodedParams, "ton")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getTonInfo(); - } else if (Utils.isStringsEqual(decodedParams, "trx")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getTrxInfo(); - } else if (Utils.isStringsEqual(decodedParams, "tusd")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getTusdInfo(); - } else if (Utils.isStringsEqual(decodedParams, "uni")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getUniInfo(); - } else if (Utils.isStringsEqual(decodedParams, "usdc")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getUsdcInfo(); - } else if (Utils.isStringsEqual(decodedParams, "usdt")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getUsdtInfo(); - } else if (Utils.isStringsEqual(decodedParams, "wbtc")) { - ( - tokenName, - ranges, - tokenBscAddress, - tokenEthereumAddress - ) = ERC20TokenLibrary.getWbtcInfo(); - } else { - revert("Unsupported token"); - } - - return (tokenName, ranges, tokenBscAddress, tokenEthereumAddress); - } -} From cb6ca2178a7fe2e792d602c72c32f0d8d744b757 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Fri, 21 Jun 2024 13:40:49 +0800 Subject: [PATCH 21/23] merge one more --- .../token_holding_amount/GeniidataClient.sol | 24 +- .../token_holding_amount/NoderealClient.sol | 8 +- contracts/token_holding_amount/TokenLogic.sol | 46 ++-- .../token_holding_amount/TokenMapping.sol | 251 ++++++++++++------ contracts/token_holding_amount/brc20/Btcs.sol | 6 + contracts/token_holding_amount/brc20/Cats.sol | 6 + contracts/token_holding_amount/brc20/Long.sol | 6 + contracts/token_holding_amount/brc20/Mmss.sol | 6 + contracts/token_holding_amount/brc20/Ordi.sol | 6 + contracts/token_holding_amount/brc20/Rats.sol | 6 + contracts/token_holding_amount/brc20/Sats.sol | 6 + contracts/token_holding_amount/erc20/Ada.sol | 6 + contracts/token_holding_amount/erc20/Amp.sol | 7 + contracts/token_holding_amount/erc20/Atom.sol | 7 + contracts/token_holding_amount/erc20/Bch.sol | 8 + contracts/token_holding_amount/erc20/Bean.sol | 7 + contracts/token_holding_amount/erc20/Bnb.sol | 8 +- contracts/token_holding_amount/erc20/Comp.sol | 8 +- contracts/token_holding_amount/erc20/Cro.sol | 7 + contracts/token_holding_amount/erc20/Crv.sol | 8 +- contracts/token_holding_amount/erc20/Cvx.sol | 7 + contracts/token_holding_amount/erc20/Dai.sol | 7 + contracts/token_holding_amount/erc20/Doge.sol | 7 + contracts/token_holding_amount/erc20/Dydx.sol | 7 + contracts/token_holding_amount/erc20/Etc.sol | 8 +- contracts/token_holding_amount/erc20/Eth.sol | 7 + contracts/token_holding_amount/erc20/Fil.sol | 7 + contracts/token_holding_amount/erc20/Grt.sol | 7 + contracts/token_holding_amount/erc20/Gtc.sol | 7 + contracts/token_holding_amount/erc20/Gusd.sol | 7 + contracts/token_holding_amount/erc20/Imx.sol | 7 + contracts/token_holding_amount/erc20/Inj.sol | 7 + contracts/token_holding_amount/erc20/Leo.sol | 7 + contracts/token_holding_amount/erc20/Link.sol | 7 + contracts/token_holding_amount/erc20/Lit.sol | 7 + .../token_holding_amount/erc20/Matic.sol | 7 + contracts/token_holding_amount/erc20/Mcrt.sol | 7 + contracts/token_holding_amount/erc20/Nfp.sol | 7 + .../token_holding_amount/erc20/People.sol | 7 + contracts/token_holding_amount/erc20/Shib.sol | 7 + contracts/token_holding_amount/erc20/Sol.sol | 7 + .../token_holding_amount/erc20/SpaceId.sol | 7 + contracts/token_holding_amount/erc20/Ton.sol | 7 + contracts/token_holding_amount/erc20/Trx.sol | 7 + contracts/token_holding_amount/erc20/Tusd.sol | 7 + contracts/token_holding_amount/erc20/Uni.sol | 7 + contracts/token_holding_amount/erc20/Usdc.sol | 7 + contracts/token_holding_amount/erc20/Usdd.sol | 7 + contracts/token_holding_amount/erc20/Usdt.sol | 7 + contracts/token_holding_amount/erc20/Wbtc.sol | 7 + 50 files changed, 523 insertions(+), 125 deletions(-) diff --git a/contracts/token_holding_amount/GeniidataClient.sol b/contracts/token_holding_amount/GeniidataClient.sol index 110f50c..4b564ed 100644 --- a/contracts/token_holding_amount/GeniidataClient.sol +++ b/contracts/token_holding_amount/GeniidataClient.sol @@ -21,20 +21,28 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; import "../libraries/Utils.sol"; library GeniidataClient { - function getTokenDecimals() internal pure returns (uint8) { - return 18; - } - function getTokenBalance( string[] memory secrets, - string memory url + string memory url, + string memory identityString, + string memory tokenName, + uint8 tokenDecimals ) internal returns (uint256) { + string memory encodePackedUrl = string( + abi.encodePacked( + url, + "?tick=", + tokenName, + "&address=", + identityString + ) + ); HttpHeader[] memory headers = new HttpHeader[](1); - headers[0] = HttpHeader("api-key", secrets[0]); + headers[0] = HttpHeader("api-key", secrets[1]); // https://geniidata.readme.io/reference/get-brc20-tick-list-copy (bool success, string memory value) = Http.GetString( - url, + encodePackedUrl, "/data/list/0/available_balance", headers ); @@ -42,7 +50,7 @@ library GeniidataClient { if (success) { (bool parseDecimalSuccess, uint256 result) = Utils.parseDecimal( value, - getTokenDecimals() + tokenDecimals ); if (parseDecimalSuccess) { return result; diff --git a/contracts/token_holding_amount/NoderealClient.sol b/contracts/token_holding_amount/NoderealClient.sol index 0a982ee..6df76ce 100644 --- a/contracts/token_holding_amount/NoderealClient.sol +++ b/contracts/token_holding_amount/NoderealClient.sol @@ -21,14 +21,18 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; import "../libraries/Utils.sol"; library NoderealClient { - function getTokenBalance( string memory url, + string[] memory secrets, string memory tokenContractAddress, string memory account ) internal returns (bool, uint256) { HttpHeader[] memory headers = new HttpHeader[](0); string memory request; + + string memory encodePackedUrl = string( + abi.encodePacked(url, secrets[0]) + ); if ( keccak256(bytes(tokenContractAddress)) == keccak256("Native Token") ) { @@ -55,7 +59,7 @@ library NoderealClient { return (false, 0); } (bool result, string memory balance) = Http.PostString( - url, + encodePackedUrl, "/result", request, headers diff --git a/contracts/token_holding_amount/TokenLogic.sol b/contracts/token_holding_amount/TokenLogic.sol index 4c5ce20..e0b098e 100644 --- a/contracts/token_holding_amount/TokenLogic.sol +++ b/contracts/token_holding_amount/TokenLogic.sol @@ -26,9 +26,10 @@ import { GeniidataClient } from "./GeniidataClient.sol"; abstract contract TokenLogic is TokenHoldingAmount { mapping(uint32 => string) internal networkUrls; mapping(uint32 => bool) private queriedNetworks; - mapping(uint32 => string) tokenAddresses; + mapping(string => mapping(uint32 => string)) tokenAddresses; mapping(string => string) internal tokenBscAddress; mapping(string => string) internal tokenEthereumAddress; + mapping(string => uint32[]) internal tokenNetworks; constructor() { networkUrls[Web3Networks.Bsc] = "https://bsc-mainnet.nodereal.io/v1/"; // test against mock server => "http://localhost:19527/nodereal_jsonrpc/" @@ -55,36 +56,26 @@ abstract contract TokenLogic is TokenHoldingAmount { (bool identityToStringSuccess, string memory identityString) = Utils .identityToString(network, identity.value); - tokenAddresses[Web3Networks.Bsc] = tokenBscAddress[tokenName]; - tokenAddresses[Web3Networks.Ethereum] = tokenEthereumAddress[tokenName]; if (identityToStringSuccess) { string memory url; - uint32[] memory networks = getTokenNetworks(); + uint32[] memory networks = tokenNetworks[tokenName]; uint256 totalBalance = 0; for (uint32 i = 0; i < networks.length; i++) { // Check if this network has been queried + url = networkUrls[networks[i]]; + if (!queriedNetworks[networks[i]]) { string memory _tokenContractAddress = tokenAddresses[ - networks[i] - ]; - url = string( - abi.encodePacked(networkUrls[networks[i]], secrets[0]) - ); - + tokenName + ][networks[i]]; if (networks[i] == Web3Networks.BitcoinP2tr) { - url = string( - abi.encodePacked( - networkUrls[networks[i]], - "?tick=", - tokenName, - "&address=", - identityString - ) - ); uint256 balance = GeniidataClient.getTokenBalance( secrets, - url + url, + identityString, + tokenName, + getTokenDecimals() ); totalBalance += balance; } else if ( @@ -94,6 +85,7 @@ abstract contract TokenLogic is TokenHoldingAmount { (bool success, uint256 balance) = NoderealClient .getTokenBalance( url, + secrets, _tokenContractAddress, identityString ); @@ -110,18 +102,12 @@ abstract contract TokenLogic is TokenHoldingAmount { return 0; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](3); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - networks[2] = Web3Networks.BitcoinP2tr; - // Add more networks as needed - return networks; - } - function isSupportedNetwork( uint32 network ) internal pure override returns (bool) { - return network == Web3Networks.Bsc || network == Web3Networks.Ethereum||network == Web3Networks.BitcoinP2tr; + return + network == Web3Networks.Bsc || + network == Web3Networks.Ethereum || + network == Web3Networks.BitcoinP2tr; } } diff --git a/contracts/token_holding_amount/TokenMapping.sol b/contracts/token_holding_amount/TokenMapping.sol index f5c5659..432c251 100644 --- a/contracts/token_holding_amount/TokenMapping.sol +++ b/contracts/token_holding_amount/TokenMapping.sol @@ -18,8 +18,10 @@ pragma solidity ^0.8.8; -// brc20 import { TokenLogic } from "./TokenLogic.sol"; +import "../libraries/Identities.sol"; + +// brc20 import { Btcs } from "./brc20/Btcs.sol"; import { Cats } from "./brc20/Cats.sol"; import { Long } from "./brc20/Long.sol"; @@ -68,268 +70,355 @@ import { Usdt } from "./erc20/Usdt.sol"; import { Wbtc } from "./erc20//Wbtc.sol"; import { Cvx } from "./erc20/Cvx.sol"; import { Usdd } from "./erc20/Usdd.sol"; -contract BRC20Mapping is TokenLogic { +contract TokenMapping is TokenLogic { constructor() { // btcs tokenNames["btcs"] = Btcs.getTokenName(); tokenRanges["btcs"] = Btcs.getTokenRanges(); + tokenNetworks["btcs"] = Btcs.getTokenNetworks(); // cats tokenNames["cats"] = Cats.getTokenName(); tokenRanges["cats"] = Cats.getTokenRanges(); + tokenNetworks["cats"] = Cats.getTokenNetworks(); // long tokenNames["long"] = Long.getTokenName(); tokenRanges["long"] = Long.getTokenRanges(); + tokenNetworks["long"] = Long.getTokenNetworks(); // long tokenNames["mmss"] = Mmss.getTokenName(); tokenRanges["mmss"] = Mmss.getTokenRanges(); + tokenNetworks["mmss"] = Mmss.getTokenNetworks(); // ordi tokenNames["ordi"] = Ordi.getTokenName(); tokenRanges["ordi"] = Ordi.getTokenRanges(); + tokenNetworks["ordi"] = Ordi.getTokenNetworks(); // rats tokenNames["rats"] = Rats.getTokenName(); tokenRanges["rats"] = Rats.getTokenRanges(); + tokenNetworks["rats"] = Rats.getTokenNetworks(); // sats tokenNames["sats"] = Sats.getTokenName(); tokenRanges["sats"] = Sats.getTokenRanges(); + tokenNetworks["sats"] = Sats.getTokenNetworks(); - // ada + // ada tokenNames["ada"] = Ada.getTokenName(); tokenRanges["ada"] = Ada.getTokenRanges(); - tokenBscAddress["ada"] = Ada.getTokenBscAddress(); - tokenEthereumAddress["ada"] = Ada.getTokenEthereumAddress(); + tokenNetworks["ada"] = Ada.getTokenNetworks(); + tokenAddresses["ada"][Web3Networks.Bsc] = Ada.getTokenBscAddress(); + tokenAddresses["ada"][Web3Networks.Ethereum] = Ada + .getTokenEthereumAddress(); // amp tokenNames["amp"] = Amp.getTokenName(); tokenRanges["amp"] = Amp.getTokenRanges(); - tokenBscAddress["amp"] = Amp.getTokenBscAddress(); - tokenEthereumAddress["amp"] = Amp.getTokenEthereumAddress(); + tokenNetworks["amp"] = Amp.getTokenNetworks(); + tokenAddresses["amp"][Web3Networks.Bsc] = Amp.getTokenBscAddress(); + tokenAddresses["amp"][Web3Networks.Ethereum] = Amp + .getTokenEthereumAddress(); // atom tokenNames["atom"] = Atom.getTokenName(); tokenRanges["atom"] = Atom.getTokenRanges(); - tokenBscAddress["atom"] = Atom.getTokenBscAddress(); - tokenEthereumAddress["atom"] = Atom.getTokenEthereumAddress(); + tokenNetworks["atom"] = Atom.getTokenNetworks(); + tokenAddresses["atom"][Web3Networks.Bsc] = Atom.getTokenBscAddress(); + tokenAddresses["atom"][Web3Networks.Ethereum] = Atom + .getTokenEthereumAddress(); // bch tokenNames["bch"] = Bch.getTokenName(); tokenRanges["bch"] = Bch.getTokenRanges(); - tokenBscAddress["bch"] = Bch.getTokenBscAddress(); - tokenEthereumAddress["bch"] = Bch.getTokenEthereumAddress(); + tokenNetworks["bch"] = Bch.getTokenNetworks(); + tokenAddresses["bch"][Web3Networks.Bsc] = Bch.getTokenBscAddress(); + tokenAddresses["bch"][Web3Networks.Ethereum] = Bch + .getTokenEthereumAddress(); // bean tokenNames["bean"] = Bean.getTokenName(); tokenRanges["bean"] = Bean.getTokenRanges(); - tokenBscAddress["bean"] = Bean.getTokenBscAddress(); - tokenEthereumAddress["bean"] = Bean.getTokenEthereumAddress(); + tokenNetworks["bean"] = Bean.getTokenNetworks(); + tokenAddresses["bean"][Web3Networks.Bsc] = Bean.getTokenBscAddress(); + tokenAddresses["bean"][Web3Networks.Ethereum] = Bean + .getTokenEthereumAddress(); // bnb tokenNames["bnb"] = Bnb.getTokenName(); tokenRanges["bnb"] = Bnb.getTokenRanges(); - tokenBscAddress["bnb"] = Bnb.getTokenBscAddress(); - tokenEthereumAddress["bnb"] = Bnb.getTokenEthereumAddress(); + tokenNetworks["bnb"] = Bnb.getTokenNetworks(); + tokenAddresses["bnb"][Web3Networks.Bsc] = Bnb.getTokenBscAddress(); + tokenAddresses["bnb"][Web3Networks.Ethereum] = Bnb + .getTokenEthereumAddress(); // comp tokenNames["comp"] = Comp.getTokenName(); tokenRanges["comp"] = Comp.getTokenRanges(); - tokenBscAddress["comp"] = Comp.getTokenBscAddress(); - tokenEthereumAddress["comp"] = Comp.getTokenEthereumAddress(); + tokenNetworks["comp"] = Comp.getTokenNetworks(); + tokenAddresses["comp"][Web3Networks.Bsc] = Comp.getTokenBscAddress(); + tokenAddresses["comp"][Web3Networks.Ethereum] = Comp + .getTokenEthereumAddress(); // cro tokenNames["cro"] = Cro.getTokenName(); tokenRanges["cro"] = Cro.getTokenRanges(); - tokenBscAddress["cro"] = Cro.getTokenBscAddress(); - tokenEthereumAddress["cro"] = Cro.getTokenEthereumAddress(); + tokenNetworks["cro"] = Cro.getTokenNetworks(); + tokenAddresses["cro"][Web3Networks.Bsc] = Cro.getTokenBscAddress(); + tokenAddresses["cro"][Web3Networks.Ethereum] = Cro + .getTokenEthereumAddress(); // crv tokenNames["crv"] = Crv.getTokenName(); tokenRanges["crv"] = Crv.getTokenRanges(); - tokenBscAddress["crv"] = Crv.getTokenBscAddress(); - tokenEthereumAddress["crv"] = Crv.getTokenEthereumAddress(); + tokenNetworks["crv"] = Crv.getTokenNetworks(); + tokenAddresses["crv"][Web3Networks.Bsc] = Crv.getTokenBscAddress(); + tokenAddresses["crv"][Web3Networks.Ethereum] = Crv + .getTokenEthereumAddress(); // cvx tokenNames["cvx"] = Cvx.getTokenName(); tokenRanges["cvx"] = Cvx.getTokenRanges(); - tokenBscAddress["cvx"] = Cvx.getTokenBscAddress(); - tokenEthereumAddress["cvx"] = Cvx.getTokenEthereumAddress(); + tokenNetworks["cvx"] = Cvx.getTokenNetworks(); + tokenAddresses["cvx"][Web3Networks.Bsc] = Cvx.getTokenBscAddress(); + tokenAddresses["cvx"][Web3Networks.Ethereum] = Cvx + .getTokenEthereumAddress(); // dai tokenNames["dai"] = Dai.getTokenName(); tokenRanges["dai"] = Dai.getTokenRanges(); - tokenBscAddress["dai"] = Dai.getTokenBscAddress(); - tokenEthereumAddress["dai"] = Dai.getTokenEthereumAddress(); + tokenNetworks["dai"] = Dai.getTokenNetworks(); + tokenAddresses["dai"][Web3Networks.Bsc] = Dai.getTokenBscAddress(); + tokenAddresses["dai"][Web3Networks.Ethereum] = Dai + .getTokenEthereumAddress(); // doge tokenNames["doge"] = Doge.getTokenName(); tokenRanges["doge"] = Doge.getTokenRanges(); - tokenBscAddress["doge"] = Doge.getTokenBscAddress(); - tokenEthereumAddress["doge"] = Doge.getTokenEthereumAddress(); + tokenNetworks["doge"] = Doge.getTokenNetworks(); + tokenAddresses["doge"][Web3Networks.Bsc] = Doge.getTokenBscAddress(); + tokenAddresses["doge"][Web3Networks.Ethereum] = Doge + .getTokenEthereumAddress(); // dydx tokenNames["dydx"] = Dydx.getTokenName(); tokenRanges["dydx"] = Dydx.getTokenRanges(); - tokenBscAddress["dydx"] = Dydx.getTokenBscAddress(); - tokenEthereumAddress["dydx"] = Dydx.getTokenEthereumAddress(); + tokenNetworks["dydx"] = Dydx.getTokenNetworks(); + tokenAddresses["dydx"][Web3Networks.Bsc] = Dydx.getTokenBscAddress(); + tokenAddresses["dydx"][Web3Networks.Ethereum] = Dydx + .getTokenEthereumAddress(); // etc tokenNames["etc"] = Etc.getTokenName(); tokenRanges["etc"] = Etc.getTokenRanges(); - tokenBscAddress["etc"] = Etc.getTokenBscAddress(); - tokenEthereumAddress["etc"] = Etc.getTokenEthereumAddress(); + tokenNetworks["etc"] = Etc.getTokenNetworks(); + tokenAddresses["etc"][Web3Networks.Bsc] = Etc.getTokenBscAddress(); + tokenAddresses["etc"][Web3Networks.Ethereum] = Etc + .getTokenEthereumAddress(); // eth tokenNames["eth"] = Eth.getTokenName(); tokenRanges["eth"] = Eth.getTokenRanges(); - tokenBscAddress["eth"] = Eth.getTokenBscAddress(); - tokenEthereumAddress["eth"] = Eth.getTokenEthereumAddress(); + tokenNetworks["eth"] = Eth.getTokenNetworks(); + tokenAddresses["eth"][Web3Networks.Bsc] = Eth.getTokenBscAddress(); + tokenAddresses["eth"][Web3Networks.Ethereum] = Eth + .getTokenEthereumAddress(); // fil tokenNames["fil"] = Fil.getTokenName(); tokenRanges["fil"] = Fil.getTokenRanges(); - tokenBscAddress["fil"] = Fil.getTokenBscAddress(); - tokenEthereumAddress["fil"] = Fil.getTokenEthereumAddress(); + tokenNetworks["fil"] = Fil.getTokenNetworks(); + tokenAddresses["fil"][Web3Networks.Bsc] = Fil.getTokenBscAddress(); + tokenAddresses["fil"][Web3Networks.Ethereum] = Fil + .getTokenEthereumAddress(); // grt tokenNames["grt"] = Grt.getTokenName(); tokenRanges["grt"] = Grt.getTokenRanges(); - tokenBscAddress["grt"] = Grt.getTokenBscAddress(); - tokenEthereumAddress["grt"] = Grt.getTokenEthereumAddress(); + tokenNetworks["grt"] = Grt.getTokenNetworks(); + tokenAddresses["grt"][Web3Networks.Bsc] = Grt.getTokenBscAddress(); + tokenAddresses["grt"][Web3Networks.Ethereum] = Grt + .getTokenEthereumAddress(); // gtc tokenNames["gtc"] = Gtc.getTokenName(); tokenRanges["gtc"] = Gtc.getTokenRanges(); - tokenBscAddress["gtc"] = Gtc.getTokenBscAddress(); - tokenEthereumAddress["gtc"] = Gtc.getTokenEthereumAddress(); + tokenNetworks["gtc"] = Gtc.getTokenNetworks(); + tokenAddresses["gtc"][Web3Networks.Bsc] = Gtc.getTokenBscAddress(); + tokenAddresses["gtc"][Web3Networks.Ethereum] = Gtc + .getTokenEthereumAddress(); // gusd tokenNames["gusd"] = Gusd.getTokenName(); tokenRanges["gusd"] = Gusd.getTokenRanges(); - tokenBscAddress["gusd"] = Gusd.getTokenBscAddress(); - tokenEthereumAddress["gusd"] = Gusd.getTokenEthereumAddress(); + tokenNetworks["gusd"] = Gusd.getTokenNetworks(); + tokenAddresses["gusd"][Web3Networks.Bsc] = Gusd.getTokenBscAddress(); + tokenAddresses["gusd"][Web3Networks.Ethereum] = Gusd + .getTokenEthereumAddress(); // imx tokenNames["imx"] = Imx.getTokenName(); tokenRanges["imx"] = Imx.getTokenRanges(); - tokenBscAddress["imx"] = Imx.getTokenBscAddress(); - tokenEthereumAddress["imx"] = Imx.getTokenEthereumAddress(); + tokenNetworks["imx"] = Imx.getTokenNetworks(); + tokenAddresses["imx"][Web3Networks.Bsc] = Imx.getTokenBscAddress(); + tokenAddresses["imx"][Web3Networks.Ethereum] = Imx + .getTokenEthereumAddress(); // inj tokenNames["inj"] = Inj.getTokenName(); tokenRanges["inj"] = Inj.getTokenRanges(); - tokenBscAddress["inj"] = Inj.getTokenBscAddress(); - tokenEthereumAddress["inj"] = Inj.getTokenEthereumAddress(); + tokenNetworks["inj"] = Inj.getTokenNetworks(); + tokenAddresses["inj"][Web3Networks.Bsc] = Inj.getTokenBscAddress(); + tokenAddresses["inj"][Web3Networks.Ethereum] = Inj + .getTokenEthereumAddress(); // leo tokenNames["leo"] = Leo.getTokenName(); tokenRanges["leo"] = Leo.getTokenRanges(); - tokenBscAddress["leo"] = Leo.getTokenBscAddress(); - tokenEthereumAddress["leo"] = Leo.getTokenEthereumAddress(); + tokenNetworks["leo"] = Leo.getTokenNetworks(); + tokenAddresses["leo"][Web3Networks.Bsc] = Leo.getTokenBscAddress(); + tokenAddresses["leo"][Web3Networks.Ethereum] = Leo + .getTokenEthereumAddress(); // link tokenNames["link"] = Link.getTokenName(); tokenRanges["link"] = Link.getTokenRanges(); - tokenBscAddress["link"] = Link.getTokenBscAddress(); - tokenEthereumAddress["link"] = Link.getTokenEthereumAddress(); + tokenNetworks["link"] = Link.getTokenNetworks(); + tokenAddresses["link"][Web3Networks.Bsc] = Link.getTokenBscAddress(); + tokenAddresses["link"][Web3Networks.Ethereum] = Link + .getTokenEthereumAddress(); // lit tokenNames["lit"] = Lit.getTokenName(); tokenRanges["lit"] = Lit.getTokenRanges(); - tokenBscAddress["lit"] = Lit.getTokenBscAddress(); - tokenEthereumAddress["lit"] = Lit.getTokenEthereumAddress(); + tokenNetworks["lit"] = Lit.getTokenNetworks(); + tokenAddresses["lit"][Web3Networks.Bsc] = Lit.getTokenBscAddress(); + tokenAddresses["lit"][Web3Networks.Ethereum] = Lit + .getTokenEthereumAddress(); // matic tokenNames["matic"] = Matic.getTokenName(); tokenRanges["matic"] = Matic.getTokenRanges(); - tokenBscAddress["matic"] = Matic.getTokenBscAddress(); - tokenEthereumAddress["matic"] = Matic.getTokenEthereumAddress(); + tokenNetworks["matic"] = Matic.getTokenNetworks(); + tokenAddresses["matic"][Web3Networks.Bsc] = Matic.getTokenBscAddress(); + tokenAddresses["matic"][Web3Networks.Ethereum] = Matic + .getTokenEthereumAddress(); // mcrt tokenNames["mcrt"] = Mcrt.getTokenName(); tokenRanges["mcrt"] = Mcrt.getTokenRanges(); - tokenBscAddress["mcrt"] = Mcrt.getTokenBscAddress(); - tokenEthereumAddress["mcrt"] = Mcrt.getTokenEthereumAddress(); + tokenNetworks["mcrt"] = Mcrt.getTokenNetworks(); + tokenAddresses["mcrt"][Web3Networks.Bsc] = Mcrt.getTokenBscAddress(); + tokenAddresses["mcrt"][Web3Networks.Ethereum] = Mcrt + .getTokenEthereumAddress(); // nfp tokenNames["nfp"] = Nfp.getTokenName(); tokenRanges["nfp"] = Nfp.getTokenRanges(); - tokenBscAddress["nfp"] = Nfp.getTokenBscAddress(); - tokenEthereumAddress["nfp"] = Nfp.getTokenEthereumAddress(); + tokenNetworks["nfp"] = Nfp.getTokenNetworks(); + tokenAddresses["nfp"][Web3Networks.Bsc] = Nfp.getTokenBscAddress(); + tokenAddresses["nfp"][Web3Networks.Ethereum] = Nfp + .getTokenEthereumAddress(); // people tokenNames["people"] = People.getTokenName(); tokenRanges["people"] = People.getTokenRanges(); - tokenBscAddress["people"] = People.getTokenBscAddress(); - tokenEthereumAddress["people"] = People.getTokenEthereumAddress(); + tokenNetworks["people"] = People.getTokenNetworks(); + tokenAddresses["people"][Web3Networks.Bsc] = People + .getTokenBscAddress(); + tokenAddresses["people"][Web3Networks.Ethereum] = People + .getTokenEthereumAddress(); // shib tokenNames["shib"] = Shib.getTokenName(); tokenRanges["shib"] = Shib.getTokenRanges(); - tokenBscAddress["shib"] = Shib.getTokenBscAddress(); - tokenEthereumAddress["shib"] = Shib.getTokenEthereumAddress(); + tokenNetworks["shib"] = Shib.getTokenNetworks(); + tokenAddresses["shib"][Web3Networks.Bsc] = Shib.getTokenBscAddress(); + tokenAddresses["shib"][Web3Networks.Ethereum] = Shib + .getTokenEthereumAddress(); // sol tokenNames["sol"] = Sol.getTokenName(); tokenRanges["sol"] = Sol.getTokenRanges(); - tokenBscAddress["sol"] = Sol.getTokenBscAddress(); - tokenEthereumAddress["sol"] = Sol.getTokenEthereumAddress(); + tokenNetworks["sol"] = Sol.getTokenNetworks(); + tokenAddresses["sol"][Web3Networks.Bsc] = Sol.getTokenBscAddress(); + tokenAddresses["sol"][Web3Networks.Ethereum] = Sol + .getTokenEthereumAddress(); // spaceid tokenNames["spaceid"] = SpaceId.getTokenName(); tokenRanges["spaceid"] = SpaceId.getTokenRanges(); - tokenBscAddress["spaceid"] = SpaceId.getTokenBscAddress(); - tokenEthereumAddress["spaceid"] = SpaceId.getTokenEthereumAddress(); + tokenNetworks["spaceid"] = SpaceId.getTokenNetworks(); + tokenAddresses["spaceid"][Web3Networks.Bsc] = SpaceId + .getTokenBscAddress(); + tokenAddresses["spaceid"][Web3Networks.Ethereum] = SpaceId + .getTokenEthereumAddress(); // ton tokenNames["ton"] = Ton.getTokenName(); tokenRanges["ton"] = Ton.getTokenRanges(); - tokenBscAddress["ton"] = Ton.getTokenBscAddress(); - tokenEthereumAddress["ton"] = Ton.getTokenEthereumAddress(); + tokenNetworks["ton"] = Ton.getTokenNetworks(); + tokenAddresses["ton"][Web3Networks.Bsc] = Ton.getTokenBscAddress(); + tokenAddresses["ton"][Web3Networks.Ethereum] = Ton + .getTokenEthereumAddress(); // trx tokenNames["trx"] = Trx.getTokenName(); tokenRanges["trx"] = Trx.getTokenRanges(); - tokenBscAddress["trx"] = Trx.getTokenBscAddress(); - tokenEthereumAddress["trx"] = Trx.getTokenEthereumAddress(); + tokenNetworks["trx"] = Trx.getTokenNetworks(); + tokenAddresses["trx"][Web3Networks.Bsc] = Trx.getTokenBscAddress(); + tokenAddresses["trx"][Web3Networks.Ethereum] = Trx + .getTokenEthereumAddress(); // tusd tokenNames["tusd"] = Tusd.getTokenName(); tokenRanges["tusd"] = Tusd.getTokenRanges(); - tokenBscAddress["tusd"] = Tusd.getTokenBscAddress(); - tokenEthereumAddress["tusd"] = Tusd.getTokenEthereumAddress(); + tokenNetworks["tusd"] = Tusd.getTokenNetworks(); + tokenAddresses["tusd"][Web3Networks.Bsc] = Tusd.getTokenBscAddress(); + tokenAddresses["tusd"][Web3Networks.Ethereum] = Tusd + .getTokenEthereumAddress(); // uni tokenNames["uni"] = Uni.getTokenName(); tokenRanges["uni"] = Uni.getTokenRanges(); - tokenBscAddress["uni"] = Uni.getTokenBscAddress(); - tokenEthereumAddress["uni"] = Uni.getTokenEthereumAddress(); + tokenNetworks["uni"] = Uni.getTokenNetworks(); + tokenAddresses["uni"][Web3Networks.Bsc] = Uni.getTokenBscAddress(); + tokenAddresses["uni"][Web3Networks.Ethereum] = Uni + .getTokenEthereumAddress(); // usdc tokenNames["usdc"] = Usdc.getTokenName(); tokenRanges["usdc"] = Usdc.getTokenRanges(); - tokenBscAddress["usdc"] = Usdc.getTokenBscAddress(); - tokenEthereumAddress["usdc"] = Usdc.getTokenEthereumAddress(); + tokenNetworks["usdc"] = Usdc.getTokenNetworks(); + tokenAddresses["usdc"][Web3Networks.Bsc] = Usdc.getTokenBscAddress(); + tokenAddresses["usdc"][Web3Networks.Ethereum] = Usdc + .getTokenEthereumAddress(); // usdd tokenNames["usdd"] = Usdd.getTokenName(); tokenRanges["usdd"] = Usdd.getTokenRanges(); - tokenBscAddress["usdd"] = Usdd.getTokenBscAddress(); - tokenEthereumAddress["usdd"] = Usdd.getTokenEthereumAddress(); + tokenNetworks["usdd"] = Usdd.getTokenNetworks(); + tokenAddresses["usdd"][Web3Networks.Bsc] = Usdd.getTokenBscAddress(); + tokenAddresses["usdd"][Web3Networks.Ethereum] = Usdd + .getTokenEthereumAddress(); // usdt tokenNames["usdt"] = Usdt.getTokenName(); tokenRanges["usdt"] = Usdt.getTokenRanges(); - tokenBscAddress["usdt"] = Usdt.getTokenBscAddress(); - tokenEthereumAddress["usdt"] = Usdt.getTokenEthereumAddress(); + tokenNetworks["usdt"] = Usdt.getTokenNetworks(); + tokenAddresses["usdt"][Web3Networks.Bsc] = Usdt.getTokenBscAddress(); + tokenAddresses["usdt"][Web3Networks.Ethereum] = Usdt + .getTokenEthereumAddress(); // wbtc tokenNames["wbtc"] = Wbtc.getTokenName(); tokenRanges["wbtc"] = Wbtc.getTokenRanges(); - tokenBscAddress["wbtc"] = Wbtc.getTokenBscAddress(); - tokenEthereumAddress["wbtc"] = Wbtc.getTokenEthereumAddress(); + tokenNetworks["wbtc"] = Wbtc.getTokenNetworks(); + tokenAddresses["wbtc"][Web3Networks.Bsc] = Wbtc.getTokenBscAddress(); + tokenAddresses["wbtc"][Web3Networks.Ethereum] = Wbtc + .getTokenEthereumAddress(); } } diff --git a/contracts/token_holding_amount/brc20/Btcs.sol b/contracts/token_holding_amount/brc20/Btcs.sol index 0eb48a0..2f3b309 100644 --- a/contracts/token_holding_amount/brc20/Btcs.sol +++ b/contracts/token_holding_amount/brc20/Btcs.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8.8; import "../Constants.sol"; +import "../../libraries/Identities.sol"; library Btcs { function getTokenName() internal pure returns (string memory) { @@ -38,4 +39,9 @@ library Btcs { ranges[8] = 800 * Constants.decimals_factor; return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](1); + networks[0] = Web3Networks.BitcoinP2tr; + return networks; + } } diff --git a/contracts/token_holding_amount/brc20/Cats.sol b/contracts/token_holding_amount/brc20/Cats.sol index 0738b2f..0a4b5cb 100644 --- a/contracts/token_holding_amount/brc20/Cats.sol +++ b/contracts/token_holding_amount/brc20/Cats.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8.8; import "../Constants.sol"; +import "../../libraries/Identities.sol"; library Cats { function getTokenName() internal pure returns (string memory) { @@ -37,4 +38,9 @@ library Cats { ranges[7] = 800000 * Constants.decimals_factor; return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](1); + networks[0] = Web3Networks.BitcoinP2tr; + return networks; + } } diff --git a/contracts/token_holding_amount/brc20/Long.sol b/contracts/token_holding_amount/brc20/Long.sol index 5f7fba1..60fbef5 100644 --- a/contracts/token_holding_amount/brc20/Long.sol +++ b/contracts/token_holding_amount/brc20/Long.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8.8; import "../Constants.sol"; +import "../../libraries/Identities.sol"; library Long { function getTokenName() internal pure returns (string memory) { @@ -38,4 +39,9 @@ library Long { ranges[8] = 3000 * Constants.decimals_factor; return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](1); + networks[0] = Web3Networks.BitcoinP2tr; + return networks; + } } diff --git a/contracts/token_holding_amount/brc20/Mmss.sol b/contracts/token_holding_amount/brc20/Mmss.sol index 31bad8a..37dc394 100644 --- a/contracts/token_holding_amount/brc20/Mmss.sol +++ b/contracts/token_holding_amount/brc20/Mmss.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8.8; import "../Constants.sol"; +import "../../libraries/Identities.sol"; library Mmss { function getTokenName() internal pure returns (string memory) { @@ -38,4 +39,9 @@ library Mmss { ranges[8] = 2000 * Constants.decimals_factor; return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](1); + networks[0] = Web3Networks.BitcoinP2tr; + return networks; + } } diff --git a/contracts/token_holding_amount/brc20/Ordi.sol b/contracts/token_holding_amount/brc20/Ordi.sol index e058e67..a9e5200 100644 --- a/contracts/token_holding_amount/brc20/Ordi.sol +++ b/contracts/token_holding_amount/brc20/Ordi.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8.8; import "../Constants.sol"; +import "../../libraries/Identities.sol"; library Ordi { function getTokenName() internal pure returns (string memory) { @@ -37,4 +38,9 @@ library Ordi { ranges[7] = 500 * Constants.decimals_factor; return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](1); + networks[0] = Web3Networks.BitcoinP2tr; + return networks; + } } diff --git a/contracts/token_holding_amount/brc20/Rats.sol b/contracts/token_holding_amount/brc20/Rats.sol index 9e24892..9ea1bd8 100644 --- a/contracts/token_holding_amount/brc20/Rats.sol +++ b/contracts/token_holding_amount/brc20/Rats.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8.8; import "../Constants.sol"; +import "../../libraries/Identities.sol"; library Rats { function getTokenName() internal pure returns (string memory) { @@ -38,4 +39,9 @@ library Rats { ranges[8] = 2000000 * Constants.decimals_factor; return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](1); + networks[0] = Web3Networks.BitcoinP2tr; + return networks; + } } diff --git a/contracts/token_holding_amount/brc20/Sats.sol b/contracts/token_holding_amount/brc20/Sats.sol index 2cdb143..27f6772 100644 --- a/contracts/token_holding_amount/brc20/Sats.sol +++ b/contracts/token_holding_amount/brc20/Sats.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8.8; import "../Constants.sol"; +import "../../libraries/Identities.sol"; library Sats { function getTokenName() internal pure returns (string memory) { @@ -38,4 +39,9 @@ library Sats { ranges[8] = 6000000000 * Constants.decimals_factor; return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](1); + networks[0] = Web3Networks.BitcoinP2tr; + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Ada.sol b/contracts/token_holding_amount/erc20/Ada.sol index 7119cf3..36e21a3 100644 --- a/contracts/token_holding_amount/erc20/Ada.sol +++ b/contracts/token_holding_amount/erc20/Ada.sol @@ -44,4 +44,10 @@ library Ada { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Amp.sol b/contracts/token_holding_amount/erc20/Amp.sol index cea858e..71547c6 100644 --- a/contracts/token_holding_amount/erc20/Amp.sol +++ b/contracts/token_holding_amount/erc20/Amp.sol @@ -48,4 +48,11 @@ library Amp { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Atom.sol b/contracts/token_holding_amount/erc20/Atom.sol index d1fbcb1..7b3680c 100644 --- a/contracts/token_holding_amount/erc20/Atom.sol +++ b/contracts/token_holding_amount/erc20/Atom.sol @@ -45,4 +45,11 @@ library Atom { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Bch.sol b/contracts/token_holding_amount/erc20/Bch.sol index ddf2dbe..b5e00e0 100644 --- a/contracts/token_holding_amount/erc20/Bch.sol +++ b/contracts/token_holding_amount/erc20/Bch.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8.8; import "../Constants.sol"; +import "../../libraries/Identities.sol"; library Bch { function getTokenBscAddress() internal pure returns (string memory) { @@ -47,4 +48,11 @@ library Bch { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Bean.sol b/contracts/token_holding_amount/erc20/Bean.sol index debaa71..df88fe1 100644 --- a/contracts/token_holding_amount/erc20/Bean.sol +++ b/contracts/token_holding_amount/erc20/Bean.sol @@ -41,4 +41,11 @@ library Bean { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Bnb.sol b/contracts/token_holding_amount/erc20/Bnb.sol index f01249d..9c5a523 100644 --- a/contracts/token_holding_amount/erc20/Bnb.sol +++ b/contracts/token_holding_amount/erc20/Bnb.sol @@ -18,7 +18,6 @@ pragma solidity ^0.8.8; - import "../../libraries/Identities.sol"; import "../Constants.sol"; @@ -48,4 +47,11 @@ library Bnb { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Comp.sol b/contracts/token_holding_amount/erc20/Comp.sol index f9df983..0d3d105 100644 --- a/contracts/token_holding_amount/erc20/Comp.sol +++ b/contracts/token_holding_amount/erc20/Comp.sol @@ -18,7 +18,6 @@ pragma solidity ^0.8.8; - import "../../libraries/Identities.sol"; import "../Constants.sol"; @@ -49,4 +48,11 @@ library Comp { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Cro.sol b/contracts/token_holding_amount/erc20/Cro.sol index fe64e32..fbbdc70 100644 --- a/contracts/token_holding_amount/erc20/Cro.sol +++ b/contracts/token_holding_amount/erc20/Cro.sol @@ -45,4 +45,11 @@ library Cro { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Crv.sol b/contracts/token_holding_amount/erc20/Crv.sol index 093de83..d994331 100644 --- a/contracts/token_holding_amount/erc20/Crv.sol +++ b/contracts/token_holding_amount/erc20/Crv.sol @@ -18,7 +18,6 @@ pragma solidity ^0.8.8; - import "../../libraries/Identities.sol"; import "../Constants.sol"; @@ -49,4 +48,11 @@ library Crv { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Cvx.sol b/contracts/token_holding_amount/erc20/Cvx.sol index d795cf9..dace723 100644 --- a/contracts/token_holding_amount/erc20/Cvx.sol +++ b/contracts/token_holding_amount/erc20/Cvx.sol @@ -47,4 +47,11 @@ library Cvx { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Dai.sol b/contracts/token_holding_amount/erc20/Dai.sol index e3f6fbb..3ba6f18 100644 --- a/contracts/token_holding_amount/erc20/Dai.sol +++ b/contracts/token_holding_amount/erc20/Dai.sol @@ -47,4 +47,11 @@ library Dai { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Doge.sol b/contracts/token_holding_amount/erc20/Doge.sol index f1c7a2e..8e34521 100644 --- a/contracts/token_holding_amount/erc20/Doge.sol +++ b/contracts/token_holding_amount/erc20/Doge.sol @@ -44,4 +44,11 @@ library Doge { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Dydx.sol b/contracts/token_holding_amount/erc20/Dydx.sol index 2e5bb03..ade6482 100644 --- a/contracts/token_holding_amount/erc20/Dydx.sol +++ b/contracts/token_holding_amount/erc20/Dydx.sol @@ -48,4 +48,11 @@ library Dydx { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Etc.sol b/contracts/token_holding_amount/erc20/Etc.sol index 88d5ace..6afa9e1 100644 --- a/contracts/token_holding_amount/erc20/Etc.sol +++ b/contracts/token_holding_amount/erc20/Etc.sol @@ -18,7 +18,6 @@ pragma solidity ^0.8.8; - import "../../libraries/Identities.sol"; import "../Constants.sol"; @@ -45,4 +44,11 @@ library Etc { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Eth.sol b/contracts/token_holding_amount/erc20/Eth.sol index 076f6b1..04c04d1 100644 --- a/contracts/token_holding_amount/erc20/Eth.sol +++ b/contracts/token_holding_amount/erc20/Eth.sol @@ -50,4 +50,11 @@ library Eth { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Fil.sol b/contracts/token_holding_amount/erc20/Fil.sol index 510d427..66f0187 100644 --- a/contracts/token_holding_amount/erc20/Fil.sol +++ b/contracts/token_holding_amount/erc20/Fil.sol @@ -44,4 +44,11 @@ library Fil { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Grt.sol b/contracts/token_holding_amount/erc20/Grt.sol index c124834..488afad 100644 --- a/contracts/token_holding_amount/erc20/Grt.sol +++ b/contracts/token_holding_amount/erc20/Grt.sol @@ -47,4 +47,11 @@ library Grt { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Gtc.sol b/contracts/token_holding_amount/erc20/Gtc.sol index 814bad6..2e7e3f2 100644 --- a/contracts/token_holding_amount/erc20/Gtc.sol +++ b/contracts/token_holding_amount/erc20/Gtc.sol @@ -48,4 +48,11 @@ library Gtc { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Gusd.sol b/contracts/token_holding_amount/erc20/Gusd.sol index 103053d..fdb4e12 100644 --- a/contracts/token_holding_amount/erc20/Gusd.sol +++ b/contracts/token_holding_amount/erc20/Gusd.sol @@ -48,4 +48,11 @@ library Gusd { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Imx.sol b/contracts/token_holding_amount/erc20/Imx.sol index 0123d61..bd03d62 100644 --- a/contracts/token_holding_amount/erc20/Imx.sol +++ b/contracts/token_holding_amount/erc20/Imx.sol @@ -46,4 +46,11 @@ library Imx { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Inj.sol b/contracts/token_holding_amount/erc20/Inj.sol index fa2498e..fd39b68 100644 --- a/contracts/token_holding_amount/erc20/Inj.sol +++ b/contracts/token_holding_amount/erc20/Inj.sol @@ -44,4 +44,11 @@ library Inj { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Leo.sol b/contracts/token_holding_amount/erc20/Leo.sol index 8f2381d..6de696e 100644 --- a/contracts/token_holding_amount/erc20/Leo.sol +++ b/contracts/token_holding_amount/erc20/Leo.sol @@ -44,4 +44,11 @@ library Leo { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Link.sol b/contracts/token_holding_amount/erc20/Link.sol index 576f07d..b66846b 100644 --- a/contracts/token_holding_amount/erc20/Link.sol +++ b/contracts/token_holding_amount/erc20/Link.sol @@ -48,4 +48,11 @@ library Link { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Lit.sol b/contracts/token_holding_amount/erc20/Lit.sol index 453baa3..955bbd1 100644 --- a/contracts/token_holding_amount/erc20/Lit.sol +++ b/contracts/token_holding_amount/erc20/Lit.sol @@ -48,4 +48,11 @@ library Lit { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Matic.sol b/contracts/token_holding_amount/erc20/Matic.sol index 8a8c07e..c6ca4f0 100644 --- a/contracts/token_holding_amount/erc20/Matic.sol +++ b/contracts/token_holding_amount/erc20/Matic.sol @@ -48,4 +48,11 @@ library Matic { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Mcrt.sol b/contracts/token_holding_amount/erc20/Mcrt.sol index 07998d1..47e8e76 100644 --- a/contracts/token_holding_amount/erc20/Mcrt.sol +++ b/contracts/token_holding_amount/erc20/Mcrt.sol @@ -43,4 +43,11 @@ library Mcrt { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Nfp.sol b/contracts/token_holding_amount/erc20/Nfp.sol index d74e332..6c726f5 100644 --- a/contracts/token_holding_amount/erc20/Nfp.sol +++ b/contracts/token_holding_amount/erc20/Nfp.sol @@ -48,4 +48,11 @@ library Nfp { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/People.sol b/contracts/token_holding_amount/erc20/People.sol index 690db03..63d24c4 100644 --- a/contracts/token_holding_amount/erc20/People.sol +++ b/contracts/token_holding_amount/erc20/People.sol @@ -48,4 +48,11 @@ library People { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Shib.sol b/contracts/token_holding_amount/erc20/Shib.sol index 96d5298..0345085 100644 --- a/contracts/token_holding_amount/erc20/Shib.sol +++ b/contracts/token_holding_amount/erc20/Shib.sol @@ -46,4 +46,11 @@ library Shib { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Sol.sol b/contracts/token_holding_amount/erc20/Sol.sol index 9b48bee..79a69b8 100644 --- a/contracts/token_holding_amount/erc20/Sol.sol +++ b/contracts/token_holding_amount/erc20/Sol.sol @@ -48,4 +48,11 @@ library Sol { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/SpaceId.sol b/contracts/token_holding_amount/erc20/SpaceId.sol index d651183..8579e1f 100644 --- a/contracts/token_holding_amount/erc20/SpaceId.sol +++ b/contracts/token_holding_amount/erc20/SpaceId.sol @@ -48,4 +48,11 @@ library SpaceId { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Ton.sol b/contracts/token_holding_amount/erc20/Ton.sol index 31afe29..1bb62a4 100644 --- a/contracts/token_holding_amount/erc20/Ton.sol +++ b/contracts/token_holding_amount/erc20/Ton.sol @@ -48,4 +48,11 @@ library Ton { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Trx.sol b/contracts/token_holding_amount/erc20/Trx.sol index 6a2ec49..0329108 100644 --- a/contracts/token_holding_amount/erc20/Trx.sol +++ b/contracts/token_holding_amount/erc20/Trx.sol @@ -48,4 +48,11 @@ library Trx { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Tusd.sol b/contracts/token_holding_amount/erc20/Tusd.sol index f3237b3..cc26b63 100644 --- a/contracts/token_holding_amount/erc20/Tusd.sol +++ b/contracts/token_holding_amount/erc20/Tusd.sol @@ -47,4 +47,11 @@ library Tusd { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Uni.sol b/contracts/token_holding_amount/erc20/Uni.sol index a86f999..9a5c0ef 100644 --- a/contracts/token_holding_amount/erc20/Uni.sol +++ b/contracts/token_holding_amount/erc20/Uni.sol @@ -46,4 +46,11 @@ library Uni { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Usdc.sol b/contracts/token_holding_amount/erc20/Usdc.sol index 88e75f6..6fc3e50 100644 --- a/contracts/token_holding_amount/erc20/Usdc.sol +++ b/contracts/token_holding_amount/erc20/Usdc.sol @@ -30,4 +30,11 @@ library Usdc { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Usdd.sol b/contracts/token_holding_amount/erc20/Usdd.sol index 37993e0..8543184 100644 --- a/contracts/token_holding_amount/erc20/Usdd.sol +++ b/contracts/token_holding_amount/erc20/Usdd.sol @@ -47,4 +47,11 @@ library Usdd { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Usdt.sol b/contracts/token_holding_amount/erc20/Usdt.sol index ab928cd..acdb77a 100644 --- a/contracts/token_holding_amount/erc20/Usdt.sol +++ b/contracts/token_holding_amount/erc20/Usdt.sol @@ -48,4 +48,11 @@ library Usdt { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } diff --git a/contracts/token_holding_amount/erc20/Wbtc.sol b/contracts/token_holding_amount/erc20/Wbtc.sol index 5d83985..c6e3600 100644 --- a/contracts/token_holding_amount/erc20/Wbtc.sol +++ b/contracts/token_holding_amount/erc20/Wbtc.sol @@ -53,4 +53,11 @@ library Wbtc { return ranges; } + function getTokenNetworks() internal pure returns (uint32[] memory) { + uint32[] memory networks = new uint32[](2); + networks[0] = Web3Networks.Ethereum; + networks[1] = Web3Networks.Bsc; + + return networks; + } } From 7a5e6f9b7045fd104984bad6eeb6bc6c08a81ba0 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Fri, 21 Jun 2024 17:08:32 +0800 Subject: [PATCH 22/23] allowUnlimitedContractSize --- hardhat.config.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 712c017..bfcb16b 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,8 +1,13 @@ import { HardhatUserConfig } from "hardhat/config" import "@nomicfoundation/hardhat-toolbox" -const config: HardhatUserConfig = { +const config = { solidity: "0.8.11", + networks: { + hardhat: { + allowUnlimitedContractSize: true, + }, + }, } export default config From 4409784bab9f3bc2c78a8fdbd19f24ad2eaaa474 Mon Sep 17 00:00:00 2001 From: Verin1005 Date: Fri, 21 Jun 2024 17:08:52 +0800 Subject: [PATCH 23/23] add tests --- .../token_holding_amount/NoderealClient.sol | 1 + .../TokenHoldingAmount.sol | 1 - .../token_holding_amount/TokenMapping.sol | 4 +-- .../{TokenLogic.sol => TokenQueryLogic.sol} | 7 +++-- test/contracts.ts | 30 ++++++++++++------- 5 files changed, 27 insertions(+), 16 deletions(-) rename contracts/token_holding_amount/{TokenLogic.sol => TokenQueryLogic.sol} (95%) diff --git a/contracts/token_holding_amount/NoderealClient.sol b/contracts/token_holding_amount/NoderealClient.sol index 6df76ce..c1efb6c 100644 --- a/contracts/token_holding_amount/NoderealClient.sol +++ b/contracts/token_holding_amount/NoderealClient.sol @@ -20,6 +20,7 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; import "../libraries/Utils.sol"; + library NoderealClient { function getTokenBalance( string memory url, diff --git a/contracts/token_holding_amount/TokenHoldingAmount.sol b/contracts/token_holding_amount/TokenHoldingAmount.sol index 600e025..c310542 100644 --- a/contracts/token_holding_amount/TokenHoldingAmount.sol +++ b/contracts/token_holding_amount/TokenHoldingAmount.sol @@ -24,7 +24,6 @@ import "../libraries/AssertionLogic.sol"; import "../libraries/Identities.sol"; import "../DynamicAssertion.sol"; import "./Constants.sol"; - abstract contract TokenHoldingAmount is DynamicAssertion { mapping(string => string) internal tokenNames; mapping(string => uint256[]) internal tokenRanges; diff --git a/contracts/token_holding_amount/TokenMapping.sol b/contracts/token_holding_amount/TokenMapping.sol index 432c251..dfce614 100644 --- a/contracts/token_holding_amount/TokenMapping.sol +++ b/contracts/token_holding_amount/TokenMapping.sol @@ -18,7 +18,7 @@ pragma solidity ^0.8.8; -import { TokenLogic } from "./TokenLogic.sol"; +import { TokenQueryLogic } from "./TokenQueryLogic.sol"; import "../libraries/Identities.sol"; // brc20 @@ -70,7 +70,7 @@ import { Usdt } from "./erc20/Usdt.sol"; import { Wbtc } from "./erc20//Wbtc.sol"; import { Cvx } from "./erc20/Cvx.sol"; import { Usdd } from "./erc20/Usdd.sol"; -contract TokenMapping is TokenLogic { +contract TokenMapping is TokenQueryLogic { constructor() { // btcs tokenNames["btcs"] = Btcs.getTokenName(); diff --git a/contracts/token_holding_amount/TokenLogic.sol b/contracts/token_holding_amount/TokenQueryLogic.sol similarity index 95% rename from contracts/token_holding_amount/TokenLogic.sol rename to contracts/token_holding_amount/TokenQueryLogic.sol index e0b098e..df385aa 100644 --- a/contracts/token_holding_amount/TokenLogic.sol +++ b/contracts/token_holding_amount/TokenQueryLogic.sol @@ -23,7 +23,8 @@ import "../libraries/Utils.sol"; import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; import { NoderealClient } from "./NoderealClient.sol"; import { GeniidataClient } from "./GeniidataClient.sol"; -abstract contract TokenLogic is TokenHoldingAmount { + +abstract contract TokenQueryLogic is TokenHoldingAmount { mapping(uint32 => string) internal networkUrls; mapping(uint32 => bool) private queriedNetworks; mapping(string => mapping(uint32 => string)) tokenAddresses; @@ -32,10 +33,10 @@ abstract contract TokenLogic is TokenHoldingAmount { mapping(string => uint32[]) internal tokenNetworks; constructor() { - networkUrls[Web3Networks.Bsc] = "https://bsc-mainnet.nodereal.io/v1/"; // test against mock server => "http://localhost:19527/nodereal_jsonrpc/" + networkUrls[Web3Networks.Bsc] = "https://bsc-mainnet.nodereal.io/v1/"; // test against mock server => "http://localhost:19530/nodereal_jsonrpc/" networkUrls[ Web3Networks.Ethereum - ] = "https://eth-mainnet.nodereal.io/v1/"; // test against mock server => "hhttp://localhost:19527/nodereal_jsonrpc/" + ] = "https://eth-mainnet.nodereal.io/v1/"; // test against mock server => "http://localhost:19530/nodereal_jsonrpc/" networkUrls[ Web3Networks.BitcoinP2tr diff --git a/test/contracts.ts b/test/contracts.ts index 7fd67e2..11a6cf1 100644 --- a/test/contracts.ts +++ b/test/contracts.ts @@ -1,17 +1,27 @@ -import { ethers } from "hardhat" +import { ethers, network } from "hardhat" import { expect } from "chai" // todo: add more tests describe("contracts", () => { it("should return the bytecode of the contracts", async () => { - const A1Contract = await ethers.getContractFactory("A1") - const A6Contract = await ethers.getContractFactory("A6") - const A20Contract = await ethers.getContractFactory("A20") + const TokenMapping = await ethers.getContractFactory("TokenMapping") + const tokenMapping = await TokenMapping.deploy() - expect(A1Contract.bytecode).to.be.ok - expect(A6Contract.bytecode).to.be.ok - expect(A20Contract.bytecode).to.be.ok - console.log("A1 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€πŸš€:", A1Contract.bytecode) - console.log("A6 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A6Contract.bytecode) - console.log("A20 bytecodeπŸš€πŸš€πŸš€πŸš€πŸš€:", A20Contract.bytecode) + const identities = [ + { + identity_type: 4, + value: "0xf7764F15Fd4F695fAD8dDd3e84F5293E6866FEFE", + networks: [7, 8], + }, + ] + + const secrets = [ + "0x23875d191b5cf587d54763ec32be12e64fdb2fe286ae32bd593d461c1d97a5389a1eae28845e3771ba49ed80e20aa4698f7c096156f91d2356f399e0a2e8789f63046fde437cb0ac9ba83e0dd6c1cb676d8411b94e91457870e37d4c8ca627ff04eb7daa1269044c64347bcf2d4619f27affb99fbd74d48fd31a7b4098655312fd69f1473fe3252a07f7080a0c41b5907e008d1456b2fcd73ce61273f131cd0ca5d632ea66c0bb4e8b6518d7cd3aea6300ab2ab995eccaafe73014302e848e023785463d2e5beb9050070f08213606166da439f5f5727b78ab557b41a3863512d23cf216e69d0e48a104354f4641150f84af53a6195a9c5439b7b40786876726a7972d74254b7160d2e484cb5f682eb74e83e94cf4500207bc256b99e5b7f916e0199d522e5ed8802760630e77d60dc7fa543beaffcd92623799ca5eecd7a7a0dde76e781a4ec76dea878fb0e3b67d192d0296ef7841abec0feefa5b5f3cfd73aa9759a1d2dc57b38f9c84ff590a9ecc48dbdb810d697fec159e0d1e124d6151", + ] + + const params = + "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000036574630000000000000000000000000000000000000000000000000000000000" + const tx = await tokenMapping.execute(identities, secrets, params) + + await tx.wait() }) })