From 8089199635ea4734a05749b657d0e0d47acf9d6e Mon Sep 17 00:00:00 2001 From: nikolay Date: Wed, 11 Dec 2024 18:43:41 +0200 Subject: [PATCH 01/14] chore: add initial lz setup Signed-off-by: nikolay --- tools/layer-zero-example/.env.example | 21 + tools/layer-zero-example/.gitignore | 17 + tools/layer-zero-example/README.md | 105 + .../contracts/ERC20Mock.sol | 10 + .../contracts/ERC721Mock.sol | 12 + .../contracts/ExampleOApp.sol | 74 + .../contracts/ExampleOFT.sol | 16 + .../contracts/ExampleOFTAdapter.sol | 13 + .../contracts/ExampleONFT.sol | 17 + .../contracts/ExampleONFTAdapter.sol | 13 + tools/layer-zero-example/hardhat.config.js | 180 + tools/layer-zero-example/package-lock.json | 7831 +++++++++++++++++ tools/layer-zero-example/package.json | 15 + tools/layer-zero-example/test/Tests.js | 384 + tools/layer-zero-example/test/oappTests.js | 81 + .../test/oftAdapterTests.js | 139 + tools/layer-zero-example/test/oftTests.js | 109 + .../test/onftAdapterTests.js | 138 + tools/layer-zero-example/test/onftTests.js | 94 + 19 files changed, 9269 insertions(+) create mode 100644 tools/layer-zero-example/.env.example create mode 100644 tools/layer-zero-example/.gitignore create mode 100644 tools/layer-zero-example/README.md create mode 100644 tools/layer-zero-example/contracts/ERC20Mock.sol create mode 100644 tools/layer-zero-example/contracts/ERC721Mock.sol create mode 100644 tools/layer-zero-example/contracts/ExampleOApp.sol create mode 100644 tools/layer-zero-example/contracts/ExampleOFT.sol create mode 100644 tools/layer-zero-example/contracts/ExampleOFTAdapter.sol create mode 100644 tools/layer-zero-example/contracts/ExampleONFT.sol create mode 100644 tools/layer-zero-example/contracts/ExampleONFTAdapter.sol create mode 100644 tools/layer-zero-example/hardhat.config.js create mode 100644 tools/layer-zero-example/package-lock.json create mode 100644 tools/layer-zero-example/package.json create mode 100644 tools/layer-zero-example/test/Tests.js create mode 100644 tools/layer-zero-example/test/oappTests.js create mode 100644 tools/layer-zero-example/test/oftAdapterTests.js create mode 100644 tools/layer-zero-example/test/oftTests.js create mode 100644 tools/layer-zero-example/test/onftAdapterTests.js create mode 100644 tools/layer-zero-example/test/onftTests.js diff --git a/tools/layer-zero-example/.env.example b/tools/layer-zero-example/.env.example new file mode 100644 index 0000000000..1fe1dc841b --- /dev/null +++ b/tools/layer-zero-example/.env.example @@ -0,0 +1,21 @@ +HEDERA_PK=0x +BSC_PK=0x + +OAPP_HEDERA_CONTRACT=0x +OAPP_BSC_CONTRACT=0x + +OFT_HEDERA_CONTRACT=0x +OFT_BSC_CONTRACT=0x + +ERC20_HEDERA_CONTRACT=0x +ERC20_BSC_CONTRACT=0x +OFT_ADAPTER_HEDERA_CONTRACT=0x +OFT_ADAPTER_BSC_CONTRACT=0x + +ONFT_HEDERA_CONTRACT=0x +ONFT_BSC_CONTRACT=0x + +ERC721_HEDERA_CONTRACT=0x +ERC721_BSC_CONTRACT=0x +ONFT_ADAPTER_HEDERA_CONTRACT=0x +ONFT_ADAPTER_BSC_CONTRACT=0x diff --git a/tools/layer-zero-example/.gitignore b/tools/layer-zero-example/.gitignore new file mode 100644 index 0000000000..e8c12ff4fe --- /dev/null +++ b/tools/layer-zero-example/.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/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md new file mode 100644 index 0000000000..3acb8b5f06 --- /dev/null +++ b/tools/layer-zero-example/README.md @@ -0,0 +1,105 @@ +# Layer Zero examples + +### OApp + +npx hardhat deploy-oapp --network hedera_testnet +npx hardhat deploy-oapp --network bsc_testnet + +npx hardhat set-peer --source --target --network hedera_testnet +npx hardhat set-peer --source --target --network bsc_testnet + +fill the .env + +npx hardhat test --grep "OAppTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "OAppTests @bsc @send" --network bsc_testnet + +wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ + +npx hardhat test --grep "OAppTests @hedera @test" --network hedera_testnet +npx hardhat test --grep "OAppTests @bsc @test" --network bsc_testnet + + +### OFT + +npx hardhat deploy-oft --network hedera_testnet +npx hardhat deploy-oft --network bsc_testnet + +npx hardhat set-peer --source --target --network hedera_testnet +npx hardhat set-peer --source --target --network bsc_testnet + +fill the .env + +npx hardhat test --grep "OFTTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "OFTTests @bsc @send" --network bsc_testnet + +wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ + +npx hardhat test --grep "OFTTests @hedera @test" --network hedera_testnet +npx hardhat test --grep "OFTTests @bsc @test" --network bsc_testnet + +### OFT Adapter + +npx hardhat deploy-erc20 --network hedera_testnet +npx hardhat deploy-erc20 --network bsc_testnet + +npx hardhat deploy-oft-adapter --token --network hedera_testnet +npx hardhat deploy-oft-adapter --token --network bsc_testnet + +npx hardhat set-peer --source --target --network hedera_testnet +npx hardhat set-peer --source --target --network bsc_testnet + +fill the .env + +npx hardhat test --grep "OFTAdapterTests @hedera @fund-and-approve" --network hedera_testnet +npx hardhat test --grep "OFTAdapterTests @bsc @fund-and-approve" --network bsc_testnet + +npx hardhat test --grep "OFTAdapterTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "OFTAdapterTests @bsc @send" --network bsc_testnet + +wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ + +npx hardhat test --grep "OFTAdapterTests @hedera @test" --network hedera_testnet +npx hardhat test --grep "OFTAdapterTests @bsc @test" --network bsc_testnet + +### ONFT + +npx hardhat deploy-onft --network hedera_testnet +npx hardhat deploy-onft --network bsc_testnet + +npx hardhat set-peer --source --target --network hedera_testnet +npx hardhat set-peer --source --target --network bsc_testnet + +fill the .env + +npx hardhat test --grep "ONFTTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "ONFTTests @bsc @send" --network bsc_testnet + +wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ + +npx hardhat test --grep "ONFTTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "ONFTTests @bsc @send" --network bsc_testnet + +### ONFT Adapter + +npx hardhat deploy-erc721 --network hedera_testnet +npx hardhat deploy-erc721 --network bsc_testnet + +npx hardhat deploy-onft-adapter --token --network hedera_testnet +npx hardhat deploy-onft-adapter --token --network bsc_testnet + +npx hardhat set-peer --source --target --network hedera_testnet +npx hardhat set-peer --source --target --network bsc_testnet + +fill the .env + +npx hardhat test --grep "ONFTAdapterTests @hedera @mint" --network hedera_testnet +npx hardhat test --grep "ONFTAdapterTests @bsc @mint" --network bsc_testnet + +npx hardhat test --grep "ONFTAdapterTests @hedera @approve" --network hedera_testnet +npx hardhat test --grep "ONFTAdapterTests @bsc @approve" --network bsc_testnet + +npx hardhat test --grep "ONFTAdapterTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "ONFTAdapterTests @bsc @send" --network bsc_testnet + +npx hardhat test --grep "ONFTAdapterTests @hedera @test" --network hedera_testnet +npx hardhat test --grep "ONFTAdapterTests @bsc @test" --network bsc_testnet diff --git a/tools/layer-zero-example/contracts/ERC20Mock.sol b/tools/layer-zero-example/contracts/ERC20Mock.sol new file mode 100644 index 0000000000..210bb603e6 --- /dev/null +++ b/tools/layer-zero-example/contracts/ERC20Mock.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.22; + +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract ERC20Mock is ERC20 { + constructor() ERC20("ERC20Mock", "E20M") { + _mint(msg.sender, 10000000000000000000); + } +} diff --git a/tools/layer-zero-example/contracts/ERC721Mock.sol b/tools/layer-zero-example/contracts/ERC721Mock.sol new file mode 100644 index 0000000000..030a2901d4 --- /dev/null +++ b/tools/layer-zero-example/contracts/ERC721Mock.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.22; + +import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; + +contract ERC721Mock is ERC721 { + constructor() ERC721("ERC721Mock", "E721M") {} + + function mint(address _to, uint256 _tokenId) external { + _mint(_to, _tokenId); + } +} diff --git a/tools/layer-zero-example/contracts/ExampleOApp.sol b/tools/layer-zero-example/contracts/ExampleOApp.sol new file mode 100644 index 0000000000..2b47d498a6 --- /dev/null +++ b/tools/layer-zero-example/contracts/ExampleOApp.sol @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.22; + +import {OApp, Origin, MessagingFee} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OApp.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; + +contract ExampleOApp is OApp { + constructor(address _endpoint, address _owner) OApp(_endpoint, _owner) Ownable(_owner) {} + + // Some arbitrary data you want to deliver to the destination chain! + string public data; + + /** + * @notice Sends a message from the source to destination chain. + * @param _dstEid Destination chain's endpoint ID. + * @param _message The message to send. + * @param _options Message execution options (e.g., for sending gas to destination). + */ + function send( + uint32 _dstEid, + string memory _message, + bytes calldata _options + ) external payable { + // Encodes the message before invoking _lzSend. + // Replace with whatever data you want to send! + bytes memory _payload = abi.encode(_message); + _lzSend( + _dstEid, + _payload, + _options, + // Fee in native gas and ZRO token. + MessagingFee(msg.value, 0), + // Refund address in case of failed source message. + payable(msg.sender) + ); + } + + /** + * @dev Called when data is received from the protocol. It overrides the equivalent function in the parent contract. + * Protocol messages are defined as packets, comprised of the following parameters. + * @param _origin A struct containing information about where the packet came from. + * @param _guid A global unique identifier for tracking the packet. + * @param payload Encoded message. + */ + function _lzReceive( + Origin calldata _origin, + bytes32 _guid, + bytes calldata payload, + address, // Executor address as specified by the OApp. + bytes calldata // Any extra data or options to trigger on receipt. + ) internal override { + // Decode the payload to get the message + // In this case, type is string, but depends on your encoding! + data = abi.decode(payload, (string)); + } + + /** + * @notice Quotes the gas needed to pay for the full omnichain transaction in native gas or ZRO token. + * @param _dstEid Destination chain's endpoint ID. + * @param _message The message. + * @param _options Message execution options (e.g., for sending gas to destination). + * @param _payInLzToken Whether to return fee in ZRO token. + * @return fee A `MessagingFee` struct containing the calculated gas fee in either the native token or ZRO token. + */ + function quote( + uint32 _dstEid, + string memory _message, + bytes memory _options, + bool _payInLzToken + ) public view returns (MessagingFee memory fee) { + bytes memory payload = abi.encode(_message); + fee = _quote(_dstEid, payload, _options, _payInLzToken); + } +} diff --git a/tools/layer-zero-example/contracts/ExampleOFT.sol b/tools/layer-zero-example/contracts/ExampleOFT.sol new file mode 100644 index 0000000000..d05294482b --- /dev/null +++ b/tools/layer-zero-example/contracts/ExampleOFT.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.22; + +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {OFT} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFT.sol"; + +contract ExampleOFT is OFT { + constructor( + string memory _name, + string memory _symbol, + address _lzEndpoint, + address _delegate + ) OFT(_name, _symbol, _lzEndpoint, _delegate) Ownable(_delegate) { + _mint(msg.sender, 1000000000000000000); + } +} diff --git a/tools/layer-zero-example/contracts/ExampleOFTAdapter.sol b/tools/layer-zero-example/contracts/ExampleOFTAdapter.sol new file mode 100644 index 0000000000..12b9e5b84e --- /dev/null +++ b/tools/layer-zero-example/contracts/ExampleOFTAdapter.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.22; + +import {OFTAdapter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTAdapter.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; + +contract ExampleOFTAdapter is OFTAdapter { + constructor( + address _token, + address _lzEndpoint, + address _owner + ) OFTAdapter(_token, _lzEndpoint, _owner) Ownable(_owner) {} +} diff --git a/tools/layer-zero-example/contracts/ExampleONFT.sol b/tools/layer-zero-example/contracts/ExampleONFT.sol new file mode 100644 index 0000000000..89edfb3dcb --- /dev/null +++ b/tools/layer-zero-example/contracts/ExampleONFT.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.22; + +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {ONFT721} from "@layerzerolabs/onft-evm/contracts/onft721/ONFT721.sol"; + +contract ExampleONFT is ONFT721 { + constructor( + string memory _name, + string memory _symbol, + address _lzEndpoint, + address _delegate, + uint256 tokenId + ) ONFT721(_name, _symbol, _lzEndpoint, _delegate) { + _mint(msg.sender, tokenId); + } +} diff --git a/tools/layer-zero-example/contracts/ExampleONFTAdapter.sol b/tools/layer-zero-example/contracts/ExampleONFTAdapter.sol new file mode 100644 index 0000000000..a52efd2d40 --- /dev/null +++ b/tools/layer-zero-example/contracts/ExampleONFTAdapter.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.22; + +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {ONFT721Adapter} from "@layerzerolabs/onft-evm/contracts/onft721/ONFT721Adapter.sol"; + +contract ExampleONFTAdapter is ONFT721Adapter { + constructor( + address _token, + address _lzEndpoint, + address _owner + ) ONFT721Adapter(_token, _lzEndpoint, _owner) { } +} diff --git a/tools/layer-zero-example/hardhat.config.js b/tools/layer-zero-example/hardhat.config.js new file mode 100644 index 0000000000..3b0eb716c4 --- /dev/null +++ b/tools/layer-zero-example/hardhat.config.js @@ -0,0 +1,180 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +require('dotenv').config(); +require("@nomicfoundation/hardhat-toolbox"); + +module.exports = { + solidity: { + compilers: [ + { + version: '0.8.22', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + ], + }, + defaultNetwork: 'hedera_testnet', + networks: { + hedera_testnet: { + url: 'https://testnet.hashio.io/api', + accounts: [process.env.HEDERA_PK], + chainId: 296, + }, + bsc_testnet: { + url: "https://data-seed-prebsc-1-s1.binance.org:8545", + chainId: 97, + gasPrice: 20000000000, + accounts: [process.env.BSC_PK] + }, + } +}; + +const getEndpointAddress = (network) => { + let ENDPOINT_V2; + + if (network === 'hedera_testnet') { + ENDPOINT_V2 = '0xbD672D1562Dd32C23B563C989d8140122483631d'; + } else if (network === 'bsc_testnet') { + ENDPOINT_V2 = '0x6EDCE65403992e310A62460808c4b910D972f10f'; + } + + return ENDPOINT_V2; +} + +task('deploy-erc20', "Deploy ERC20 token") + .setAction(async (taskArgs, hre) => { + const contractFactory = await ethers.getContractFactory('ERC20Mock'); + const contract = await contractFactory.deploy(); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) ERC20 deployed to: ` + contract.address); + }); + +task('deploy-erc721', "Deploy ERC721 token") + .setAction(async (taskArgs, hre) => { + const contractFactory = await ethers.getContractFactory('ERC721Mock'); + const contract = await contractFactory.deploy(); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) ERC721 deployed to: ` + contract.address); + }); + +task("deploy-oapp", "Deploy OApp contract") + .setAction(async (taskArgs, hre) => { + const ethers = hre.ethers; + const signers = await ethers.getSigners(); + const ENDPOINT_V2 = getEndpointAddress(hre.network.name); + + const contractFactory = await ethers.getContractFactory('ExampleOApp'); + const contract = await contractFactory.deploy(ENDPOINT_V2, signers[0].address); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) ExampleOApp deployed to: ` + contract.address); + }); + +task("deploy-oft", "Deploy OFT contract") + .setAction(async (taskArgs, hre) => { + const ethers = hre.ethers; + const signers = await ethers.getSigners(); + const ENDPOINT_V2 = getEndpointAddress(hre.network.name) + + const contractFactory = await ethers.getContractFactory('ExampleOFT'); + const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) ExampleOFT deployed to: ` + contract.address); + }); + +task("deploy-oft-adapter", "Deploy OFT adapter contract") + .addParam('token', 'Token address') + .setAction(async (taskArgs, hre) => { + const ethers = hre.ethers; + const signers = await ethers.getSigners(); + const ENDPOINT_V2 = getEndpointAddress(hre.network.name) + + const contractFactory = await ethers.getContractFactory('ExampleOFTAdapter'); + const contract = await contractFactory.deploy(taskArgs.token, ENDPOINT_V2, signers[0].address); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) ExampleOFTAdapter for token ${taskArgs.token} deployed to: ` + contract.address); + }); + +task("deploy-onft", "Deploy OFT contract") + .setAction(async (taskArgs, hre) => { + const ethers = hre.ethers; + const signers = await ethers.getSigners(); + const ENDPOINT_V2 = getEndpointAddress(hre.network.name); + + let tokenId; + if (hre.network.name === 'hedera_testnet') { + tokenId = 1; + } else if (hre.network.name === 'bsc_testnet') { + tokenId = 2; + } + + const contractFactory = await ethers.getContractFactory('ExampleONFT'); + const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address, tokenId); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) ExampleONFT deployed to: ` + contract.address); + }); + +task("deploy-onft-adapter", "Deploy OFT contract") + .addParam('token', 'Token address') + .setAction(async (taskArgs, hre) => { + const ethers = hre.ethers; + const signers = await ethers.getSigners(); + const ENDPOINT_V2 = getEndpointAddress(hre.network.name) + + const contractFactory = await ethers.getContractFactory('ExampleONFTAdapter'); + const contract = await contractFactory.deploy(taskArgs.token, ENDPOINT_V2, signers[0].address); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) ExampleONFTAdapter deployed to: ` + contract.address); + }); + +task("set-peer", "Set peer") + .addParam('source', 'Source contract address') + .addParam('target', 'Target contract address') + .setAction(async (taskArgs, hre) => { + const ethers = hre.ethers; + + let EID; + if (hre.network.name === 'hedera_testnet') { + EID = 40102; + } else if (hre.network.name === 'bsc_testnet') { + EID = 40285; + } + + const contract = await ethers.getContractAt('ExampleOApp', taskArgs.source); + const tx = await contract.setPeer(EID, '0x' + taskArgs.target.substring(2, 42).padStart(64, 0)); + const receipt = await tx.wait(); + + if (!receipt.status) { + process.exit('Execution of setPeer failed. Tx hash: ' + tx.hash); + } + + console.log(`(${hre.network.name}) Peer for network with EID ${EID} was successfully set`); + }); diff --git a/tools/layer-zero-example/package-lock.json b/tools/layer-zero-example/package-lock.json new file mode 100644 index 0000000000..90055ac77d --- /dev/null +++ b/tools/layer-zero-example/package-lock.json @@ -0,0 +1,7831 @@ +{ + "name": "layer-zero-example", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "layer-zero-example", + "dependencies": { + "@layerzerolabs/lz-evm-oapp-v2": "^3.0.21", + "@layerzerolabs/lz-v2-utilities": "^3.0.22", + "@layerzerolabs/oapp-evm": "^0.3.0", + "@layerzerolabs/onft-evm": "^0.1.0", + "dotenv": "^16.4.7" + }, + "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^2.0.0", + "hardhat": "^2.12.4" + } + }, + "node_modules/@axelar-network/axelar-gmp-sdk-solidity": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/@axelar-network/axelar-gmp-sdk-solidity/-/axelar-gmp-sdk-solidity-5.10.0.tgz", + "integrity": "sha512-s8SImALvYB+5AeiT3tbfWNBI2Mhqw1x91i/zM3DNpVUCnAR2HKtsB9T84KnUn/OJjOVgb4h0lv7q9smeYniRPw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@chainlink/contracts-ccip": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/@chainlink/contracts-ccip/-/contracts-ccip-0.7.6.tgz", + "integrity": "sha512-yNbCBFpLs3R+ALymto9dQYKz3vatnjqYGu1pnMD0i2fHEMthiXe0+otaNCGNht6n8k7ruNaA0DNpz3F+2jHQXw==", + "license": "BUSL-1.1", + "peer": true, + "dependencies": { + "@eth-optimism/contracts": "^0.5.21", + "@openzeppelin/contracts": "~4.3.3", + "@openzeppelin/contracts-upgradeable-4.7.3": "npm:@openzeppelin/contracts-upgradeable@v4.7.3", + "@openzeppelin/contracts-v0.7": "npm:@openzeppelin/contracts@v3.4.2" + } + }, + "node_modules/@chainlink/contracts-ccip/node_modules/@eth-optimism/contracts": { + "version": "0.5.40", + "resolved": "https://registry.npmjs.org/@eth-optimism/contracts/-/contracts-0.5.40.tgz", + "integrity": "sha512-MrzV0nvsymfO/fursTB7m/KunkPsCndltVgfdHaT1Aj5Vi6R/doKIGGkOofHX+8B6VMZpuZosKCMQ5lQuqjt8w==", + "license": "MIT", + "peer": true, + "dependencies": { + "@eth-optimism/core-utils": "0.12.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0" + }, + "peerDependencies": { + "ethers": "^5" + } + }, + "node_modules/@chainlink/contracts-ccip/node_modules/@openzeppelin/contracts": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.3.3.tgz", + "integrity": "sha512-tDBopO1c98Yk7Cv/PZlHqrvtVjlgK5R4J6jxLwoO7qxK4xqOiZG+zSkIvGFpPZ0ikc3QOED3plgdqjgNTnBc7g==", + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@eth-optimism/contracts": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eth-optimism/contracts/-/contracts-0.6.0.tgz", + "integrity": "sha512-vQ04wfG9kMf1Fwy3FEMqH2QZbgS0gldKhcBeBUPfO8zu68L61VI97UDXmsMQXzTsEAxK8HnokW3/gosl4/NW3w==", + "license": "MIT", + "peer": true, + "dependencies": { + "@eth-optimism/core-utils": "0.12.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0" + }, + "peerDependencies": { + "ethers": "^5" + } + }, + "node_modules/@eth-optimism/core-utils": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.12.0.tgz", + "integrity": "sha512-qW+7LZYCz7i8dRa7SRlUKIo1VBU8lvN0HeXCxJR+z+xtMzMQpPds20XJNCMclszxYQHkXY00fOT6GvFw9ZL6nw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/address": "^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/keccak256": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/providers": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bufio": "^1.0.7", + "chai": "^4.3.4" + } + }, + "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, + "license": "MPL-2.0", + "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, + "license": "MPL-2.0", + "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/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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/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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT" + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@layerzerolabs/lz-evm-messagelib-v2": { + "version": "3.0.27", + "resolved": "https://registry.npmjs.org/@layerzerolabs/lz-evm-messagelib-v2/-/lz-evm-messagelib-v2-3.0.27.tgz", + "integrity": "sha512-cUj8/aBqklvi0B2rKtBcpbJAhELcnJVJ9Le905NKRLwzfsajEdyTWC+uWNdVSU7oKSB970O0c2m87jPXdEj71g==", + "license": "LZBL-1.2", + "peer": true, + "peerDependencies": { + "@arbitrum/nitro-contracts": "^1.1.0", + "@axelar-network/axelar-gmp-sdk-solidity": "^5.6.4", + "@chainlink/contracts-ccip": "^0.7.6", + "@eth-optimism/contracts": "^0.6.0", + "@layerzerolabs/lz-evm-protocol-v2": "^3.0.27", + "@layerzerolabs/lz-evm-v1-0.7": "^3.0.27", + "@openzeppelin/contracts": "^4.8.1 || ^5.0.0", + "@openzeppelin/contracts-upgradeable": "^4.8.1 || ^5.0.0", + "hardhat-deploy": "^0.12.4", + "solidity-bytes-utils": "^0.8.0" + }, + "peerDependenciesMeta": { + "@arbitrum/nitro-contracts": { + "optional": true + } + } + }, + "node_modules/@layerzerolabs/lz-evm-oapp-v2": { + "version": "3.0.27", + "resolved": "https://registry.npmjs.org/@layerzerolabs/lz-evm-oapp-v2/-/lz-evm-oapp-v2-3.0.27.tgz", + "integrity": "sha512-Ob27UmueD4Lgec/riCH5q15eJKEj/kJkNR8+gW0+5Y6d273UT6upILzzRpE51qLFvSVBi0iuOH6xyXulIRqGIw==", + "license": "MIT", + "peerDependencies": { + "@layerzerolabs/lz-evm-messagelib-v2": "^3.0.27", + "@layerzerolabs/lz-evm-protocol-v2": "^3.0.27", + "@layerzerolabs/lz-evm-v1-0.7": "^3.0.27", + "@openzeppelin/contracts": "^4.8.1 || ^5.0.0", + "@openzeppelin/contracts-upgradeable": "^4.8.1 || ^5.0.0", + "hardhat-deploy": "^0.12.4", + "solidity-bytes-utils": "^0.8.0" + } + }, + "node_modules/@layerzerolabs/lz-evm-protocol-v2": { + "version": "3.0.27", + "resolved": "https://registry.npmjs.org/@layerzerolabs/lz-evm-protocol-v2/-/lz-evm-protocol-v2-3.0.27.tgz", + "integrity": "sha512-TnKjq7oiDPusVxJ5F66Mak7yoDk2T3JKOJxI9yfSisLBiWA6W/0jrE4iShHYt5c9kx6WgSdHpDwLJ3zmeimdCQ==", + "license": "LZBL-1.2", + "peer": true, + "peerDependencies": { + "@openzeppelin/contracts": "^4.8.1 || ^5.0.0", + "@openzeppelin/contracts-upgradeable": "^4.8.1 || ^5.0.0", + "hardhat-deploy": "^0.12.4", + "solidity-bytes-utils": "^0.8.0" + } + }, + "node_modules/@layerzerolabs/lz-evm-v1-0.7": { + "version": "3.0.27", + "resolved": "https://registry.npmjs.org/@layerzerolabs/lz-evm-v1-0.7/-/lz-evm-v1-0.7-3.0.27.tgz", + "integrity": "sha512-cF6NnXkWGXM76bpPBZViSyi9kDsWI43mFByQHnAq65u+Js6zI63gZbwCRLJ3IdrSWbZZwC1T3m6NnDLPgX3ipQ==", + "license": "BUSL-1.1", + "peer": true, + "peerDependencies": { + "@openzeppelin/contracts": "3.4.2-solc-0.7 || ^3.4.2 || ^4.0.0 || ^5.0.0", + "@openzeppelin/contracts-upgradeable": "3.4.2-solc-0.7 || ^3.4.2 || ^4.0.0 || ^5.0.0", + "hardhat-deploy": "^0.12.4" + } + }, + "node_modules/@layerzerolabs/lz-v2-utilities": { + "version": "3.0.27", + "resolved": "https://registry.npmjs.org/@layerzerolabs/lz-v2-utilities/-/lz-v2-utilities-3.0.27.tgz", + "integrity": "sha512-Gv7lSuFb5BMWpdX5YA9sxTDCJCXuNlimzFJrMn5++pHCLpX9T03QwNqNjUoU26gJUmjU7nESkL10uB6PZQbYAw==", + "license": "BUSL-1.1", + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/solidity": "^5.7.0", + "bs58": "^5.0.0", + "tiny-invariant": "^1.3.1" + } + }, + "node_modules/@layerzerolabs/oapp-evm": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@layerzerolabs/oapp-evm/-/oapp-evm-0.3.0.tgz", + "integrity": "sha512-eP0zqNx72TQE11exObw7eYt5uwGuUv0kKtatYO/+dZuEjfhUdR9H6dj1CIbn/ozeKT56rZwj9LtSkDGl7FnqVw==", + "license": "MIT", + "dependencies": { + "ethers": "^5.7.2" + }, + "peerDependencies": { + "@layerzerolabs/lz-evm-messagelib-v2": "^3.0.12", + "@layerzerolabs/lz-evm-protocol-v2": "^3.0.12", + "@layerzerolabs/lz-evm-v1-0.7": "^3.0.12", + "@openzeppelin/contracts": "^4.8.1 || ^5.0.0", + "@openzeppelin/contracts-upgradeable": "^4.8.1 || ^5.0.0" + } + }, + "node_modules/@layerzerolabs/onft-evm": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@layerzerolabs/onft-evm/-/onft-evm-0.1.0.tgz", + "integrity": "sha512-hopKC1pw/5Bph3h+sRf1kLkCXs2j1Z/2xRU8Zwq3GmGp5R+MKjVc4eUMy4PvqWXBPEkUAapPoMehuV+q+gTa1g==", + "license": "MIT", + "peerDependencies": { + "@layerzerolabs/lz-evm-messagelib-v2": "^3.0.12", + "@layerzerolabs/lz-evm-protocol-v2": "^3.0.12", + "@layerzerolabs/lz-evm-v1-0.7": "^3.0.12", + "@openzeppelin/contracts": "^4.8.1 || ^5.0.0", + "@openzeppelin/contracts-upgradeable": "^4.8.1 || ^5.0.0" + } + }, + "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, + "license": "ISC", + "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, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/bn.js": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "dev": true, + "license": "MIT" + }, + "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, + "license": "MPL-2.0", + "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.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves/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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz", + "integrity": "sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^14.21.3 || >=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/" + } + ], + "license": "MIT" + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nomicfoundation/edr": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.6.5.tgz", + "integrity": "sha512-tAqMslLP+/2b2sZP4qe9AuGxG3OkQ5gGgHE4isUuq6dUVjwCRPFhAOhpdFl+OjY5P3yEv3hmq9HjUGRa2VNjng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nomicfoundation/edr-darwin-arm64": "0.6.5", + "@nomicfoundation/edr-darwin-x64": "0.6.5", + "@nomicfoundation/edr-linux-arm64-gnu": "0.6.5", + "@nomicfoundation/edr-linux-arm64-musl": "0.6.5", + "@nomicfoundation/edr-linux-x64-gnu": "0.6.5", + "@nomicfoundation/edr-linux-x64-musl": "0.6.5", + "@nomicfoundation/edr-win32-x64-msvc": "0.6.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-darwin-arm64": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.6.5.tgz", + "integrity": "sha512-A9zCCbbNxBpLgjS1kEJSpqxIvGGAX4cYbpDYCU2f3jVqOwaZ/NU761y1SvuCRVpOwhoCXqByN9b7HPpHi0L4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-darwin-x64": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.6.5.tgz", + "integrity": "sha512-x3zBY/v3R0modR5CzlL6qMfFMdgwd6oHrWpTkuuXnPFOX8SU31qq87/230f4szM+ukGK8Hi+mNq7Ro2VF4Fj+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-arm64-gnu": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.6.5.tgz", + "integrity": "sha512-HGpB8f1h8ogqPHTyUpyPRKZxUk2lu061g97dOQ/W4CxevI0s/qiw5DB3U3smLvSnBHKOzYS1jkxlMeGN01ky7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-arm64-musl": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.6.5.tgz", + "integrity": "sha512-ESvJM5Y9XC03fZg9KaQg3Hl+mbx7dsSkTIAndoJS7X2SyakpL9KZpOSYrDk135o8s9P9lYJdPOyiq+Sh+XoCbQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-x64-gnu": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.6.5.tgz", + "integrity": "sha512-HCM1usyAR1Ew6RYf5AkMYGvHBy64cPA5NMbaeY72r0mpKaH3txiMyydcHibByOGdQ8iFLWpyUdpl1egotw+Tgg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-x64-musl": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.6.5.tgz", + "integrity": "sha512-nB2uFRyczhAvWUH7NjCsIO6rHnQrof3xcCe6Mpmnzfl2PYcGyxN7iO4ZMmRcQS7R1Y670VH6+8ZBiRn8k43m7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-win32-x64-msvc": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.6.5.tgz", + "integrity": "sha512-B9QD/4DSSCFtWicO8A3BrsnitO1FPv7axB62wq5Q+qeJ50yJlTmyeGY3cw62gWItdvy2mh3fRM6L1LpnHiB77A==", + "dev": true, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MPL-2.0", + "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, + "license": "MPL-2.0", + "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, + "license": "MPL-2.0", + "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": "1.0.6", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-1.0.6.tgz", + "integrity": "sha512-f5ZMNmabZeZegEfuxn/0kW+mm7+yV7VNDxLpMOMGXWFJ2l/Ct3QShujzDRF9cOkK9Ui/hbDeOWGZqyQALDXVCQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@types/chai-as-promised": "^7.1.3", + "chai-as-promised": "^7.1.1", + "deep-eql": "^4.0.1", + "ordinal": "^1.0.3" + }, + "peerDependencies": { + "@nomiclabs/hardhat-ethers": "^2.0.0", + "chai": "^4.2.0", + "ethers": "^5.0.0", + "hardhat": "^2.9.4" + } + }, + "node_modules/@nomicfoundation/hardhat-network-helpers": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.12.tgz", + "integrity": "sha512-xTNQNI/9xkHvjmCJnJOTyqDSl8uq1rKb2WOVmixQxFtRd7Oa3ecO8zM0cyC2YmOK+jHB9WPZ+F/ijkHg1CoORA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ethereumjs-util": "^7.1.4" + }, + "peerDependencies": { + "hardhat": "^2.9.5" + } + }, + "node_modules/@nomicfoundation/hardhat-toolbox": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.2.tgz", + "integrity": "sha512-vnN1AzxbvpSx9pfdRHbUzTRIXpMLPXnUlkW855VaDk6N1pwRaQ2gNzEmFAABk4lWf11E00PKwFd/q27HuwYrYg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@ethersproject/abi": "^5.4.7", + "@ethersproject/providers": "^5.4.7", + "@nomicfoundation/hardhat-chai-matchers": "^1.0.0", + "@nomicfoundation/hardhat-network-helpers": "^1.0.0", + "@nomiclabs/hardhat-ethers": "^2.0.0", + "@nomiclabs/hardhat-etherscan": "^3.0.0", + "@typechain/ethers-v5": "^10.1.0", + "@typechain/hardhat": "^6.1.2", + "@types/chai": "^4.2.0", + "@types/mocha": ">=9.1.0", + "@types/node": ">=12.0.0", + "chai": "^4.2.0", + "ethers": "^5.4.7", + "hardhat": "^2.11.0", + "hardhat-gas-reporter": "^1.0.8", + "solidity-coverage": "^0.8.1", + "ts-node": ">=8.0.0", + "typechain": "^8.1.0", + "typescript": ">=4.5.0" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.2.tgz", + "integrity": "sha512-q4n32/FNKIhQ3zQGGw5CvPF6GTvDCpYwIf7bEY/dZTZbgfDsHyjJwURxUJf3VQuuJj+fDIFl4+KkBVbw4Ef6jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + }, + "optionalDependencies": { + "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.2", + "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.2", + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.2" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-darwin-arm64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.2.tgz", + "integrity": "sha512-JaqcWPDZENCvm++lFFGjrDd8mxtf+CtLd2MiXvMNTBD33dContTZ9TWETwNFwg7JTJT5Q9HEecH7FA+HTSsIUw==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-darwin-x64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.2.tgz", + "integrity": "sha512-fZNmVztrSXC03e9RONBT+CiksSeYcxI1wlzqyr0L7hsQlK1fzV+f04g2JtQ1c/Fe74ZwdV6aQBdd6Uwl1052sw==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.2.tgz", + "integrity": "sha512-3d54oc+9ZVBuB6nbp8wHylk4xh0N0Gc+bk+/uJae+rUgbOBwQSfuGIbAZt1wBXs5REkSmynEGcqx6DutoK0tPA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-musl": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.2.tgz", + "integrity": "sha512-iDJfR2qf55vgsg7BtJa7iPiFAsYf2d0Tv/0B+vhtnI16+wfQeTbP7teookbGvAo0eJo7aLLm0xfS/GTkvHIucA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-gnu": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.2.tgz", + "integrity": "sha512-9dlHMAt5/2cpWyuJ9fQNOUXFB/vgSFORg1jpjX1Mh9hJ/MfZXlDdHQ+DpFCs32Zk5pxRBb07yGvSHk9/fezL+g==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-musl": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.2.tgz", + "integrity": "sha512-GzzVeeJob3lfrSlDKQw2bRJ8rBf6mEYaWY+gW0JnTDHINA0s2gPR4km5RLIj1xeZZOYz4zRw+AEeYgLRqB2NXg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-win32-x64-msvc": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.2.tgz", + "integrity": "sha512-Fdjli4DCcFHb4Zgsz0uEJXZ2K7VEO+w5KVv7HmT7WO10iODdU9csC2az4jrhEsRtiR9Gfd74FlG0NYlw1BMdyA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomiclabs/hardhat-ethers": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz", + "integrity": "sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg==", + "dev": true, + "license": "MIT", + "peer": true, + "peerDependencies": { + "ethers": "^5.0.0", + "hardhat": "^2.0.0" + } + }, + "node_modules/@nomiclabs/hardhat-etherscan": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.8.tgz", + "integrity": "sha512-v5F6IzQhrsjHh6kQz4uNrym49brK9K5bYCq2zQZ729RYRaifI9hHbtmK+KkIVevfhut7huQFEQ77JLRMAzWYjQ==", + "deprecated": "The @nomiclabs/hardhat-etherscan package is deprecated, please use @nomicfoundation/hardhat-verify instead", + "dev": true, + "license": "MIT", + "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", + "fs-extra": "^7.0.1", + "lodash": "^4.17.11", + "semver": "^6.3.0", + "table": "^6.8.0", + "undici": "^5.14.0" + }, + "peerDependencies": { + "hardhat": "^2.0.4" + } + }, + "node_modules/@openzeppelin/contracts": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.1.0.tgz", + "integrity": "sha512-p1ULhl7BXzjjbha5aqst+QMLY+4/LCWADXOCsmLHRM77AqiPjnd9vvUN9sosUfhL9JGKpZ0TjEGxgvnizmWGSA==", + "license": "MIT", + "peer": true + }, + "node_modules/@openzeppelin/contracts-upgradeable": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-5.1.0.tgz", + "integrity": "sha512-AIElwP5Ck+cslNE+Hkemf5SxjJoF4wBvvjxc27Rp+9jaPs/CLIaUBMYe1FNzhdiN0cYuwGRmYaRHmmntuiju4Q==", + "license": "MIT", + "peer": true, + "peerDependencies": { + "@openzeppelin/contracts": "5.1.0" + } + }, + "node_modules/@openzeppelin/contracts-upgradeable-4.7.3": { + "name": "@openzeppelin/contracts-upgradeable", + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz", + "integrity": "sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==", + "license": "MIT", + "peer": true + }, + "node_modules/@openzeppelin/contracts-v0.7": { + "name": "@openzeppelin/contracts", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-3.4.2.tgz", + "integrity": "sha512-z0zMCjyhhp4y7XKAcDAi3Vgms4T2PstwBdahiO0+9NaGICQKjynK3wduSRplTgk4LXmoO1yfDGO5RbjKYxtuxA==", + "license": "MIT", + "peer": true + }, + "node_modules/@scure/base": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32/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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39/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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "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, + "license": "BSD-3-Clause", + "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/hub": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "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, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "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, + "license": "BSD-3-Clause", + "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/tracing": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", + "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", + "dev": true, + "license": "MIT", + "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/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", + "dev": true, + "license": "BSD-3-Clause", + "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, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true + }, + "node_modules/@typechain/ethers-v5": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-10.2.1.tgz", + "integrity": "sha512-n3tQmCZjRE6IU4h6lqUGiQ1j866n5MTCBJreNEHHVWXa2u9GJTaeYyU1/k+1qLutkyw+sS6VAN+AbeiTqsxd/A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "lodash": "^4.17.15", + "ts-essentials": "^7.0.1" + }, + "peerDependencies": { + "@ethersproject/abi": "^5.0.0", + "@ethersproject/providers": "^5.0.0", + "ethers": "^5.1.3", + "typechain": "^8.1.1", + "typescript": ">=4.3.0" + } + }, + "node_modules/@typechain/hardhat": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@typechain/hardhat/-/hardhat-6.1.6.tgz", + "integrity": "sha512-BiVnegSs+ZHVymyidtK472syodx1sXYlYJJixZfRstHVGYTi8V1O7QG4nsjyb0PC/LORcq7sfBUcHto1y6UgJA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fs-extra": "^9.1.0" + }, + "peerDependencies": { + "@ethersproject/abi": "^5.4.7", + "@ethersproject/providers": "^5.4.7", + "@typechain/ethers-v5": "^10.2.1", + "ethers": "^5.4.7", + "hardhat": "^2.9.9", + "typechain": "^8.1.1" + } + }, + "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, + "license": "MIT", + "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/@typechain/hardhat/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, + "license": "MIT", + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@typechain/hardhat/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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@types/bn.js": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.6.tgz", + "integrity": "sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/chai": { + "version": "4.3.20", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", + "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", + "dev": true, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT" + }, + "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, + "license": "MIT", + "peer": true + }, + "node_modules/@types/mocha": { + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/node": { + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true + }, + "node_modules/@types/qs": { + "version": "6.9.17", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.17.tgz", + "integrity": "sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "ISC", + "peer": true + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "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, + "license": "MIT", + "engines": { + "node": ">=0.3.0" + } + }, + "node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "license": "MIT" + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "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, + "license": "BSD-3-Clause OR MIT", + "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, + "license": "ISC", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "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, + "license": "BSD-3-Clause", + "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==", + "license": "ISC", + "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, + "license": "MIT", + "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, + "license": "Python-2.0" + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "ISC", + "peer": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "license": "MIT", + "peer": true, + "dependencies": { + "follow-redirects": "^1.14.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, + "license": "MIT" + }, + "node_modules/base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==", + "license": "MIT" + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "license": "MIT" + }, + "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==", + "license": "MIT", + "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, + "license": "MIT" + }, + "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==", + "license": "MIT" + }, + "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, + "license": "MIT", + "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/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, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/boxen/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, + "license": "MIT", + "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/boxen/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, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/boxen/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, + "license": "MIT" + }, + "node_modules/boxen/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, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/boxen/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, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "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, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "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==", + "license": "MIT", + "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==", + "license": "MIT" + }, + "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, + "license": "ISC" + }, + "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, + "license": "MIT", + "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": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "license": "MIT", + "dependencies": { + "base-x": "^4.0.0" + } + }, + "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, + "license": "MIT", + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/bs58check/node_modules/base-x": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", + "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bs58check/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, + "license": "MIT", + "dependencies": { + "base-x": "^3.0.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, + "license": "MIT" + }, + "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, + "license": "MIT" + }, + "node_modules/bufio": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bufio/-/bufio-1.2.2.tgz", + "integrity": "sha512-sTsA0ka7sjge/bGUfjk00O/8kNfyeAvJjXXeyvgbXefIrf5GTp99W71qfmCP6FGHWbr4A0IjjM7dFj6bHXVMlw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "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, + "license": "Apache-2.0", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=12.19" + } + }, + "node_modules/chai": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "license": "MIT", + "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.1.0" + }, + "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, + "license": "WTFPL", + "peer": true, + "dependencies": { + "check-error": "^1.0.2" + }, + "peerDependencies": { + "chai": ">= 2.1.2 < 6" + } + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "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, + "license": "BSD-3-Clause", + "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==", + "license": "MIT", + "peer": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "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, + "license": "MIT" + }, + "node_modules/cipher-base": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.6.tgz", + "integrity": "sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "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, + "license": "MIT", + "peer": 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, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT" + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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/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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "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, + "license": "MIT", + "peer": 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" + ], + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "BSD-3-Clause", + "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.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "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, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-eql": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "license": "BSD-3-Clause", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/ds-test": { + "version": "1.0.0", + "resolved": "git+ssh://git@github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", + "license": "GPL-3.0", + "peer": true + }, + "node_modules/dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "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==", + "license": "MIT", + "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.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "license": "MIT" + }, + "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, + "license": "MIT" + }, + "node_modules/encode-utf8": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz", + "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==", + "license": "MIT", + "peer": 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==", + "license": "MIT", + "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, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "peer": true, + "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==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, + "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, + "license": "BSD-2-Clause", + "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, + "license": "BSD-2-Clause", + "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, + "license": "BSD-2-Clause", + "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, + "license": "MIT", + "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/" + } + ], + "license": "MIT", + "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/" + } + ], + "license": "MIT", + "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/" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "~1.2.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/axios": { + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^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, + "license": "MIT", + "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/ethereum-bloom-filters": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz", + "integrity": "sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "^1.4.0" + } + }, + "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, + "license": "MIT", + "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==", + "deprecated": "This library has been deprecated and usage is discouraged.", + "dev": true, + "license": "MIT", + "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, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ethereumjs-abi/node_modules/bn.js": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "dev": true, + "license": "MIT" + }, + "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, + "license": "MPL-2.0", + "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, + "license": "MPL-2.0", + "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": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "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/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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true + }, + "node_modules/fast-uri": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", + "dev": true, + "license": "BSD-3-Clause", + "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, + "license": "ISC", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "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, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/fmix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fmix/-/fmix-0.1.0.tgz", + "integrity": "sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w==", + "license": "MIT", + "peer": true, + "dependencies": { + "imul": "^1.0.0" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forge-std": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/forge-std/-/forge-std-1.1.2.tgz", + "integrity": "sha512-Wfb0iAS9PcfjMKtGpWQw9mXzJxrWD62kJCUqqLcyuI0+VRtJ3j20XembjF3kS20qELYdXft1vD/SPFVWVKMFOw==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "license": "MIT", + "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, + "license": "MIT" + }, + "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, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "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, + "license": "MIT", + "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, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "ISC", + "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==", + "license": "MIT", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.5.tgz", + "integrity": "sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==", + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2" + }, + "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, + "license": "MIT", + "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, + "license": "ISC", + "peer": true, + "dependencies": { + "chalk": "^2.4.2", + "node-emoji": "^1.10.0" + }, + "bin": { + "testrpc-sc": "index.js" + } + }, + "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, + "license": "ISC", + "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/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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/globby/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, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/globby/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globby/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, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "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==", + "license": "ISC" + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "license": "MIT", + "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, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hardhat": { + "version": "2.22.17", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.22.17.tgz", + "integrity": "sha512-tDlI475ccz4d/dajnADUTRc1OJ3H8fpP9sWhXhBPpYsQOg8JHq5xrDimo53UhWPl7KJmAeDCm1bFG74xvpGRpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", + "@nomicfoundation/edr": "^0.6.5", + "@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", + "chokidar": "^4.0.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": "^5.0.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "json-stream-stringify": "^3.1.4", + "keccak": "^3.0.2", + "lodash": "^4.17.11", + "mnemonist": "^0.38.0", + "mocha": "^10.0.0", + "p-map": "^4.0.0", + "picocolors": "^1.1.0", + "raw-body": "^2.4.1", + "resolve": "1.17.0", + "semver": "^6.3.0", + "solc": "0.8.26", + "source-map-support": "^0.5.13", + "stacktrace-parser": "^0.1.10", + "tinyglobby": "^0.2.6", + "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-deploy": { + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.12.4.tgz", + "integrity": "sha512-bYO8DIyeGxZWlhnMoCBon9HNZb6ji0jQn7ngP1t5UmGhC8rQYhji7B73qETMOFhzt5ECZPr+U52duj3nubsqdQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^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/contracts": "^5.7.0", + "@ethersproject/providers": "^5.7.2", + "@ethersproject/solidity": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wallet": "^5.7.0", + "@types/qs": "^6.9.7", + "axios": "^0.21.1", + "chalk": "^4.1.2", + "chokidar": "^3.5.2", + "debug": "^4.3.2", + "enquirer": "^2.3.6", + "ethers": "^5.7.0", + "form-data": "^4.0.0", + "fs-extra": "^10.0.0", + "match-all": "^1.2.6", + "murmur-128": "^0.2.1", + "qs": "^6.9.4", + "zksync-ethers": "^5.0.0" + } + }, + "node_modules/hardhat-deploy/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==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/hardhat-deploy/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/hardhat-deploy/node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "license": "MIT", + "peer": 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/hardhat-deploy/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==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/hardhat-deploy/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==", + "license": "MIT", + "peer": true + }, + "node_modules/hardhat-deploy/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==", + "license": "MIT", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/hardhat-deploy/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==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat-deploy/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/hardhat-deploy/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "license": "MIT", + "peer": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/hardhat-deploy/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==", + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat-deploy/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "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, + "license": "MIT", + "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/" + } + ], + "license": "MIT" + }, + "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/" + } + ], + "license": "MIT", + "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/" + } + ], + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.2.0", + "@scure/base": "~1.1.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, + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.2.0", + "@noble/secp256k1": "1.7.1", + "@scure/bip32": "1.1.5", + "@scure/bip39": "1.1.1" + } + }, + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "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==", + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/immutable": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", + "dev": true, + "license": "MIT" + }, + "node_modules/imul": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/imul/-/imul-1.0.1.tgz", + "integrity": "sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "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, + "license": "MIT", + "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, + "license": "ISC", + "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==", + "license": "ISC" + }, + "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, + "license": "ISC", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "ISC", + "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==", + "license": "MIT" + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true + }, + "node_modules/json-stream-stringify": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/json-stream-stringify/-/json-stream-stringify-3.1.6.tgz", + "integrity": "sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=7.10.1" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "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, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "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/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "license": "MIT", + "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, + "license": "MIT" + }, + "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, + "license": "ISC", + "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, + "license": "MIT", + "peer": true + }, + "node_modules/match-all": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/match-all/-/match-all-1.2.6.tgz", + "integrity": "sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "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==", + "license": "ISC" + }, + "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==", + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "dependencies": { + "obliterator": "^2.0.0" + } + }, + "node_modules/mocha": { + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.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.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/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, + "license": "MIT", + "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/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "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, + "license": "MIT", + "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.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/murmur-128": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/murmur-128/-/murmur-128-0.2.1.tgz", + "integrity": "sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg==", + "license": "MIT", + "peer": true, + "dependencies": { + "encode-utf8": "^1.0.2", + "fmix": "^0.1.0", + "imul": "^1.0.0" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT" + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "lodash": "^4.17.21" + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "dev": true, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "ISC", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "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, + "license": "MIT" + }, + "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, + "license": "ISC", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "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, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "peer": 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, + "license": "MIT" + }, + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "asap": "~2.0.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, + "license": "MIT", + "peer": true + }, + "node_modules/qs": { + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", + "license": "BSD-3-Clause", + "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" + } + ], + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/recursive-readdir/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, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/recursive-readdir/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, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": 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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "license": "MIT", + "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, + "license": "MPL-2.0", + "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" + } + ], + "license": "MIT", + "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" + } + ], + "license": "MIT" + }, + "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, + "license": "MIT" + }, + "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, + "license": "BSD-3-Clause", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/sc-istanbul/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, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "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, + "license": "ISC", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "BSD-2-Clause", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/sc-istanbul/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, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT" + }, + "node_modules/secp256k1": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.4.tgz", + "integrity": "sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.7", + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/secp256k1/node_modules/bn.js": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "dev": true, + "license": "MIT" + }, + "node_modules/secp256k1/node_modules/elliptic": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", + "dev": true, + "license": "MIT", + "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/secp256k1/node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "dev": true, + "license": "MIT" + }, + "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, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "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==", + "license": "MIT", + "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, + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true, + "license": "ISC" + }, + "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, + "license": "(MIT AND BSD-3-Clause)", + "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, + "license": "BSD-3-Clause", + "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, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/shelljs/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, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/shelljs/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/shelljs/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, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "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==", + "license": "MIT", + "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/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "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, + "license": "MIT", + "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/slice-ansi/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, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/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, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/slice-ansi/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, + "license": "MIT", + "peer": true + }, + "node_modules/solc": { + "version": "0.8.26", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.26.tgz", + "integrity": "sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "command-exists": "^1.2.8", + "commander": "^8.1.0", + "follow-redirects": "^1.12.1", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "bin": { + "solcjs": "solc.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "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, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/solidity-bytes-utils": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/solidity-bytes-utils/-/solidity-bytes-utils-0.8.2.tgz", + "integrity": "sha512-cqXPYAV2auhpdKSTPuqji0CwpSceZDu95CzqSM/9tDJ2MoMaMsdHTpOIWtVw31BIqqGPNmIChCswzbw0tHaMTw==", + "license": "MIT", + "peer": true, + "dependencies": { + "ds-test": "github:dapphub/ds-test", + "forge-std": "^1.1.2" + } + }, + "node_modules/solidity-coverage": { + "version": "0.8.14", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.14.tgz", + "integrity": "sha512-ItAAObe5GaEOp20kXC2BZRnph+9P7Rtoqg2mQc2SXGEHgSDF2wWd1Wxz3ntzQWXkbCtIIGdJT918HG00cObwbA==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.0.9", + "@solidity-parser/parser": "^0.19.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.19.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.19.0.tgz", + "integrity": "sha512-RV16k/qIxW/wWc+mLzV3ARyKUaMUTBy9tOLMzFhtNSKYeTAanQ3a5MudJKf/8arIFnA2L27SNjarQKmFg0w/jA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "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/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "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, + "license": "MIT", + "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, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.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, + "license": "BSD-3-Clause", + "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, + "license": "MIT", + "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, + "license": "(MIT OR CC0-1.0)", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "WTFPL OR MIT", + "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, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "get-port": "^3.1.0" + } + }, + "node_modules/table": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", + "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==", + "dev": true, + "license": "BSD-3-Clause", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true + }, + "node_modules/then-request/node_modules/form-data": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.2.tgz", + "integrity": "sha512-GgwY0PS7DbXqajuGf4OYlsrIu3zgxD6Vvql43IBhm6MahqA5SK/7mwhtNj2AdH2z35YR34ujJ7BN+3fFC3jP5Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", + "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "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==", + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "ISC", + "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-command-line-args/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, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ts-command-line-args/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, + "license": "MIT", + "peer": 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/ts-command-line-args/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, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ts-command-line-args/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, + "license": "MIT", + "peer": true + }, + "node_modules/ts-command-line-args/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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-command-line-args/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, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.3.1" + } + }, + "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, + "license": "0BSD" + }, + "node_modules/tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true, + "license": "Unlicense" + }, + "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, + "license": "Unlicense" + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "license": "MIT", + "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, + "license": "(MIT OR CC0-1.0)", + "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, + "license": "MIT", + "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/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, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "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, + "license": "ISC", + "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/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "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, + "license": "MIT", + "peer": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "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, + "license": "MIT", + "peer": true + }, + "node_modules/typescript": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "dev": true, + "license": "Apache-2.0", + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "license": "BSD-2-Clause", + "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, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, + "license": "MIT" + }, + "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, + "license": "MIT", + "engines": { + "node": ">= 4.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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT" + }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "LGPL-3.0", + "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/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "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, + "license": "MIT", + "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/wrap-ansi/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, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/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, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/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, + "license": "MIT" + }, + "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, + "license": "ISC" + }, + "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==", + "license": "MIT", + "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/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "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, + "license": "MIT", + "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.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "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, + "license": "MIT", + "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, + "license": "MIT", + "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, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zksync-ethers": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/zksync-ethers/-/zksync-ethers-5.10.0.tgz", + "integrity": "sha512-OAjTGAHF9wbdkRGkj7XZuF/a1Sk/FVbwH4pmLjAKlR7mJ7sQtQhBhrPU2dCc67xLaNvEESPfwil19ES5wooYFg==", + "license": "MIT", + "peer": true, + "dependencies": { + "ethers": "~5.7.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "ethers": "~5.7.0" + } + } + } +} diff --git a/tools/layer-zero-example/package.json b/tools/layer-zero-example/package.json new file mode 100644 index 0000000000..ed3460e0e0 --- /dev/null +++ b/tools/layer-zero-example/package.json @@ -0,0 +1,15 @@ +{ + "name": "layer-zero-example", + "scripts": {}, + "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^2.0.0", + "hardhat": "^2.12.4" + }, + "dependencies": { + "@layerzerolabs/lz-evm-oapp-v2": "^3.0.21", + "@layerzerolabs/lz-v2-utilities": "^3.0.22", + "@layerzerolabs/oapp-evm": "^0.3.0", + "@layerzerolabs/onft-evm": "^0.1.0", + "dotenv": "^16.4.7" + } +} diff --git a/tools/layer-zero-example/test/Tests.js b/tools/layer-zero-example/test/Tests.js new file mode 100644 index 0000000000..f29495f2c0 --- /dev/null +++ b/tools/layer-zero-example/test/Tests.js @@ -0,0 +1,384 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const { ethers } = require('hardhat'); +const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; + +xdescribe('test ', function() { + it('@hedera cross send to bsc', async () => { + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0); + + const contract = await ethers.getContractAt('ExampleOApp', '0xD8f4079c913e15CA0679666F89671aAd8E24B957'); + const tx = await contract.send( + BSC_EID, + '1111111111', + _options.toHex(), + { gasLimit: 10_000_000, value: '5000000000000000000' } + ); + console.log(await tx.wait()); + }); + + it('@bsc cross send to hedera', async () => { + const _options = Options.newOptions().addExecutorLzReceiveOption(300000, 0); + + const contract = await ethers.getContractAt('ExampleOApp', '0x97A10e71bd5258075DCBCa40cbaB9E74129c303E'); + const tx = await contract.send( + HEDERA_EID, + '2222222222', + _options.toHex(), + { gasLimit: 12_000_000, value: '1000000000000000' } + ); + console.log(await tx.wait()); + }); + + it('@hedera data() hedera', async () => { + const contract = await ethers.getContractAt('ExampleOApp', '0xD8f4079c913e15CA0679666F89671aAd8E24B957'); + console.log(await contract.data()); + }); + + it('@bsc data() bsc', async () => { + const contract = await ethers.getContractAt('ExampleOApp', '0x97A10e71bd5258075DCBCa40cbaB9E74129c303E'); + console.log(await contract.data()); + }); +}); + +xdescribe('test oft', function() { + const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; + const HEDERA_OFT_CONTRACT = '0x25e727248DA63D88c7AeF6c01486Fd489E148950'; + const BSC_OFT_CONTRACT = '0xC3dd597Fe5cFffB5A5F5c252746d887284FA586D'; + xit('cross send to bsc', async () => { + const signers = await ethers.getSigners(); + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + amountLD: '100000000000000000', + minAmountLD: '100000000000000000', + extraOptions: _options, + composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message + oftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed + }; + + const contract = await ethers.getContractAt('ExampleOFT', HEDERA_OFT_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + console.log(await tx.wait()); + }); + + xit('cross send to hedera', async () => { + const signers = await ethers.getSigners(); + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + amountLD: '100000000000000000', + minAmountLD: '100000000000000000', + extraOptions: _options, + composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message + oftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed + }; + + const contract = await ethers.getContractAt('ExampleOFT', BSC_OFT_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + console.log(await tx.wait()); + }); + + it('get balance hedera', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ExampleOFT', HEDERA_OFT_CONTRACT); + console.log(await contract.balanceOf(signers[0].address)); + console.log(await contract.balanceOf(receiverAddress)); + }); + + it('get balance bsc', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ExampleOFT', BSC_OFT_CONTRACT); + console.log(await contract.balanceOf(signers[0].address)); + console.log(await contract.balanceOf(receiverAddress)); + }); +}); + +xdescribe('test oft adapter', function() { + const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; + + const HEDERA_ERC20_CONTRACT = '0x3a04e0b89704AED113631AEB83FBb18e2a741EE2'; + const BSC_ERC20_CONTRACT = '0x3b77bA19F12a0629C29aC0f69903563EEf3fCb05'; + + const HEDERA_OFT_ADAPTER_CONTRACT = '0xff78dc054c6858823c21FbB32E76bA7Ce83B4251'; + const BSC_OFT_ADAPTER_CONTRACT = '0xecB742E73eADb2a7a03086E38140aA8Ac1F3D8D8'; + + it('fund bsc adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', BSC_ERC20_CONTRACT); + const transferTx = await contractERC20.transfer(BSC_OFT_ADAPTER_CONTRACT, '100000000000000000'); + await transferTx.wait(); + }); + + it('fund hedera adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', HEDERA_ERC20_CONTRACT); + const transferTx = await contractERC20.transfer(HEDERA_OFT_ADAPTER_CONTRACT, '100000000000000000'); + await transferTx.wait(); + }); + + it('approve bsc adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', BSC_ERC20_CONTRACT); + const approveTx = await contractERC20.approve(BSC_OFT_ADAPTER_CONTRACT, '100000000000000000'); + await approveTx.wait(); + }); + + it('approve hedera adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', HEDERA_ERC20_CONTRACT); + const approveTx = await contractERC20.approve(HEDERA_OFT_ADAPTER_CONTRACT, '100000000000000000'); + await approveTx.wait(); + }); + + it('cross send to bsc', async () => { + const signers = await ethers.getSigners(); + + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + amountLD: '100000000000000000', + minAmountLD: '100000000000000000', + extraOptions: _options, + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTAdapter', HEDERA_OFT_ADAPTER_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + + console.log(await tx.wait()); + }); + + it('cross send to hedera', async () => { + const signers = await ethers.getSigners(); + + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + amountLD: '100000000000000000', + minAmountLD: '100000000000000000', + extraOptions: _options, + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTAdapter', BSC_OFT_ADAPTER_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + console.log(await tx.wait()); + }); + + it('get balance hedera', async () => { + const signers = await ethers.getSigners(); + + console.log('ERC20'); + const contractERC20 = await ethers.getContractAt('ERC20Mock', HEDERA_ERC20_CONTRACT); + console.log('signer: ' + await contractERC20.balanceOf(signers[0].address)); + console.log('contract: ' + await contractERC20.balanceOf(HEDERA_OFT_ADAPTER_CONTRACT)); + console.log('receiver: ' + await contractERC20.balanceOf(receiverAddress)); + }); + + it('get balance bsc', async () => { + const signers = await ethers.getSigners(); + + console.log('ERC20'); + const contractERC20 = await ethers.getContractAt('ERC20Mock', BSC_ERC20_CONTRACT); + console.log('signer: ' + await contractERC20.balanceOf(signers[0].address)); + console.log('contract: ' + await contractERC20.balanceOf(BSC_OFT_ADAPTER_CONTRACT)); + console.log('receiver: ' + await contractERC20.balanceOf(receiverAddress)); + }); +}); + +xdescribe('test onft', function() { + const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; + const HEDERA_ONFT_CONTRACT = '0x5E74F32347Be7c23f1396f904a97898a5E244B57'; + const BSC_ONFT_CONTRACT = '0x79535b9adE8235CB099979a945df9d2Df0093550'; + it('cross send to bsc', async () => { + const signers = await ethers.getSigners(); + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + tokenId: 1, + extraOptions: _options, + composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message + onftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed + }; + + const contract = await ethers.getContractAt('ExampleONFT', HEDERA_ONFT_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + console.log(await tx.wait()); + }); + + it('cross send to hedera', async () => { + const signers = await ethers.getSigners(); + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + tokenId: 2, + extraOptions: _options, + composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message + onftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed + }; + + const contract = await ethers.getContractAt('ExampleONFT', BSC_ONFT_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + console.log(await tx.wait()); + }); + + it('get owner hedera', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ExampleONFT', HEDERA_ONFT_CONTRACT); + console.log('signer: ' + signers[0].address); + console.log('receiver: ' + receiverAddress); + // console.log('owner of 1: ' + await contract.ownerOf(1)); + // console.log('owner of 2: ' + await contract.ownerOf(2)); + }); + + it('get owner bsc', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ExampleONFT', BSC_ONFT_CONTRACT); + console.log('signer: ' + signers[0].address); + console.log('receiver: ' + receiverAddress); + // console.log('owner of 1: ' + await contract.ownerOf(1)); + // console.log('owner of 2: ' + await contract.ownerOf(2)); + }); +}); + +xdescribe('test onft-adapter', function() { + const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; + const HEDERA_ERC721_CONTRACT = '0xC0D9235f8e2a87a24ab09E6FE49fe611fD0c426B'; + const BSC_ERC721_CONTRACT = '0x730450E6cd8aE6CBa521b7155e808788cf9e7C6E'; + const HEDERA_ONFT_ADAPTER_CONTRACT = '0x4f48995Bd2AE982044DC519C76E708c117b63FE5'; + const BSC_ONFT_ADAPTER_CONTRACT = '0xbf0108515F7379eE7392cDFD75a27c328222A544'; + + it('cross send to bsc', async () => { + const signers = await ethers.getSigners(); + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + tokenId: 1, + extraOptions: _options, + composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message + onftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed + }; + + const contract = await ethers.getContractAt('ExampleONFTAdapter', HEDERA_ONFT_ADAPTER_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + console.log(await tx.wait()); + }); + + it('cross send to hedera', async () => { + const signers = await ethers.getSigners(); + const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + tokenId: 2, + extraOptions: _options, + composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message + onftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed + }; + + const contract = await ethers.getContractAt('ExampleONFTAdapter', BSC_ONFT_ADAPTER_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + console.log(await tx.wait()); + }); + + it('approve hedera', async () => { + const contract = await ethers.getContractAt('ERC721Mock', HEDERA_ERC721_CONTRACT); + const tx = await contract.approve(HEDERA_ONFT_ADAPTER_CONTRACT, 1); + await tx.wait(); + }); + + it('approve bsc', async () => { + const contract = await ethers.getContractAt('ERC721Mock', BSC_ERC721_CONTRACT); + const tx = await contract.approve(BSC_ONFT_ADAPTER_CONTRACT, 2); + await tx.wait(); + }); + + it('mint hedera', async () => { + const signers = await ethers.getSigners(); + const contract = await ethers.getContractAt('ERC721Mock', HEDERA_ERC721_CONTRACT); + const tx = await contract.mint(signers[0].address, 1); + await tx.wait(); + }); + + it('mint bsc', async () => { + const signers = await ethers.getSigners(); + const contract = await ethers.getContractAt('ERC721Mock', BSC_ERC721_CONTRACT); + const tx = await contract.mint(signers[0].address, 2); + await tx.wait(); + }); + + it('get owner hedera', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ERC721Mock', HEDERA_ERC721_CONTRACT); + console.log('signer: ' + signers[0].address); + console.log('receiver: ' + receiverAddress); + console.log('owner of 1: ' + await contract.ownerOf(1)); + console.log('owner of 2: ' + await contract.ownerOf(2)); + }); + + it('get owner bsc', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ERC721Mock', BSC_ERC721_CONTRACT); + console.log('signer: ' + signers[0].address); + console.log('receiver: ' + receiverAddress); + console.log('owner of 1: ' + await contract.ownerOf(1)); + console.log('owner of 2: ' + await contract.ownerOf(2)); + }); +}); diff --git a/tools/layer-zero-example/test/oappTests.js b/tools/layer-zero-example/test/oappTests.js new file mode 100644 index 0000000000..14a295c306 --- /dev/null +++ b/tools/layer-zero-example/test/oappTests.js @@ -0,0 +1,81 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const hre = require('hardhat'); +const { ethers } = hre; +const { Options } = require('@layerzerolabs/lz-v2-utilities'); +const { expect } = require('chai'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; +const DATA_FROM_HEDERA = 'dataFromHedera'; +const DATA_FROM_BSC = 'dataFromBsc'; + +describe('OAppTests', function() { + it('@hedera @send to bsc', async () => { + const contract = await ethers.getContractAt('ExampleOApp', process.env.OAPP_HEDERA_CONTRACT); + const tx = await contract.send( + BSC_EID, + DATA_FROM_HEDERA, + Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toHex(), + { gasLimit: 10_000_000, value: '5000000000000000000' } + ); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); + }); + + it('@bsc @send to hedera', async () => { + const contract = await ethers.getContractAt('ExampleOApp', process.env.OAPP_BSC_CONTRACT); + const tx = await contract.send( + HEDERA_EID, + DATA_FROM_BSC, + Options.newOptions().addExecutorLzReceiveOption(300000, 0).toHex(), + { gasLimit: 12_000_000, value: '1000000000000000' } + ); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@hedera @test data()', async () => { + const contract = await ethers.getContractAt('ExampleOApp', process.env.OAPP_HEDERA_CONTRACT); + const data = await contract.data(); + console.log(`(${hre.network.name}) data: ${data}`); + + expect(data).to.equal(DATA_FROM_BSC); + }); + + it('@bsc @test data()', async () => { + const contract = await ethers.getContractAt('ExampleOApp', process.env.OAPP_BSC_CONTRACT); + const data = await contract.data(); + console.log(`(${hre.network.name}) data: ${data}`); + + expect(data).to.equal(DATA_FROM_HEDERA); + }); +}); diff --git a/tools/layer-zero-example/test/oftAdapterTests.js b/tools/layer-zero-example/test/oftAdapterTests.js new file mode 100644 index 0000000000..d894cf7e8b --- /dev/null +++ b/tools/layer-zero-example/test/oftAdapterTests.js @@ -0,0 +1,139 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const hre = require('hardhat'); +const { ethers } = hre; +const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); +const { expect } = require('chai'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; +const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; +const amount = '100000000000000000'; + +describe('OFTAdapterTests', function() { + it('@hedera @fund-and-approve transfer to adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_HEDERA_CONTRACT); + const transferTx = await contractERC20.transfer(process.env.OFT_ADAPTER_HEDERA_CONTRACT, amount); + const receipt = await transferTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @fund-and-approve transfer to adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_BSC_CONTRACT); + const transferTx = await contractERC20.transfer(process.env.OFT_ADAPTER_BSC_CONTRACT, amount); + const receipt = await transferTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @fund-and-approve adapter approval', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_HEDERA_CONTRACT); + const approveTx = await contractERC20.approve(process.env.OFT_ADAPTER_HEDERA_CONTRACT, amount); + const receipt = await approveTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @fund-and-approve adapter approval', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_BSC_CONTRACT); + const approveTx = await contractERC20.approve(process.env.OFT_ADAPTER_BSC_CONTRACT, amount); + const receipt = await approveTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @send to bsc', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTAdapter', process.env.OFT_ADAPTER_HEDERA_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@bsc @send to hedera', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTAdapter', process.env.OFT_ADAPTER_BSC_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@hedera @test balance', async () => { + const signers = await ethers.getSigners(); + + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_HEDERA_CONTRACT); + const receiverBalance = await contractERC20.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contractERC20.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) oft adapter balance: ${await contractERC20.balanceOf(process.env.OFT_ADAPTER_HEDERA_CONTRACT)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); + + it('@bsc @test balance', async () => { + const signers = await ethers.getSigners(); + + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_BSC_CONTRACT); + const receiverBalance = await contractERC20.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contractERC20.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) oft adapter balance: ${await contractERC20.balanceOf(process.env.OFT_ADAPTER_BSC_CONTRACT)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); +}); diff --git a/tools/layer-zero-example/test/oftTests.js b/tools/layer-zero-example/test/oftTests.js new file mode 100644 index 0000000000..aadfa513e9 --- /dev/null +++ b/tools/layer-zero-example/test/oftTests.js @@ -0,0 +1,109 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const hre = require('hardhat'); +const { ethers } = hre; +const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); +const { expect } = require('chai'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; +const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; +const amount = '100000000000000000'; + +describe('OFTTests', function() { + it('@hedera @send to bsc', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFT', process.env.OFT_HEDERA_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); + }); + + it('@bsc @send to hedera', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFT', process.env.OFT_BSC_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@hedera @test balance', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ExampleOFT', process.env.OFT_HEDERA_CONTRACT); + const receiverBalance = await contract.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contract.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); + + it('@bsc @test balance', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ExampleOFT', process.env.OFT_BSC_CONTRACT); + const receiverBalance = await contract.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contract.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); +}); diff --git a/tools/layer-zero-example/test/onftAdapterTests.js b/tools/layer-zero-example/test/onftAdapterTests.js new file mode 100644 index 0000000000..153b120420 --- /dev/null +++ b/tools/layer-zero-example/test/onftAdapterTests.js @@ -0,0 +1,138 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const hre = require('hardhat'); +const { ethers } = hre; +const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); +const { expect } = require('chai'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; +const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; + +describe('ONFTAdapterTests', function() { + it('@hedera @mint to signer', async () => { + const signers = await ethers.getSigners(); + const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); + const tx = await contract.mint(signers[0].address, 1); + const receipt = await tx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @mint to adapter', async () => { + const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); + const tx = await contract.mint(process.env.ONFT_ADAPTER_HEDERA_CONTRACT, 2); + const receipt = await tx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @mint to signer', async () => { + const signers = await ethers.getSigners(); + const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); + const tx = await contract.mint(signers[0].address, 2); + const receipt = await tx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @mint to adapter', async () => { + const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); + const tx = await contract.mint(process.env.ONFT_ADAPTER_BSC_CONTRACT, 1); + const receipt = await tx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @approve adapter', async () => { + const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); + const approveTx = await contract.approve(process.env.ONFT_ADAPTER_HEDERA_CONTRACT, 1); + const receipt = await approveTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @approve adapter', async () => { + const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); + const approveTx = await contract.approve(process.env.ONFT_ADAPTER_BSC_CONTRACT, 2); + const receipt = await approveTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @send to bsc', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + tokenId: 1, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + onftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleONFTAdapter', process.env.ONFT_ADAPTER_HEDERA_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@bsc @send to hedera', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + tokenId: 2, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + onftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleONFTAdapter', process.env.ONFT_ADAPTER_BSC_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@hedera @test get owner', async () => { + const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); + console.log('owner of 1: ' + await contract.ownerOf(1)); + console.log('owner of 2: ' + await contract.ownerOf(2)); + }); + + it('@bsc @test get owner', async () => { + const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); + console.log('owner of 1: ' + await contract.ownerOf(1)); + console.log('owner of 2: ' + await contract.ownerOf(2)); + }); +}); diff --git a/tools/layer-zero-example/test/onftTests.js b/tools/layer-zero-example/test/onftTests.js new file mode 100644 index 0000000000..bb5257251c --- /dev/null +++ b/tools/layer-zero-example/test/onftTests.js @@ -0,0 +1,94 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const hre = require('hardhat'); +const { ethers } = hre; +const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); +const { expect } = require('chai'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; +const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; + +describe('ONFTTests', function() { + it('@hedera @send to bsc', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + tokenId: 1, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + onftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleONFT', process.env.ONFT_HEDERA_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); + }); + + it('@bsc @send to hedera', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + tokenId: 2, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + onftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleONFT', process.env.ONFT_BSC_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); + }); + + it('@hedera @test get owner', async () => { + const contract = await ethers.getContractAt('ExampleONFT', process.env.ONFT_HEDERA_CONTRACT); + const owner = await contract.ownerOf(2); + expect(owner).to.equal(receiverAddress); + }); + + it('@bsc @test get owner', async () => { + const contract = await ethers.getContractAt('ExampleONFT', process.env.ONFT_BSC_CONTRACT); + const owner = await contract.ownerOf(1); + expect(owner).to.equal(receiverAddress); + }); +}); From a75587704fe6d454d11d20131f82d8a10cef03ec Mon Sep 17 00:00:00 2001 From: nikolay Date: Thu, 12 Dec 2024 10:07:24 +0200 Subject: [PATCH 02/14] chore: fix tests Signed-off-by: nikolay --- .../test/oftAdapterTests.js | 2 +- .../test/onftAdapterTests.js | 46 +++++++++---------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/tools/layer-zero-example/test/oftAdapterTests.js b/tools/layer-zero-example/test/oftAdapterTests.js index d894cf7e8b..9f3743b277 100644 --- a/tools/layer-zero-example/test/oftAdapterTests.js +++ b/tools/layer-zero-example/test/oftAdapterTests.js @@ -81,7 +81,7 @@ describe('OFTAdapterTests', function() { process.exit(`Execution failed. Tx hash: ${tx.hash}`); } - console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + console.log(`(${hre.network.name}) successfully sent to Bsc via tx: ${tx.hash}`); }); it('@bsc @send to hedera', async () => { diff --git a/tools/layer-zero-example/test/onftAdapterTests.js b/tools/layer-zero-example/test/onftAdapterTests.js index 153b120420..e184e68f69 100644 --- a/tools/layer-zero-example/test/onftAdapterTests.js +++ b/tools/layer-zero-example/test/onftAdapterTests.js @@ -28,34 +28,30 @@ const BSC_EID = 40102; const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; describe('ONFTAdapterTests', function() { - it('@hedera @mint to signer', async () => { + it('@hedera @mint', async () => { const signers = await ethers.getSigners(); - const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); - const tx = await contract.mint(signers[0].address, 1); - const receipt = await tx.wait(); - expect(!!receipt.status).to.be.true; - }); - it('@hedera @mint to adapter', async () => { const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); - const tx = await contract.mint(process.env.ONFT_ADAPTER_HEDERA_CONTRACT, 2); - const receipt = await tx.wait(); - expect(!!receipt.status).to.be.true; + const txSigner = await contract.mint(signers[0].address, 1); + const receiptSigner = await txSigner.wait(); + expect(!!receiptSigner.status).to.be.true; + + const txAdapter = await contract.mint(process.env.ONFT_ADAPTER_HEDERA_CONTRACT, 2); + const receiptAdapter = await txAdapter.wait(); + expect(!!receiptAdapter.status).to.be.true; }); - it('@bsc @mint to signer', async () => { + it('@bsc @mint', async () => { const signers = await ethers.getSigners(); - const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); - const tx = await contract.mint(signers[0].address, 2); - const receipt = await tx.wait(); - expect(!!receipt.status).to.be.true; - }); - it('@bsc @mint to adapter', async () => { const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); - const tx = await contract.mint(process.env.ONFT_ADAPTER_BSC_CONTRACT, 1); - const receipt = await tx.wait(); - expect(!!receipt.status).to.be.true; + const txAdapter = await contract.mint(process.env.ONFT_ADAPTER_BSC_CONTRACT, 1); + const receiptAdapter = await txAdapter.wait(); + expect(!!receiptAdapter.status).to.be.true; + + const txSigner = await contract.mint(signers[0].address, 2); + const receiptSigner = await txSigner.wait(); + expect(!!receiptSigner.status).to.be.true; }); it('@hedera @approve adapter', async () => { @@ -95,7 +91,7 @@ describe('ONFTAdapterTests', function() { process.exit(`Execution failed. Tx hash: ${tx.hash}`); } - console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + console.log(`(${hre.network.name}) successfully sent to Bsc via tx: ${tx.hash}`); }); it('@bsc @send to hedera', async () => { @@ -126,13 +122,13 @@ describe('ONFTAdapterTests', function() { it('@hedera @test get owner', async () => { const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); - console.log('owner of 1: ' + await contract.ownerOf(1)); - console.log('owner of 2: ' + await contract.ownerOf(2)); + const owner = await contract.ownerOf(2); + expect(owner).to.equal(receiverAddress); }); it('@bsc @test get owner', async () => { const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); - console.log('owner of 1: ' + await contract.ownerOf(1)); - console.log('owner of 2: ' + await contract.ownerOf(2)); + const owner = await contract.ownerOf(1); + expect(owner).to.equal(receiverAddress); }); }); From b955221cc66060c749a014e5667cc630ddb2063c Mon Sep 17 00:00:00 2001 From: nikolay Date: Thu, 12 Dec 2024 11:38:45 +0200 Subject: [PATCH 03/14] chore: remove unused tests Signed-off-by: nikolay --- tools/layer-zero-example/test/Tests.js | 384 ------------------------- 1 file changed, 384 deletions(-) delete mode 100644 tools/layer-zero-example/test/Tests.js diff --git a/tools/layer-zero-example/test/Tests.js b/tools/layer-zero-example/test/Tests.js deleted file mode 100644 index f29495f2c0..0000000000 --- a/tools/layer-zero-example/test/Tests.js +++ /dev/null @@ -1,384 +0,0 @@ -/*- - * - * Hedera JSON RPC Relay - Hardhat Example - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -const { ethers } = require('hardhat'); -const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); - -const HEDERA_EID = 40285; -const BSC_EID = 40102; - -xdescribe('test ', function() { - it('@hedera cross send to bsc', async () => { - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0); - - const contract = await ethers.getContractAt('ExampleOApp', '0xD8f4079c913e15CA0679666F89671aAd8E24B957'); - const tx = await contract.send( - BSC_EID, - '1111111111', - _options.toHex(), - { gasLimit: 10_000_000, value: '5000000000000000000' } - ); - console.log(await tx.wait()); - }); - - it('@bsc cross send to hedera', async () => { - const _options = Options.newOptions().addExecutorLzReceiveOption(300000, 0); - - const contract = await ethers.getContractAt('ExampleOApp', '0x97A10e71bd5258075DCBCa40cbaB9E74129c303E'); - const tx = await contract.send( - HEDERA_EID, - '2222222222', - _options.toHex(), - { gasLimit: 12_000_000, value: '1000000000000000' } - ); - console.log(await tx.wait()); - }); - - it('@hedera data() hedera', async () => { - const contract = await ethers.getContractAt('ExampleOApp', '0xD8f4079c913e15CA0679666F89671aAd8E24B957'); - console.log(await contract.data()); - }); - - it('@bsc data() bsc', async () => { - const contract = await ethers.getContractAt('ExampleOApp', '0x97A10e71bd5258075DCBCa40cbaB9E74129c303E'); - console.log(await contract.data()); - }); -}); - -xdescribe('test oft', function() { - const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; - const HEDERA_OFT_CONTRACT = '0x25e727248DA63D88c7AeF6c01486Fd489E148950'; - const BSC_OFT_CONTRACT = '0xC3dd597Fe5cFffB5A5F5c252746d887284FA586D'; - xit('cross send to bsc', async () => { - const signers = await ethers.getSigners(); - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); - const sendParam = { - dstEid: BSC_EID, - to: addressToBytes32(receiverAddress), - amountLD: '100000000000000000', - minAmountLD: '100000000000000000', - extraOptions: _options, - composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message - oftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed - }; - - const contract = await ethers.getContractAt('ExampleOFT', HEDERA_OFT_CONTRACT); - const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { - gasLimit: 10_000_000, - value: '5000000000000000000' - }); - console.log(await tx.wait()); - }); - - xit('cross send to hedera', async () => { - const signers = await ethers.getSigners(); - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); - const sendParam = { - dstEid: HEDERA_EID, - to: addressToBytes32(receiverAddress), - amountLD: '100000000000000000', - minAmountLD: '100000000000000000', - extraOptions: _options, - composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message - oftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed - }; - - const contract = await ethers.getContractAt('ExampleOFT', BSC_OFT_CONTRACT); - const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { - gasLimit: 1_000_000, - value: '1000000000000000' - }); - console.log(await tx.wait()); - }); - - it('get balance hedera', async () => { - const signers = await ethers.getSigners(); - - const contract = await ethers.getContractAt('ExampleOFT', HEDERA_OFT_CONTRACT); - console.log(await contract.balanceOf(signers[0].address)); - console.log(await contract.balanceOf(receiverAddress)); - }); - - it('get balance bsc', async () => { - const signers = await ethers.getSigners(); - - const contract = await ethers.getContractAt('ExampleOFT', BSC_OFT_CONTRACT); - console.log(await contract.balanceOf(signers[0].address)); - console.log(await contract.balanceOf(receiverAddress)); - }); -}); - -xdescribe('test oft adapter', function() { - const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; - - const HEDERA_ERC20_CONTRACT = '0x3a04e0b89704AED113631AEB83FBb18e2a741EE2'; - const BSC_ERC20_CONTRACT = '0x3b77bA19F12a0629C29aC0f69903563EEf3fCb05'; - - const HEDERA_OFT_ADAPTER_CONTRACT = '0xff78dc054c6858823c21FbB32E76bA7Ce83B4251'; - const BSC_OFT_ADAPTER_CONTRACT = '0xecB742E73eADb2a7a03086E38140aA8Ac1F3D8D8'; - - it('fund bsc adapter', async () => { - const contractERC20 = await ethers.getContractAt('ERC20Mock', BSC_ERC20_CONTRACT); - const transferTx = await contractERC20.transfer(BSC_OFT_ADAPTER_CONTRACT, '100000000000000000'); - await transferTx.wait(); - }); - - it('fund hedera adapter', async () => { - const contractERC20 = await ethers.getContractAt('ERC20Mock', HEDERA_ERC20_CONTRACT); - const transferTx = await contractERC20.transfer(HEDERA_OFT_ADAPTER_CONTRACT, '100000000000000000'); - await transferTx.wait(); - }); - - it('approve bsc adapter', async () => { - const contractERC20 = await ethers.getContractAt('ERC20Mock', BSC_ERC20_CONTRACT); - const approveTx = await contractERC20.approve(BSC_OFT_ADAPTER_CONTRACT, '100000000000000000'); - await approveTx.wait(); - }); - - it('approve hedera adapter', async () => { - const contractERC20 = await ethers.getContractAt('ERC20Mock', HEDERA_ERC20_CONTRACT); - const approveTx = await contractERC20.approve(HEDERA_OFT_ADAPTER_CONTRACT, '100000000000000000'); - await approveTx.wait(); - }); - - it('cross send to bsc', async () => { - const signers = await ethers.getSigners(); - - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); - const sendParam = { - dstEid: BSC_EID, - to: addressToBytes32(receiverAddress), - amountLD: '100000000000000000', - minAmountLD: '100000000000000000', - extraOptions: _options, - composeMsg: ethers.utils.arrayify('0x'), - oftCmd: ethers.utils.arrayify('0x') - }; - - const contract = await ethers.getContractAt('ExampleOFTAdapter', HEDERA_OFT_ADAPTER_CONTRACT); - const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { - gasLimit: 10_000_000, - value: '5000000000000000000' - }); - - console.log(await tx.wait()); - }); - - it('cross send to hedera', async () => { - const signers = await ethers.getSigners(); - - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); - const sendParam = { - dstEid: HEDERA_EID, - to: addressToBytes32(receiverAddress), - amountLD: '100000000000000000', - minAmountLD: '100000000000000000', - extraOptions: _options, - composeMsg: ethers.utils.arrayify('0x'), - oftCmd: ethers.utils.arrayify('0x') - }; - - const contract = await ethers.getContractAt('ExampleOFTAdapter', BSC_OFT_ADAPTER_CONTRACT); - const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { - gasLimit: 1_000_000, - value: '1000000000000000' - }); - console.log(await tx.wait()); - }); - - it('get balance hedera', async () => { - const signers = await ethers.getSigners(); - - console.log('ERC20'); - const contractERC20 = await ethers.getContractAt('ERC20Mock', HEDERA_ERC20_CONTRACT); - console.log('signer: ' + await contractERC20.balanceOf(signers[0].address)); - console.log('contract: ' + await contractERC20.balanceOf(HEDERA_OFT_ADAPTER_CONTRACT)); - console.log('receiver: ' + await contractERC20.balanceOf(receiverAddress)); - }); - - it('get balance bsc', async () => { - const signers = await ethers.getSigners(); - - console.log('ERC20'); - const contractERC20 = await ethers.getContractAt('ERC20Mock', BSC_ERC20_CONTRACT); - console.log('signer: ' + await contractERC20.balanceOf(signers[0].address)); - console.log('contract: ' + await contractERC20.balanceOf(BSC_OFT_ADAPTER_CONTRACT)); - console.log('receiver: ' + await contractERC20.balanceOf(receiverAddress)); - }); -}); - -xdescribe('test onft', function() { - const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; - const HEDERA_ONFT_CONTRACT = '0x5E74F32347Be7c23f1396f904a97898a5E244B57'; - const BSC_ONFT_CONTRACT = '0x79535b9adE8235CB099979a945df9d2Df0093550'; - it('cross send to bsc', async () => { - const signers = await ethers.getSigners(); - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); - const sendParam = { - dstEid: BSC_EID, - to: addressToBytes32(receiverAddress), - tokenId: 1, - extraOptions: _options, - composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message - onftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed - }; - - const contract = await ethers.getContractAt('ExampleONFT', HEDERA_ONFT_CONTRACT); - const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { - gasLimit: 10_000_000, - value: '5000000000000000000' - }); - console.log(await tx.wait()); - }); - - it('cross send to hedera', async () => { - const signers = await ethers.getSigners(); - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); - const sendParam = { - dstEid: HEDERA_EID, - to: addressToBytes32(receiverAddress), - tokenId: 2, - extraOptions: _options, - composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message - onftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed - }; - - const contract = await ethers.getContractAt('ExampleONFT', BSC_ONFT_CONTRACT); - const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { - gasLimit: 1_000_000, - value: '1000000000000000' - }); - console.log(await tx.wait()); - }); - - it('get owner hedera', async () => { - const signers = await ethers.getSigners(); - - const contract = await ethers.getContractAt('ExampleONFT', HEDERA_ONFT_CONTRACT); - console.log('signer: ' + signers[0].address); - console.log('receiver: ' + receiverAddress); - // console.log('owner of 1: ' + await contract.ownerOf(1)); - // console.log('owner of 2: ' + await contract.ownerOf(2)); - }); - - it('get owner bsc', async () => { - const signers = await ethers.getSigners(); - - const contract = await ethers.getContractAt('ExampleONFT', BSC_ONFT_CONTRACT); - console.log('signer: ' + signers[0].address); - console.log('receiver: ' + receiverAddress); - // console.log('owner of 1: ' + await contract.ownerOf(1)); - // console.log('owner of 2: ' + await contract.ownerOf(2)); - }); -}); - -xdescribe('test onft-adapter', function() { - const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; - const HEDERA_ERC721_CONTRACT = '0xC0D9235f8e2a87a24ab09E6FE49fe611fD0c426B'; - const BSC_ERC721_CONTRACT = '0x730450E6cd8aE6CBa521b7155e808788cf9e7C6E'; - const HEDERA_ONFT_ADAPTER_CONTRACT = '0x4f48995Bd2AE982044DC519C76E708c117b63FE5'; - const BSC_ONFT_ADAPTER_CONTRACT = '0xbf0108515F7379eE7392cDFD75a27c328222A544'; - - it('cross send to bsc', async () => { - const signers = await ethers.getSigners(); - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); - const sendParam = { - dstEid: BSC_EID, - to: addressToBytes32(receiverAddress), - tokenId: 1, - extraOptions: _options, - composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message - onftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed - }; - - const contract = await ethers.getContractAt('ExampleONFTAdapter', HEDERA_ONFT_ADAPTER_CONTRACT); - const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { - gasLimit: 10_000_000, - value: '5000000000000000000' - }); - console.log(await tx.wait()); - }); - - it('cross send to hedera', async () => { - const signers = await ethers.getSigners(); - const _options = Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(); - const sendParam = { - dstEid: HEDERA_EID, - to: addressToBytes32(receiverAddress), - tokenId: 2, - extraOptions: _options, - composeMsg: ethers.utils.arrayify('0x'), // Assuming no composed message - onftCmd: ethers.utils.arrayify('0x') // Assuming no OFT command is needed - }; - - const contract = await ethers.getContractAt('ExampleONFTAdapter', BSC_ONFT_ADAPTER_CONTRACT); - const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { - gasLimit: 1_000_000, - value: '1000000000000000' - }); - console.log(await tx.wait()); - }); - - it('approve hedera', async () => { - const contract = await ethers.getContractAt('ERC721Mock', HEDERA_ERC721_CONTRACT); - const tx = await contract.approve(HEDERA_ONFT_ADAPTER_CONTRACT, 1); - await tx.wait(); - }); - - it('approve bsc', async () => { - const contract = await ethers.getContractAt('ERC721Mock', BSC_ERC721_CONTRACT); - const tx = await contract.approve(BSC_ONFT_ADAPTER_CONTRACT, 2); - await tx.wait(); - }); - - it('mint hedera', async () => { - const signers = await ethers.getSigners(); - const contract = await ethers.getContractAt('ERC721Mock', HEDERA_ERC721_CONTRACT); - const tx = await contract.mint(signers[0].address, 1); - await tx.wait(); - }); - - it('mint bsc', async () => { - const signers = await ethers.getSigners(); - const contract = await ethers.getContractAt('ERC721Mock', BSC_ERC721_CONTRACT); - const tx = await contract.mint(signers[0].address, 2); - await tx.wait(); - }); - - it('get owner hedera', async () => { - const signers = await ethers.getSigners(); - - const contract = await ethers.getContractAt('ERC721Mock', HEDERA_ERC721_CONTRACT); - console.log('signer: ' + signers[0].address); - console.log('receiver: ' + receiverAddress); - console.log('owner of 1: ' + await contract.ownerOf(1)); - console.log('owner of 2: ' + await contract.ownerOf(2)); - }); - - it('get owner bsc', async () => { - const signers = await ethers.getSigners(); - - const contract = await ethers.getContractAt('ERC721Mock', BSC_ERC721_CONTRACT); - console.log('signer: ' + signers[0].address); - console.log('receiver: ' + receiverAddress); - console.log('owner of 1: ' + await contract.ownerOf(1)); - console.log('owner of 2: ' + await contract.ownerOf(2)); - }); -}); From cf025fd133edb4bf9926823669eb6de1f66efe52 Mon Sep 17 00:00:00 2001 From: nikolay Date: Mon, 16 Dec 2024 13:10:00 +0200 Subject: [PATCH 04/14] chore: add oft hts example Signed-off-by: nikolay --- tools/layer-zero-example/.env.example | 10 + tools/layer-zero-example/README.md | 24 +- .../contracts/BaseHTSOFT.sol | 45 + .../contracts/ExampleOFT.sol | 13 +- .../contracts/ExampleOFTHTS.sol | 97 +++ .../contracts/hts/ExpiryHelper.sol | 21 + .../contracts/hts/HederaResponseCodes.sol | 330 ++++++++ .../contracts/hts/HederaTokenService.sol | 274 ++++++ .../contracts/hts/IHederaTokenService.sol | 799 ++++++++++++++++++ .../contracts/hts/KeyHelper.sol | 182 ++++ tools/layer-zero-example/hardhat.config.js | 20 +- tools/layer-zero-example/package-lock.json | 14 - tools/layer-zero-example/test/oftHtsTests.js | 112 +++ 13 files changed, 1922 insertions(+), 19 deletions(-) create mode 100644 tools/layer-zero-example/contracts/BaseHTSOFT.sol create mode 100644 tools/layer-zero-example/contracts/ExampleOFTHTS.sol create mode 100644 tools/layer-zero-example/contracts/hts/ExpiryHelper.sol create mode 100644 tools/layer-zero-example/contracts/hts/HederaResponseCodes.sol create mode 100644 tools/layer-zero-example/contracts/hts/HederaTokenService.sol create mode 100644 tools/layer-zero-example/contracts/hts/IHederaTokenService.sol create mode 100644 tools/layer-zero-example/contracts/hts/KeyHelper.sol create mode 100644 tools/layer-zero-example/test/oftHtsTests.js diff --git a/tools/layer-zero-example/.env.example b/tools/layer-zero-example/.env.example index 1fe1dc841b..9441da5f14 100644 --- a/tools/layer-zero-example/.env.example +++ b/tools/layer-zero-example/.env.example @@ -1,21 +1,31 @@ +# keys HEDERA_PK=0x BSC_PK=0x +# OApp config OAPP_HEDERA_CONTRACT=0x OAPP_BSC_CONTRACT=0x +# OFT config OFT_HEDERA_CONTRACT=0x OFT_BSC_CONTRACT=0x +# OFT Adapter config ERC20_HEDERA_CONTRACT=0x ERC20_BSC_CONTRACT=0x OFT_ADAPTER_HEDERA_CONTRACT=0x OFT_ADAPTER_BSC_CONTRACT=0x +# ONFT config ONFT_HEDERA_CONTRACT=0x ONFT_BSC_CONTRACT=0x +# ONFT Adapter config ERC721_HEDERA_CONTRACT=0x ERC721_BSC_CONTRACT=0x ONFT_ADAPTER_HEDERA_CONTRACT=0x ONFT_ADAPTER_BSC_CONTRACT=0x + +# OFT HTS config +OFT_HTS_HEDERA_CONTRACT=0x +OFT_HTS_BSC_CONTRACT=0x diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index 3acb8b5f06..b7d7554451 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -21,8 +21,8 @@ npx hardhat test --grep "OAppTests @bsc @test" --network bsc_testnet ### OFT -npx hardhat deploy-oft --network hedera_testnet -npx hardhat deploy-oft --network bsc_testnet +npx hardhat deploy-oft --decimals 18 --mint 1000000000000000000 --network hedera_testnet +npx hardhat deploy-oft --decimals 18 --mint 1000000000000000000 --network bsc_testnet npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet @@ -101,5 +101,25 @@ npx hardhat test --grep "ONFTAdapterTests @bsc @approve" --network bsc_testnet npx hardhat test --grep "ONFTAdapterTests @hedera @send" --network hedera_testnet npx hardhat test --grep "ONFTAdapterTests @bsc @send" --network bsc_testnet +wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ + npx hardhat test --grep "ONFTAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "ONFTAdapterTests @bsc @test" --network bsc_testnet + +### OFT HTS + +npx hardhat deploy-oft-hts --network hedera_testnet +npx hardhat deploy-oft --decimals 8 --mint 1000 --network bsc_testnet + +npx hardhat set-peer --source --target --network hedera_testnet +npx hardhat set-peer --source --target --network bsc_testnet + +fill the .env + +npx hardhat test --grep "OFTHTSTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "OFTHTSTests @bsc @send" --network bsc_testnet + +wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ + +npx hardhat test --grep "OFTHTSTests @hedera @test" --network hedera_testnet +npx hardhat test --grep "OFTHTSTests @bsc @test" --network bsc_testnet diff --git a/tools/layer-zero-example/contracts/BaseHTSOFT.sol b/tools/layer-zero-example/contracts/BaseHTSOFT.sol new file mode 100644 index 0000000000..e2f644fcf0 --- /dev/null +++ b/tools/layer-zero-example/contracts/BaseHTSOFT.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {OFTCore} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol"; + +/** + * @title OFT Contract + * @dev OFT is an ERC-20 token that extends the functionality of the OFTCore contract. + */ +abstract contract BaseHTSOFT is OFTCore { + /** + * @dev Constructor for the OFT contract. + * @param _name The name of the OFT. + * @param _symbol The symbol of the OFT. + * @param _lzEndpoint The LayerZero endpoint address. + * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. + */ + constructor( + string memory _name, + string memory _symbol, + address _lzEndpoint, + address _delegate + ) OFTCore(8, _lzEndpoint, _delegate) {} + + /** + * @dev Retrieves the address of the underlying ERC20 implementation. + * @return The address of the OFT token. + * + * @dev In the case of OFT, address(this) and erc20 are the same contract. + */ + function token() public view returns (address) { + return address(this); + } + + /** + * @notice Indicates whether the OFT contract requires approval of the 'token()' to send. + * @return requiresApproval Needs approval of the underlying token implementation. + * + * @dev In the case of OFT where the contract IS the token, approval is NOT required. + */ + function approvalRequired() external pure virtual returns (bool) { + return false; + } +} diff --git a/tools/layer-zero-example/contracts/ExampleOFT.sol b/tools/layer-zero-example/contracts/ExampleOFT.sol index d05294482b..80bd0ac89c 100644 --- a/tools/layer-zero-example/contracts/ExampleOFT.sol +++ b/tools/layer-zero-example/contracts/ExampleOFT.sol @@ -5,12 +5,21 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {OFT} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFT.sol"; contract ExampleOFT is OFT { + uint8 decimalsArg = 8; + constructor( string memory _name, string memory _symbol, address _lzEndpoint, - address _delegate + address _delegate, + uint256 _initialMint, + uint8 _decimals ) OFT(_name, _symbol, _lzEndpoint, _delegate) Ownable(_delegate) { - _mint(msg.sender, 1000000000000000000); + _mint(msg.sender, _initialMint); + decimalsArg = _decimals; + } + + function decimals() public view override returns (uint8) { + return decimalsArg; } } diff --git a/tools/layer-zero-example/contracts/ExampleOFTHTS.sol b/tools/layer-zero-example/contracts/ExampleOFTHTS.sol new file mode 100644 index 0000000000..4ceec65b36 --- /dev/null +++ b/tools/layer-zero-example/contracts/ExampleOFTHTS.sol @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "./hts/HederaTokenService.sol"; +import "./hts/IHederaTokenService.sol"; +import "./hts/KeyHelper.sol"; +import "./hts/ExpiryHelper.sol"; +import "./BaseHTSOFT.sol"; + +contract ExampleOFTHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService, BaseHTSOFT { + address public htsTokenAddress; + + event CreatedToken(address tokenAddress); + + constructor( + string memory _name, + string memory _symbol, + address _lzEndpoint, + address _delegate + ) payable BaseHTSOFT(_name, _symbol, _lzEndpoint, _delegate) Ownable(_delegate) { + IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](2); + keys[0] = getSingleKey( + KeyType.ADMIN, + KeyType.PAUSE, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + keys[1] = getSingleKey( + KeyType.SUPPLY, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + + IHederaTokenService.Expiry memory expiry = IHederaTokenService.Expiry(0, address(this), 8000000); + IHederaTokenService.HederaToken memory token = IHederaTokenService.HederaToken( + _name, _symbol, address(this), "memo", true, 1000, false, keys, expiry + ); + + (int responseCode, address tokenAddress) = HederaTokenService.createFungibleToken( + token, 1000, int32(int256(uint256(8))) + ); + require(responseCode == HederaResponseCodes.SUCCESS, "Failed to create HTS token"); + + htsTokenAddress = tokenAddress; + + emit CreatedToken(tokenAddress); + } + + /** + * @dev Burns tokens from the sender's specified balance. + * @param _from The address to debit the tokens from. + * @param _amountLD The amount of tokens to send in local decimals. + * @param _minAmountLD The minimum amount to send in local decimals. + * @param _dstEid The destination chain ID. + * @return amountSentLD The amount sent in local decimals. + * @return amountReceivedLD The amount received in local decimals on the remote. + */ + function _debit( + address _from, + uint256 _amountLD, + uint256 _minAmountLD, + uint32 _dstEid + ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) { + (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid); + + address spender = _msgSender(); + if (_from != spender) { + int256 response = HederaTokenService.approve(htsTokenAddress, spender, amountSentLD); + require(response == HederaResponseCodes.SUCCESS, "HTS: Approve failed"); + } + + (int256 response,) = HederaTokenService.burnToken(htsTokenAddress, int64(uint64(amountSentLD)), new int64[](0)); + require(response == HederaResponseCodes.SUCCESS, "HTS: Burn failed"); + } + + /** + * @dev Credits tokens to the specified address. + * @param _to The address to credit the tokens to. + * @param _amountLD The amount of tokens to credit in local decimals. + * @dev _srcEid The source chain ID. + * @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals. + */ + function _credit( + address _to, + uint256 _amountLD, + uint32 /*_srcEid*/ + ) internal virtual override returns (uint256) { + (int256 response, ,) = HederaTokenService.mintToken(htsTokenAddress, int64(uint64(_amountLD)), new bytes[](0)); + require(response == HederaResponseCodes.SUCCESS, "HTS: Mint failed"); + + int256 transferResponse = HederaTokenService.transferToken(htsTokenAddress, address(this), _to, int64(uint64(_amountLD))); + require(transferResponse == HederaResponseCodes.SUCCESS, "HTS: Transfer failed"); + + return _amountLD; + } +} diff --git a/tools/layer-zero-example/contracts/hts/ExpiryHelper.sol b/tools/layer-zero-example/contracts/hts/ExpiryHelper.sol new file mode 100644 index 0000000000..9ae1405141 --- /dev/null +++ b/tools/layer-zero-example/contracts/hts/ExpiryHelper.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity >=0.5.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./HederaTokenService.sol"; + +abstract contract ExpiryHelper { + function createAutoRenewExpiry( + address autoRenewAccount, + int64 autoRenewPeriod + ) internal pure returns (IHederaTokenService.Expiry memory expiry) { + expiry.autoRenewAccount = autoRenewAccount; + expiry.autoRenewPeriod = autoRenewPeriod; + } + + function createSecondExpiry( + int64 second + ) internal pure returns (IHederaTokenService.Expiry memory expiry) { + expiry.second = second; + } +} diff --git a/tools/layer-zero-example/contracts/hts/HederaResponseCodes.sol b/tools/layer-zero-example/contracts/hts/HederaResponseCodes.sol new file mode 100644 index 0000000000..2633baa4f8 --- /dev/null +++ b/tools/layer-zero-example/contracts/hts/HederaResponseCodes.sol @@ -0,0 +1,330 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity >=0.4.9 <0.9.0; + +library HederaResponseCodes { + // response codes + int32 internal constant OK = 0; // The transaction passed the precheck validations. + int32 internal constant INVALID_TRANSACTION = 1; // For any error not handled by specific error codes listed below. + int32 internal constant PAYER_ACCOUNT_NOT_FOUND = 2; //Payer account does not exist. + int32 internal constant INVALID_NODE_ACCOUNT = 3; //Node Account provided does not match the node account of the node the transaction was submitted to. + int32 internal constant TRANSACTION_EXPIRED = 4; // Pre-Check error when TransactionValidStart + transactionValidDuration is less than current consensus time. + int32 internal constant INVALID_TRANSACTION_START = 5; // Transaction start time is greater than current consensus time + int32 internal constant INVALID_TRANSACTION_DURATION = 6; //valid transaction duration is a positive non zero number that does not exceed 120 seconds + int32 internal constant INVALID_SIGNATURE = 7; // The transaction signature is not valid + int32 internal constant MEMO_TOO_LONG = 8; //Transaction memo size exceeded 100 bytes + int32 internal constant INSUFFICIENT_TX_FEE = 9; // The fee provided in the transaction is insufficient for this type of transaction + int32 internal constant INSUFFICIENT_PAYER_BALANCE = 10; // The payer account has insufficient cryptocurrency to pay the transaction fee + int32 internal constant DUPLICATE_TRANSACTION = 11; // This transaction ID is a duplicate of one that was submitted to this node or reached consensus in the last 180 seconds (receipt period) + int32 internal constant BUSY = 12; //If API is throttled out + int32 internal constant NOT_SUPPORTED = 13; //The API is not currently supported + + int32 internal constant INVALID_FILE_ID = 14; //The file id is invalid or does not exist + int32 internal constant INVALID_ACCOUNT_ID = 15; //The account id is invalid or does not exist + int32 internal constant INVALID_CONTRACT_ID = 16; //The contract id is invalid or does not exist + int32 internal constant INVALID_TRANSACTION_ID = 17; //Transaction id is not valid + int32 internal constant RECEIPT_NOT_FOUND = 18; //Receipt for given transaction id does not exist + int32 internal constant RECORD_NOT_FOUND = 19; //Record for given transaction id does not exist + int32 internal constant INVALID_SOLIDITY_ID = 20; //The solidity id is invalid or entity with this solidity id does not exist + + int32 internal constant UNKNOWN = 21; // The responding node has submitted the transaction to the network. Its final status is still unknown. + int32 internal constant SUCCESS = 22; // The transaction succeeded + int32 internal constant FAIL_INVALID = 23; // There was a system error and the transaction failed because of invalid request parameters. + int32 internal constant FAIL_FEE = 24; // There was a system error while performing fee calculation, reserved for future. + int32 internal constant FAIL_BALANCE = 25; // There was a system error while performing balance checks, reserved for future. + + int32 internal constant KEY_REQUIRED = 26; //Key not provided in the transaction body + int32 internal constant BAD_ENCODING = 27; //Unsupported algorithm/encoding used for keys in the transaction + int32 internal constant INSUFFICIENT_ACCOUNT_BALANCE = 28; //When the account balance is not sufficient for the transfer + int32 internal constant INVALID_SOLIDITY_ADDRESS = 29; //During an update transaction when the system is not able to find the Users Solidity address + + int32 internal constant INSUFFICIENT_GAS = 30; //Not enough gas was supplied to execute transaction + int32 internal constant CONTRACT_SIZE_LIMIT_EXCEEDED = 31; //contract byte code size is over the limit + int32 internal constant LOCAL_CALL_MODIFICATION_EXCEPTION = 32; //local execution (query) is requested for a function which changes state + int32 internal constant CONTRACT_REVERT_EXECUTED = 33; //Contract REVERT OPCODE executed + int32 internal constant CONTRACT_EXECUTION_EXCEPTION = 34; //For any contract execution related error not handled by specific error codes listed above. + int32 internal constant INVALID_RECEIVING_NODE_ACCOUNT = 35; //In Query validation, account with +ve(amount) value should be Receiving node account, the receiver account should be only one account in the list + int32 internal constant MISSING_QUERY_HEADER = 36; // Header is missing in Query request + + int32 internal constant ACCOUNT_UPDATE_FAILED = 37; // The update of the account failed + int32 internal constant INVALID_KEY_ENCODING = 38; // Provided key encoding was not supported by the system + int32 internal constant NULL_SOLIDITY_ADDRESS = 39; // null solidity address + + int32 internal constant CONTRACT_UPDATE_FAILED = 40; // update of the contract failed + int32 internal constant INVALID_QUERY_HEADER = 41; // the query header is invalid + + int32 internal constant INVALID_FEE_SUBMITTED = 42; // Invalid fee submitted + int32 internal constant INVALID_PAYER_SIGNATURE = 43; // Payer signature is invalid + + int32 internal constant KEY_NOT_PROVIDED = 44; // The keys were not provided in the request. + int32 internal constant INVALID_EXPIRATION_TIME = 45; // Expiration time provided in the transaction was invalid. + int32 internal constant NO_WACL_KEY = 46; //WriteAccess Control Keys are not provided for the file + int32 internal constant FILE_CONTENT_EMPTY = 47; //The contents of file are provided as empty. + int32 internal constant INVALID_ACCOUNT_AMOUNTS = 48; // The crypto transfer credit and debit do not sum equal to 0 + int32 internal constant EMPTY_TRANSACTION_BODY = 49; // Transaction body provided is empty + int32 internal constant INVALID_TRANSACTION_BODY = 50; // Invalid transaction body provided + + int32 internal constant INVALID_SIGNATURE_TYPE_MISMATCHING_KEY = 51; // the type of key (base ed25519 key, KeyList, or ThresholdKey) does not match the type of signature (base ed25519 signature, SignatureList, or ThresholdKeySignature) + int32 internal constant INVALID_SIGNATURE_COUNT_MISMATCHING_KEY = 52; // the number of key (KeyList, or ThresholdKey) does not match that of signature (SignatureList, or ThresholdKeySignature). e.g. if a keyList has 3 base keys, then the corresponding signatureList should also have 3 base signatures. + + int32 internal constant EMPTY_LIVE_HASH_BODY = 53; // the livehash body is empty + int32 internal constant EMPTY_LIVE_HASH = 54; // the livehash data is missing + int32 internal constant EMPTY_LIVE_HASH_KEYS = 55; // the keys for a livehash are missing + int32 internal constant INVALID_LIVE_HASH_SIZE = 56; // the livehash data is not the output of a SHA-384 digest + + int32 internal constant EMPTY_QUERY_BODY = 57; // the query body is empty + int32 internal constant EMPTY_LIVE_HASH_QUERY = 58; // the crypto livehash query is empty + int32 internal constant LIVE_HASH_NOT_FOUND = 59; // the livehash is not present + int32 internal constant ACCOUNT_ID_DOES_NOT_EXIST = 60; // the account id passed has not yet been created. + int32 internal constant LIVE_HASH_ALREADY_EXISTS = 61; // the livehash already exists for a given account + + int32 internal constant INVALID_FILE_WACL = 62; // File WACL keys are invalid + int32 internal constant SERIALIZATION_FAILED = 63; // Serialization failure + int32 internal constant TRANSACTION_OVERSIZE = 64; // The size of the Transaction is greater than transactionMaxBytes + int32 internal constant TRANSACTION_TOO_MANY_LAYERS = 65; // The Transaction has more than 50 levels + int32 internal constant CONTRACT_DELETED = 66; //Contract is marked as deleted + + int32 internal constant PLATFORM_NOT_ACTIVE = 67; // the platform node is either disconnected or lagging behind. + int32 internal constant KEY_PREFIX_MISMATCH = 68; // one internal key matches more than one prefixes on the signature map + int32 internal constant PLATFORM_TRANSACTION_NOT_CREATED = 69; // transaction not created by platform due to large backlog + int32 internal constant INVALID_RENEWAL_PERIOD = 70; // auto renewal period is not a positive number of seconds + int32 internal constant INVALID_PAYER_ACCOUNT_ID = 71; // the response code when a smart contract id is passed for a crypto API request + int32 internal constant ACCOUNT_DELETED = 72; // the account has been marked as deleted + int32 internal constant FILE_DELETED = 73; // the file has been marked as deleted + int32 internal constant ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS = 74; // same accounts repeated in the transfer account list + int32 internal constant SETTING_NEGATIVE_ACCOUNT_BALANCE = 75; // attempting to set negative balance value for crypto account + int32 internal constant OBTAINER_REQUIRED = 76; // when deleting smart contract that has crypto balance either transfer account or transfer smart contract is required + int32 internal constant OBTAINER_SAME_CONTRACT_ID = 77; //when deleting smart contract that has crypto balance you can not use the same contract id as transferContractId as the one being deleted + int32 internal constant OBTAINER_DOES_NOT_EXIST = 78; //transferAccountId or transferContractId specified for contract delete does not exist + int32 internal constant MODIFYING_IMMUTABLE_CONTRACT = 79; //attempting to modify (update or delete a immutable smart contract, i.e. one created without a admin key) + int32 internal constant FILE_SYSTEM_EXCEPTION = 80; //Unexpected exception thrown by file system functions + int32 internal constant AUTORENEW_DURATION_NOT_IN_RANGE = 81; // the duration is not a subset of [MINIMUM_AUTORENEW_DURATION,MAXIMUM_AUTORENEW_DURATION] + int32 internal constant ERROR_DECODING_BYTESTRING = 82; // Decoding the smart contract binary to a byte array failed. Check that the input is a valid hex string. + int32 internal constant CONTRACT_FILE_EMPTY = 83; // File to create a smart contract was of length zero + int32 internal constant CONTRACT_BYTECODE_EMPTY = 84; // Bytecode for smart contract is of length zero + int32 internal constant INVALID_INITIAL_BALANCE = 85; // Attempt to set negative initial balance + int32 internal constant INVALID_RECEIVE_RECORD_THRESHOLD = 86; // [Deprecated]. attempt to set negative receive record threshold + int32 internal constant INVALID_SEND_RECORD_THRESHOLD = 87; // [Deprecated]. attempt to set negative send record threshold + int32 internal constant ACCOUNT_IS_NOT_GENESIS_ACCOUNT = 88; // Special Account Operations should be performed by only Genesis account, return this code if it is not Genesis Account + int32 internal constant PAYER_ACCOUNT_UNAUTHORIZED = 89; // The fee payer account doesn't have permission to submit such Transaction + int32 internal constant INVALID_FREEZE_TRANSACTION_BODY = 90; // FreezeTransactionBody is invalid + int32 internal constant FREEZE_TRANSACTION_BODY_NOT_FOUND = 91; // FreezeTransactionBody does not exist + int32 internal constant TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 92; //Exceeded the number of accounts (both from and to) allowed for crypto transfer list + int32 internal constant RESULT_SIZE_LIMIT_EXCEEDED = 93; // Smart contract result size greater than specified maxResultSize + int32 internal constant NOT_SPECIAL_ACCOUNT = 94; //The payer account is not a special account(account 0.0.55) + int32 internal constant CONTRACT_NEGATIVE_GAS = 95; // Negative gas was offered in smart contract call + int32 internal constant CONTRACT_NEGATIVE_VALUE = 96; // Negative value / initial balance was specified in a smart contract call / create + int32 internal constant INVALID_FEE_FILE = 97; // Failed to update fee file + int32 internal constant INVALID_EXCHANGE_RATE_FILE = 98; // Failed to update exchange rate file + int32 internal constant INSUFFICIENT_LOCAL_CALL_GAS = 99; // Payment tendered for contract local call cannot cover both the fee and the gas + int32 internal constant ENTITY_NOT_ALLOWED_TO_DELETE = 100; // Entities with Entity ID below 1000 are not allowed to be deleted + int32 internal constant AUTHORIZATION_FAILED = 101; // Violating one of these rules: 1) treasury account can update all entities below 0.0.1000, 2) account 0.0.50 can update all entities from 0.0.51 - 0.0.80, 3) Network Function Master Account A/c 0.0.50 - Update all Network Function accounts & perform all the Network Functions listed below, 4) Network Function Accounts: i) A/c 0.0.55 - Update Address Book files (0.0.101/102), ii) A/c 0.0.56 - Update Fee schedule (0.0.111), iii) A/c 0.0.57 - Update Exchange Rate (0.0.112). + int32 internal constant FILE_UPLOADED_PROTO_INVALID = 102; // Fee Schedule Proto uploaded but not valid (append or update is required) + int32 internal constant FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK = 103; // Fee Schedule Proto uploaded but not valid (append or update is required) + int32 internal constant FEE_SCHEDULE_FILE_PART_UPLOADED = 104; // Fee Schedule Proto File Part uploaded + int32 internal constant EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED = 105; // The change on Exchange Rate exceeds Exchange_Rate_Allowed_Percentage + int32 internal constant MAX_CONTRACT_STORAGE_EXCEEDED = 106; // Contract permanent storage exceeded the currently allowable limit + int32 internal constant TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT = 107; // Transfer Account should not be same as Account to be deleted + int32 internal constant TOTAL_LEDGER_BALANCE_INVALID = 108; + int32 internal constant EXPIRATION_REDUCTION_NOT_ALLOWED = 110; // The expiration date/time on a smart contract may not be reduced + int32 internal constant MAX_GAS_LIMIT_EXCEEDED = 111; //Gas exceeded currently allowable gas limit per transaction + int32 internal constant MAX_FILE_SIZE_EXCEEDED = 112; // File size exceeded the currently allowable limit + + int32 internal constant INVALID_TOPIC_ID = 150; // The Topic ID specified is not in the system. + int32 internal constant INVALID_ADMIN_KEY = 155; // A provided admin key was invalid. + int32 internal constant INVALID_SUBMIT_KEY = 156; // A provided submit key was invalid. + int32 internal constant UNAUTHORIZED = 157; // An attempted operation was not authorized (ie - a deleteTopic for a topic with no adminKey). + int32 internal constant INVALID_TOPIC_MESSAGE = 158; // A ConsensusService message is empty. + int32 internal constant INVALID_AUTORENEW_ACCOUNT = 159; // The autoRenewAccount specified is not a valid, active account. + int32 internal constant AUTORENEW_ACCOUNT_NOT_ALLOWED = 160; // An adminKey was not specified on the topic, so there must not be an autoRenewAccount. + // The topic has expired, was not automatically renewed, and is in a 7 day grace period before the topic will be + // deleted unrecoverably. This error response code will not be returned until autoRenew functionality is supported + // by HAPI. + int32 internal constant TOPIC_EXPIRED = 162; + int32 internal constant INVALID_CHUNK_NUMBER = 163; // chunk number must be from 1 to total (chunks) inclusive. + int32 internal constant INVALID_CHUNK_TRANSACTION_ID = 164; // For every chunk, the payer account that is part of initialTransactionID must match the Payer Account of this transaction. The entire initialTransactionID should match the transactionID of the first chunk, but this is not checked or enforced by Hedera except when the chunk number is 1. + int32 internal constant ACCOUNT_FROZEN_FOR_TOKEN = 165; // Account is frozen and cannot transact with the token + int32 internal constant TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED = 166; // An involved account already has more than tokens.maxPerAccount associations with non-deleted tokens. + int32 internal constant INVALID_TOKEN_ID = 167; // The token is invalid or does not exist + int32 internal constant INVALID_TOKEN_DECIMALS = 168; // Invalid token decimals + int32 internal constant INVALID_TOKEN_INITIAL_SUPPLY = 169; // Invalid token initial supply + int32 internal constant INVALID_TREASURY_ACCOUNT_FOR_TOKEN = 170; // Treasury Account does not exist or is deleted + int32 internal constant INVALID_TOKEN_SYMBOL = 171; // Token Symbol is not UTF-8 capitalized alphabetical string + int32 internal constant TOKEN_HAS_NO_FREEZE_KEY = 172; // Freeze key is not set on token + int32 internal constant TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN = 173; // Amounts in transfer list are not net zero + int32 internal constant MISSING_TOKEN_SYMBOL = 174; // A token symbol was not provided + int32 internal constant TOKEN_SYMBOL_TOO_LONG = 175; // The provided token symbol was too long + int32 internal constant ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN = 176; // KYC must be granted and account does not have KYC granted + int32 internal constant TOKEN_HAS_NO_KYC_KEY = 177; // KYC key is not set on token + int32 internal constant INSUFFICIENT_TOKEN_BALANCE = 178; // Token balance is not sufficient for the transaction + int32 internal constant TOKEN_WAS_DELETED = 179; // Token transactions cannot be executed on deleted token + int32 internal constant TOKEN_HAS_NO_SUPPLY_KEY = 180; // Supply key is not set on token + int32 internal constant TOKEN_HAS_NO_WIPE_KEY = 181; // Wipe key is not set on token + int32 internal constant INVALID_TOKEN_MINT_AMOUNT = 182; // The requested token mint amount would cause an invalid total supply + int32 internal constant INVALID_TOKEN_BURN_AMOUNT = 183; // The requested token burn amount would cause an invalid total supply + int32 internal constant TOKEN_NOT_ASSOCIATED_TO_ACCOUNT = 184; // A required token-account relationship is missing + int32 internal constant CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT = 185; // The target of a wipe operation was the token treasury account + int32 internal constant INVALID_KYC_KEY = 186; // The provided KYC key was invalid. + int32 internal constant INVALID_WIPE_KEY = 187; // The provided wipe key was invalid. + int32 internal constant INVALID_FREEZE_KEY = 188; // The provided freeze key was invalid. + int32 internal constant INVALID_SUPPLY_KEY = 189; // The provided supply key was invalid. + int32 internal constant MISSING_TOKEN_NAME = 190; // Token Name is not provided + int32 internal constant TOKEN_NAME_TOO_LONG = 191; // Token Name is too long + int32 internal constant INVALID_WIPING_AMOUNT = 192; // The provided wipe amount must not be negative, zero or bigger than the token holder balance + int32 internal constant TOKEN_IS_IMMUTABLE = 193; // Token does not have Admin key set, thus update/delete transactions cannot be performed + int32 internal constant TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT = 194; // An associateToken operation specified a token already associated to the account + int32 internal constant TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES = 195; // An attempted operation is invalid until all token balances for the target account are zero + int32 internal constant ACCOUNT_IS_TREASURY = 196; // An attempted operation is invalid because the account is a treasury + int32 internal constant TOKEN_ID_REPEATED_IN_TOKEN_LIST = 197; // Same TokenIDs present in the token list + int32 internal constant TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 198; // Exceeded the number of token transfers (both from and to) allowed for token transfer list + int32 internal constant EMPTY_TOKEN_TRANSFER_BODY = 199; // TokenTransfersTransactionBody has no TokenTransferList + int32 internal constant EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS = 200; // TokenTransfersTransactionBody has a TokenTransferList with no AccountAmounts + int32 internal constant INVALID_SCHEDULE_ID = 201; // The Scheduled entity does not exist; or has now expired, been deleted, or been executed + int32 internal constant SCHEDULE_IS_IMMUTABLE = 202; // The Scheduled entity cannot be modified. Admin key not set + int32 internal constant INVALID_SCHEDULE_PAYER_ID = 203; // The provided Scheduled Payer does not exist + int32 internal constant INVALID_SCHEDULE_ACCOUNT_ID = 204; // The Schedule Create Transaction TransactionID account does not exist + int32 internal constant NO_NEW_VALID_SIGNATURES = 205; // The provided sig map did not contain any new valid signatures from required signers of the scheduled transaction + int32 internal constant UNRESOLVABLE_REQUIRED_SIGNERS = 206; // The required signers for a scheduled transaction cannot be resolved, for example because they do not exist or have been deleted + int32 internal constant SCHEDULED_TRANSACTION_NOT_IN_WHITELIST = 207; // Only whitelisted transaction types may be scheduled + int32 internal constant SOME_SIGNATURES_WERE_INVALID = 208; // At least one of the signatures in the provided sig map did not represent a valid signature for any required signer + int32 internal constant TRANSACTION_ID_FIELD_NOT_ALLOWED = 209; // The scheduled field in the TransactionID may not be set to true + int32 internal constant IDENTICAL_SCHEDULE_ALREADY_CREATED = 210; // A schedule already exists with the same identifying fields of an attempted ScheduleCreate (that is, all fields other than scheduledPayerAccountID) + int32 internal constant INVALID_ZERO_BYTE_IN_STRING = 211; // A string field in the transaction has a UTF-8 encoding with the prohibited zero byte + int32 internal constant SCHEDULE_ALREADY_DELETED = 212; // A schedule being signed or deleted has already been deleted + int32 internal constant SCHEDULE_ALREADY_EXECUTED = 213; // A schedule being signed or deleted has already been executed + int32 internal constant MESSAGE_SIZE_TOO_LARGE = 214; // ConsensusSubmitMessage request's message size is larger than allowed. + int32 internal constant OPERATION_REPEATED_IN_BUCKET_GROUPS = 215; // An operation was assigned to more than one throttle group in a given bucket + int32 internal constant BUCKET_CAPACITY_OVERFLOW = 216; // The capacity needed to satisfy all opsPerSec groups in a bucket overflowed a signed 8-byte integral type + int32 internal constant NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION = 217; // Given the network size in the address book, the node-level capacity for an operation would never be enough to accept a single request; usually means a bucket burstPeriod should be increased + int32 internal constant BUCKET_HAS_NO_THROTTLE_GROUPS = 218; // A bucket was defined without any throttle groups + int32 internal constant THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC = 219; // A throttle group was granted zero opsPerSec + int32 internal constant SUCCESS_BUT_MISSING_EXPECTED_OPERATION = 220; // The throttle definitions file was updated, but some supported operations were not assigned a bucket + int32 internal constant UNPARSEABLE_THROTTLE_DEFINITIONS = 221; // The new contents for the throttle definitions system file were not valid protobuf + int32 internal constant INVALID_THROTTLE_DEFINITIONS = 222; // The new throttle definitions system file were invalid, and no more specific error could be divined + int32 internal constant ACCOUNT_EXPIRED_AND_PENDING_REMOVAL = 223; // The transaction references an account which has passed its expiration without renewal funds available, and currently remains in the ledger only because of the grace period given to expired entities + int32 internal constant INVALID_TOKEN_MAX_SUPPLY = 224; // Invalid token max supply + int32 internal constant INVALID_TOKEN_NFT_SERIAL_NUMBER = 225; // Invalid token nft serial number + int32 internal constant INVALID_NFT_ID = 226; // Invalid nft id + int32 internal constant METADATA_TOO_LONG = 227; // Nft metadata is too long + int32 internal constant BATCH_SIZE_LIMIT_EXCEEDED = 228; // Repeated operations count exceeds the limit + int32 internal constant INVALID_QUERY_RANGE = 229; // The range of data to be gathered is out of the set boundaries + int32 internal constant FRACTION_DIVIDES_BY_ZERO = 230; // A custom fractional fee set a denominator of zero + int32 internal constant INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE = 231; // The transaction payer could not afford a custom fee + int32 internal constant CUSTOM_FEES_LIST_TOO_LONG = 232; // More than 10 custom fees were specified + int32 internal constant INVALID_CUSTOM_FEE_COLLECTOR = 233; // Any of the feeCollector accounts for customFees is invalid + int32 internal constant INVALID_TOKEN_ID_IN_CUSTOM_FEES = 234; // Any of the token Ids in customFees is invalid + int32 internal constant TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR = 235; // Any of the token Ids in customFees are not associated to feeCollector + int32 internal constant TOKEN_MAX_SUPPLY_REACHED = 236; // A token cannot have more units minted due to its configured supply ceiling + int32 internal constant SENDER_DOES_NOT_OWN_NFT_SERIAL_NO = 237; // The transaction attempted to move an NFT serial number from an account other than its owner + int32 internal constant CUSTOM_FEE_NOT_FULLY_SPECIFIED = 238; // A custom fee schedule entry did not specify either a fixed or fractional fee + int32 internal constant CUSTOM_FEE_MUST_BE_POSITIVE = 239; // Only positive fees may be assessed at this time + int32 internal constant TOKEN_HAS_NO_FEE_SCHEDULE_KEY = 240; // Fee schedule key is not set on token + int32 internal constant CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE = 241; // A fractional custom fee exceeded the range of a 64-bit signed integer + int32 internal constant ROYALTY_FRACTION_CANNOT_EXCEED_ONE = 242; // A royalty cannot exceed the total fungible value exchanged for an NFT + int32 internal constant FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT = + 243; // Each fractional custom fee must have its maximum_amount, if specified, at least its minimum_amount + int32 internal constant CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES = 244; // A fee schedule update tried to clear the custom fees from a token whose fee schedule was already empty + int32 internal constant CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON = + 245; // Only tokens of type FUNGIBLE_COMMON can be used to as fee schedule denominations + int32 + internal constant CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = + 246; // Only tokens of type FUNGIBLE_COMMON can have fractional fees + int32 internal constant INVALID_CUSTOM_FEE_SCHEDULE_KEY = 247; // The provided custom fee schedule key was invalid + int32 internal constant INVALID_TOKEN_MINT_METADATA = 248; // The requested token mint metadata was invalid + int32 internal constant INVALID_TOKEN_BURN_METADATA = 249; // The requested token burn metadata was invalid + int32 internal constant CURRENT_TREASURY_STILL_OWNS_NFTS = 250; // The treasury for a unique token cannot be changed until it owns no NFTs + int32 internal constant ACCOUNT_STILL_OWNS_NFTS = 251; // An account cannot be dissociated from a unique token if it owns NFTs for the token + int32 internal constant TREASURY_MUST_OWN_BURNED_NFT = 252; // A NFT can only be burned when owned by the unique token's treasury + int32 internal constant ACCOUNT_DOES_NOT_OWN_WIPED_NFT = 253; // An account did not own the NFT to be wiped + int32 + internal constant ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = + 254; // An AccountAmount token transfers list referenced a token type other than FUNGIBLE_COMMON + int32 internal constant MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED = 255; // All the NFTs allowed in the current price regime have already been minted + int32 internal constant PAYER_ACCOUNT_DELETED = 256; // The payer account has been marked as deleted + int32 internal constant CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH = + 257; // The reference chain of custom fees for a transferred token exceeded the maximum length of 2 + int32 internal constant CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS = + 258; // More than 20 balance adjustments were to satisfy a CryptoTransfer and its implied custom fee payments + int32 internal constant INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE = + 259; // The sender account in the token transfer transaction could not afford a custom fee + int32 internal constant SERIAL_NUMBER_LIMIT_REACHED = 260; // Currently no more than 4,294,967,295 NFTs may be minted for a given unique token type + int32 + internal constant CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE = + 261; // Only tokens of type NON_FUNGIBLE_UNIQUE can have royalty fees + int32 internal constant NO_REMAINING_AUTOMATIC_ASSOCIATIONS = 262; // The account has reached the limit on the automatic associations count. + int32 internal constant EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT = + 263; // Already existing automatic associations are more than the new maximum automatic associations. + int32 + internal constant REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT = + 264; // Cannot set the number of automatic associations for an account more than the maximum allowed tokens.maxPerAccount. + int32 internal constant TOKEN_IS_PAUSED = 265; // Token is paused. This Token cannot be a part of any kind of Transaction until unpaused. + int32 internal constant TOKEN_HAS_NO_PAUSE_KEY = 266; // Pause key is not set on token + int32 internal constant INVALID_PAUSE_KEY = 267; // The provided pause key was invalid + int32 internal constant FREEZE_UPDATE_FILE_DOES_NOT_EXIST = 268; // The update file in a freeze transaction body must exist. + int32 internal constant FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH = 269; // The hash of the update file in a freeze transaction body must match the in-memory hash. + int32 internal constant NO_UPGRADE_HAS_BEEN_PREPARED = 270; // A FREEZE_UPGRADE transaction was handled with no previous update prepared. + int32 internal constant NO_FREEZE_IS_SCHEDULED = 271; // A FREEZE_ABORT transaction was handled with no scheduled freeze. + int32 internal constant UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE = + 272; // The update file hash when handling a FREEZE_UPGRADE transaction differs from the file hash at the time of handling the PREPARE_UPGRADE transaction. + int32 internal constant FREEZE_START_TIME_MUST_BE_FUTURE = 273; // The given freeze start time was in the (consensus) past. + int32 internal constant PREPARED_UPDATE_FILE_IS_IMMUTABLE = 274; // The prepared update file cannot be updated or appended until either the upgrade has been completed, or a FREEZE_ABORT has been handled. + int32 internal constant FREEZE_ALREADY_SCHEDULED = 275; // Once a freeze is scheduled, it must be aborted before any other type of freeze can be performed. + int32 internal constant FREEZE_UPGRADE_IN_PROGRESS = 276; // If an NMT upgrade has been prepared, the following operation must be a FREEZE_UPGRADE (To issue a FREEZE_ONLY, submit a FREEZE_ABORT first.) + int32 internal constant UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED = 277; // If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must confirm the id of the file to be used in the upgrade. + int32 internal constant UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED = 278; // If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must confirm the hash of the file to be used in the upgrade. + int32 internal constant CONSENSUS_GAS_EXHAUSTED = 279; // Consensus throttle did not allow execution of this transaction. System is throttled at consensus level. + int32 internal constant REVERTED_SUCCESS = 280; // A precompiled contract succeeded, but was later reverted. + int32 internal constant MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED = 281; // All contract storage allocated to the current price regime has been consumed. + int32 internal constant INVALID_ALIAS_KEY = 282; // An alias used in a CryptoTransfer transaction is not the serialization of a primitive Key message -- that is, a Key with a single Ed25519 or ECDSA(secp256k1) public key and no unknown protobuf fields. + int32 internal constant UNEXPECTED_TOKEN_DECIMALS = 283; // A fungible token transfer expected a different number of decimals than the involved type actually has. + int32 internal constant INVALID_PROXY_ACCOUNT_ID = 284; // [Deprecated] The proxy account id is invalid or does not exist. + int32 internal constant INVALID_TRANSFER_ACCOUNT_ID = 285; // The transfer account id in CryptoDelete transaction is invalid or does not exist. + int32 internal constant INVALID_FEE_COLLECTOR_ACCOUNT_ID = 286; // The fee collector account id in TokenFeeScheduleUpdate is invalid or does not exist. + int32 internal constant ALIAS_IS_IMMUTABLE = 287; // The alias already set on an account cannot be updated using CryptoUpdate transaction. + int32 internal constant SPENDER_ACCOUNT_SAME_AS_OWNER = 288; // An approved allowance specifies a spender account that is the same as the hbar/token owner account. + int32 internal constant AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY = 289; // The establishment or adjustment of an approved allowance cause the token allowance to exceed the token maximum supply. + int32 internal constant NEGATIVE_ALLOWANCE_AMOUNT = 290; // The specified amount for an approved allowance cannot be negative. + int32 internal constant CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON = 291; // [Deprecated] The approveForAll flag cannot be set for a fungible token. + int32 internal constant SPENDER_DOES_NOT_HAVE_ALLOWANCE = 292; // The spender does not have an existing approved allowance with the hbar/token owner. + int32 internal constant AMOUNT_EXCEEDS_ALLOWANCE = 293; // The transfer amount exceeds the current approved allowance for the spender account. + int32 internal constant MAX_ALLOWANCES_EXCEEDED = 294; // The payer account of an approveAllowances or adjustAllowance transaction is attempting to go beyond the maximum allowed number of allowances. + int32 internal constant EMPTY_ALLOWANCES = 295; // No allowances have been specified in the approval transaction. + int32 internal constant SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES = 296; // [Deprecated] Spender is repeated more than once in Crypto or Token or NFT allowance lists in a single CryptoApproveAllowance transaction. + int32 internal constant REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES = 297; // [Deprecated] Serial numbers are repeated in nft allowance for a single spender account + int32 internal constant FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES = 298; // Fungible common token used in NFT allowances + int32 internal constant NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES = 299; // Non fungible token used in fungible token allowances + int32 internal constant INVALID_ALLOWANCE_OWNER_ID = 300; // The account id specified as the owner is invalid or does not exist. + int32 internal constant INVALID_ALLOWANCE_SPENDER_ID = 301; // The account id specified as the spender is invalid or does not exist. + int32 internal constant REPEATED_ALLOWANCES_TO_DELETE = 302; // [Deprecated] If the CryptoDeleteAllowance transaction has repeated crypto or token or Nft allowances to delete. + int32 internal constant INVALID_DELEGATING_SPENDER = 303; // If the account Id specified as the delegating spender is invalid or does not exist. + int32 internal constant DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL = + 304; // The delegating Spender cannot grant approveForAll allowance on a NFT token type for another spender. + int32 internal constant DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL = + 305; // The delegating Spender cannot grant allowance on a NFT serial for another spender as it doesnt not have approveForAll granted on token-owner. + int32 internal constant SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE = 306; // The scheduled transaction could not be created because it's expiration_time was too far in the future. + int32 + internal constant SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME = + 307; // The scheduled transaction could not be created because it's expiration_time was less than or equal to the consensus time. + int32 internal constant SCHEDULE_FUTURE_THROTTLE_EXCEEDED = 308; // The scheduled transaction could not be created because it would cause throttles to be violated on the specified expiration_time. + int32 internal constant SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED = 309; // The scheduled transaction could not be created because it would cause the gas limit to be violated on the specified expiration_time. + int32 internal constant INVALID_ETHEREUM_TRANSACTION = 310; // The ethereum transaction either failed parsing or failed signature validation, or some other EthereumTransaction error not covered by another response code. + int32 internal constant WRONG_CHAIN_ID = 311; // EthereumTransaction was signed against a chainId that this network does not support. + int32 internal constant WRONG_NONCE = 312; // This transaction specified an ethereumNonce that is not the current ethereumNonce of the account. + int32 internal constant ACCESS_LIST_UNSUPPORTED = 313; // The ethereum transaction specified an access list, which the network does not support. + int32 internal constant SCHEDULE_PENDING_EXPIRATION = 314; // A schedule being signed or deleted has passed it's expiration date and is pending execution if needed and then expiration. + int32 internal constant CONTRACT_IS_TOKEN_TREASURY = 315; // A selfdestruct or ContractDelete targeted a contract that is a token treasury. + int32 internal constant CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES = 316; // A selfdestruct or ContractDelete targeted a contract with non-zero token balances. + int32 internal constant CONTRACT_EXPIRED_AND_PENDING_REMOVAL = 317; // A contract referenced by a transaction is "detached"; that is, expired and lacking any hbar funds for auto-renewal payment---but still within its post-expiry grace period. + int32 internal constant CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT = 318; // A ContractUpdate requested removal of a contract's auto-renew account, but that contract has no auto-renew account. + int32 internal constant PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION = 319; // A delete transaction submitted via HAPI set permanent_removal=true + int32 internal constant PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED = 320; // A CryptoCreate or ContractCreate used the deprecated proxyAccountID field. + int32 internal constant SELF_STAKING_IS_NOT_ALLOWED = 321; // An account set the staked_account_id to itself in CryptoUpdate or ContractUpdate transactions. + int32 internal constant INVALID_STAKING_ID = 322; // The staking account id or staking node id given is invalid or does not exist. + int32 internal constant STAKING_NOT_ENABLED = 323; // Native staking, while implemented, has not yet enabled by the council. + int32 internal constant INVALID_PRNG_RANGE = 324; // The range provided in UtilPrng transaction is negative. + int32 internal constant MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED = + 325; // The maximum number of entities allowed in the current price regime have been created. + int32 internal constant INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE = 326; // The full prefix signature for precompile is not valid + int32 internal constant INSUFFICIENT_BALANCES_FOR_STORAGE_RENT = 327; // The combined balances of a contract and its auto-renew account (if any) did not cover the rent charged for net new storage used in a transaction. + int32 internal constant MAX_CHILD_RECORDS_EXCEEDED = 328; // A contract transaction tried to use more than the allowed number of child records, via either system contract records or internal contract creations. + int32 internal constant INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES = 329; // The combined balances of a contract and its auto-renew account (if any) or balance of an account did not cover the auto-renewal fees in a transaction. +} diff --git a/tools/layer-zero-example/contracts/hts/HederaTokenService.sol b/tools/layer-zero-example/contracts/hts/HederaTokenService.sol new file mode 100644 index 0000000000..cfc7d0be61 --- /dev/null +++ b/tools/layer-zero-example/contracts/hts/HederaTokenService.sol @@ -0,0 +1,274 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity >=0.5.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./HederaResponseCodes.sol"; +import "./IHederaTokenService.sol"; + +abstract contract HederaTokenService { + address constant precompileAddress = address(0x167); + // 90 days in seconds + int32 constant defaultAutoRenewPeriod = 7776000; + + modifier nonEmptyExpiry(IHederaTokenService.HederaToken memory token) { + if (token.expiry.second == 0 && token.expiry.autoRenewPeriod == 0) { + token.expiry.autoRenewPeriod = defaultAutoRenewPeriod; + } + _; + } + + /// Generic event + event CallResponseEvent(bool, bytes); + + /// Performs transfers among combinations of tokens and hbars + /// @param transferList the list of hbar transfers to do + /// @param tokenTransfers the list of transfers to do + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @custom:version 0.3.0 the signature of the previous version was cryptoTransfer(TokenTransferList[] memory tokenTransfers) + function cryptoTransfer( + IHederaTokenService.TransferList memory transferList, + IHederaTokenService.TokenTransferList[] memory tokenTransfers + ) internal returns (int responseCode) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.cryptoTransfer.selector, + transferList, + tokenTransfers + ) + ); + responseCode = success + ? abi.decode(result, (int32)) + : HederaResponseCodes.UNKNOWN; + } + + /// Mints an amount of the token to the defined treasury account + /// @param token The token for which to mint tokens. If token does not exist, transaction results in + /// INVALID_TOKEN_ID + /// @param amount Applicable to tokens of type FUNGIBLE_COMMON. The amount to mint to the Treasury Account. + /// Amount must be a positive non-zero number represented in the lowest denomination of the + /// token. The new supply must be lower than 2^63. + /// @param metadata Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created. + /// Maximum allowed size of each metadata is 100 bytes + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return newTotalSupply The new supply of tokens. For NFTs it is the total count of NFTs + /// @return serialNumbers If the token is an NFT the newly generate serial numbers, otherwise empty. + function mintToken( + address token, + int64 amount, + bytes[] memory metadata + ) + internal + returns ( + int responseCode, + int64 newTotalSupply, + int64[] memory serialNumbers + ) + { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.mintToken.selector, + token, + amount, + metadata + ) + ); + (responseCode, newTotalSupply, serialNumbers) = success + ? abi.decode(result, (int32, int64, int64[])) + : (HederaResponseCodes.UNKNOWN, int64(0), new int64[](0)); + } + + /// Burns an amount of the token from the defined treasury account + /// @param token The token for which to burn tokens. If token does not exist, transaction results in + /// INVALID_TOKEN_ID + /// @param amount Applicable to tokens of type FUNGIBLE_COMMON. The amount to burn from the Treasury Account. + /// Amount must be a positive non-zero number, not bigger than the token balance of the treasury + /// account (0; balance], represented in the lowest denomination. + /// @param serialNumbers Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be burned. + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return newTotalSupply The new supply of tokens. For NFTs it is the total count of NFTs + function burnToken( + address token, + int64 amount, + int64[] memory serialNumbers + ) internal returns (int responseCode, int64 newTotalSupply) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.burnToken.selector, + token, + amount, + serialNumbers + ) + ); + (responseCode, newTotalSupply) = success + ? abi.decode(result, (int32, int64)) + : (HederaResponseCodes.UNKNOWN, int64(0)); + } + + function associateToken( + address account, + address token + ) internal returns (int responseCode) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.associateToken.selector, + account, + token + ) + ); + responseCode = success + ? abi.decode(result, (int32)) + : HederaResponseCodes.UNKNOWN; + } + + function dissociateToken( + address account, + address token + ) internal returns (int responseCode) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.dissociateToken.selector, + account, + token + ) + ); + responseCode = success + ? abi.decode(result, (int32)) + : HederaResponseCodes.UNKNOWN; + } + + /// Creates a Fungible Token with the specified properties + /// @param token the basic properties of the token being created + /// @param initialTotalSupply Specifies the initial supply of tokens to be put in circulation. The + /// initial supply is sent to the Treasury Account. The supply is in the lowest denomination possible. + /// @param decimals the number of decimal places a token is divisible by + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenAddress the created token's address + function createFungibleToken( + IHederaTokenService.HederaToken memory token, + int64 initialTotalSupply, + int32 decimals + ) + internal + nonEmptyExpiry(token) + returns (int responseCode, address tokenAddress) + { + (bool success, bytes memory result) = precompileAddress.call{ + value: msg.value + }( + abi.encodeWithSelector( + IHederaTokenService.createFungibleToken.selector, + token, + initialTotalSupply, + decimals + ) + ); + + (responseCode, tokenAddress) = success + ? abi.decode(result, (int32, address)) + : (HederaResponseCodes.UNKNOWN, address(0)); + } + + /// Retrieves general token info for a given token + /// @param token The ID of the token as a solidity address + /// @dev This function reverts if the call is not successful + function getTokenInfo( + address token + ) + internal + returns ( + int responseCode, + IHederaTokenService.TokenInfo memory tokenInfo + ) + { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.getTokenInfo.selector, + token + ) + ); + IHederaTokenService.TokenInfo memory defaultTokenInfo; + (responseCode, tokenInfo) = success + ? abi.decode(result, (int32, IHederaTokenService.TokenInfo)) + : (HederaResponseCodes.UNKNOWN, defaultTokenInfo); + } + + /// Allows spender to withdraw from your account multiple times, up to the value amount. If this function is called + /// again it overwrites the current allowance with value. + /// Only Applicable to Fungible Tokens + /// @param token The hedera token address to approve + /// @param spender the account authorized to spend + /// @param amount the amount of tokens authorized to spend. + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function approve( + address token, + address spender, + uint256 amount + ) internal returns (int responseCode) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.approve.selector, + token, + spender, + amount + ) + ); + responseCode = success + ? abi.decode(result, (int32)) + : HederaResponseCodes.UNKNOWN; + } + + /// Transfers `amount` tokens from `from` to `to` using the + // allowance mechanism. `amount` is then deducted from the caller's allowance. + /// Only applicable to fungible tokens + /// @param token The address of the fungible Hedera token to transfer + /// @param from The account address of the owner of the token, on the behalf of which to transfer `amount` tokens + /// @param to The account address of the receiver of the `amount` tokens + /// @param amount The amount of tokens to transfer from `from` to `to` + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function transferFrom( + address token, + address from, + address to, + uint256 amount + ) external returns (int64 responseCode) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.transferFrom.selector, + token, + from, + to, + amount + ) + ); + responseCode = success + ? abi.decode(result, (int32)) + : HederaResponseCodes.UNKNOWN; + } + + /// Transfers tokens where the calling account/contract is implicitly the first entry in the token transfer list, + /// where the amount is the value needed to zero balance the transfers. Regular signing rules apply for sending + /// (positive amount) or receiving (negative amount) + /// @param token The token to transfer to/from + /// @param sender The sender for the transaction + /// @param receiver The receiver of the transaction + /// @param amount Non-negative value to send. a negative value will result in a failure. + function transferToken( + address token, + address sender, + address receiver, + int64 amount + ) internal returns (int responseCode) { + (bool success, bytes memory result) = precompileAddress.call( + abi.encodeWithSelector( + IHederaTokenService.transferToken.selector, + token, + sender, + receiver, + amount + ) + ); + responseCode = success + ? abi.decode(result, (int32)) + : HederaResponseCodes.UNKNOWN; + } +} diff --git a/tools/layer-zero-example/contracts/hts/IHederaTokenService.sol b/tools/layer-zero-example/contracts/hts/IHederaTokenService.sol new file mode 100644 index 0000000000..8d0c56e2c3 --- /dev/null +++ b/tools/layer-zero-example/contracts/hts/IHederaTokenService.sol @@ -0,0 +1,799 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity >=0.4.9 <0.9.0; +pragma experimental ABIEncoderV2; + +interface IHederaTokenService { + /// Transfers cryptocurrency among two or more accounts by making the desired adjustments to their + /// balances. Each transfer list can specify up to 10 adjustments. Each negative amount is withdrawn + /// from the corresponding account (a sender), and each positive one is added to the corresponding + /// account (a receiver). The amounts list must sum to zero. Each amount is a number of tinybars + /// (there are 100,000,000 tinybars in one hbar). If any sender account fails to have sufficient + /// hbars, then the entire transaction fails, and none of those transfers occur, though the + /// transaction fee is still charged. This transaction must be signed by the keys for all the sending + /// accounts, and for any receiving accounts that have receiverSigRequired == true. The signatures + /// are in the same order as the accounts, skipping those accounts that don't need a signature. + /// @custom:version 0.3.0 previous version did not include isApproval + struct AccountAmount { + // The Account ID, as a solidity address, that sends/receives cryptocurrency or tokens + address accountID; + // The amount of the lowest denomination of the given token that + // the account sends(negative) or receives(positive) + int64 amount; + // If true then the transfer is expected to be an approved allowance and the + // accountID is expected to be the owner. The default is false (omitted). + bool isApproval; + } + + /// A sender account, a receiver account, and the serial number of an NFT of a Token with + /// NON_FUNGIBLE_UNIQUE type. When minting NFTs the sender will be the default AccountID instance + /// (0.0.0 aka 0x0) and when burning NFTs, the receiver will be the default AccountID instance. + /// @custom:version 0.3.0 previous version did not include isApproval + struct NftTransfer { + // The solidity address of the sender + address senderAccountID; + // The solidity address of the receiver + address receiverAccountID; + // The serial number of the NFT + int64 serialNumber; + // If true then the transfer is expected to be an approved allowance and the + // accountID is expected to be the owner. The default is false (omitted). + bool isApproval; + } + + struct TokenTransferList { + // The ID of the token as a solidity address + address token; + // Applicable to tokens of type FUNGIBLE_COMMON. Multiple list of AccountAmounts, each of which + // has an account and amount. + AccountAmount[] transfers; + // Applicable to tokens of type NON_FUNGIBLE_UNIQUE. Multiple list of NftTransfers, each of + // which has a sender and receiver account, including the serial number of the NFT + NftTransfer[] nftTransfers; + } + + struct TransferList { + // Multiple list of AccountAmounts, each of which has an account and amount. + // Used to transfer hbars between the accounts in the list. + AccountAmount[] transfers; + } + + /// Expiry properties of a Hedera token - second, autoRenewAccount, autoRenewPeriod + struct Expiry { + // The epoch second at which the token should expire; if an auto-renew account and period are + // specified, this is coerced to the current epoch second plus the autoRenewPeriod + int64 second; + // ID of an account which will be automatically charged to renew the token's expiration, at + // autoRenewPeriod interval, expressed as a solidity address + address autoRenewAccount; + // The interval at which the auto-renew account will be charged to extend the token's expiry + int64 autoRenewPeriod; + } + + /// A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) signature schemes, where + /// in the ECDSA(secp256k1) case we require the 33-byte compressed form of the public key. We call + /// these public keys primitive keys. + /// A Key can also be the ID of a smart contract instance, which is then authorized to perform any + /// precompiled contract action that requires this key to sign. + /// Note that when a Key is a smart contract ID, it doesn't mean the contract with that ID + /// will actually create a cryptographic signature. It only means that when the contract calls a + /// precompiled contract, the resulting "child transaction" will be authorized to perform any action + /// controlled by the Key. + /// Exactly one of the possible values should be populated in order for the Key to be valid. + struct KeyValue { + // if set to true, the key of the calling Hedera account will be inherited as the token key + bool inheritAccountKey; + // smart contract instance that is authorized as if it had signed with a key + address contractId; + // Ed25519 public key bytes + bytes ed25519; + // Compressed ECDSA(secp256k1) public key bytes + bytes ECDSA_secp256k1; + // A smart contract that, if the recipient of the active message frame, should be treated + // as having signed. (Note this does not mean the code being executed in the frame + // will belong to the given contract, since it could be running another contract's code via + // delegatecall. So setting this key is a more permissive version of setting the + // contractID key, which also requires the code in the active message frame belong to the + // the contract with the given id.) + address delegatableContractId; + } + + /// A list of token key types the key should be applied to and the value of the key + struct TokenKey { + // bit field representing the key type. Keys of all types that have corresponding bits set to 1 + // will be created for the token. + // 0th bit: adminKey + // 1st bit: kycKey + // 2nd bit: freezeKey + // 3rd bit: wipeKey + // 4th bit: supplyKey + // 5th bit: feeScheduleKey + // 6th bit: pauseKey + // 7th bit: ignored + uint keyType; + // the value that will be set to the key type + KeyValue key; + } + + /// Basic properties of a Hedera Token - name, symbol, memo, tokenSupplyType, maxSupply, + /// treasury, freezeDefault. These properties are related both to Fungible and NFT token types. + struct HederaToken { + // The publicly visible name of the token. The token name is specified as a Unicode string. + // Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). + string name; + // The publicly visible token symbol. The token symbol is specified as a Unicode string. + // Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). + string symbol; + // The ID of the account which will act as a treasury for the token as a solidity address. + // This account will receive the specified initial supply or the newly minted NFTs in + // the case for NON_FUNGIBLE_UNIQUE Type + address treasury; + // The memo associated with the token (UTF-8 encoding max 100 bytes) + string memo; + // IWA compatibility. Specified the token supply type. Defaults to INFINITE + bool tokenSupplyType; + // IWA Compatibility. Depends on TokenSupplyType. For tokens of type FUNGIBLE_COMMON - the + // maximum number of tokens that can be in circulation. For tokens of type NON_FUNGIBLE_UNIQUE - + // the maximum number of NFTs (serial numbers) that can be minted. This field can never be changed! + int64 maxSupply; + // The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. If + // true, an account must be unfrozen before it can receive the token + bool freezeDefault; + // list of keys to set to the token + TokenKey[] tokenKeys; + // expiry properties of a Hedera token - second, autoRenewAccount, autoRenewPeriod + Expiry expiry; + } + + /// Additional post creation fungible and non fungible properties of a Hedera Token. + struct TokenInfo { + /// Basic properties of a Hedera Token + HederaToken token; + /// The number of tokens (fungible) or serials (non-fungible) of the token + int64 totalSupply; + /// Specifies whether the token is deleted or not + bool deleted; + /// Specifies whether the token kyc was defaulted with KycNotApplicable (true) or Revoked (false) + bool defaultKycStatus; + /// Specifies whether the token is currently paused or not + bool pauseStatus; + /// The fixed fees collected when transferring the token + FixedFee[] fixedFees; + /// The fractional fees collected when transferring the token + FractionalFee[] fractionalFees; + /// The royalty fees collected when transferring the token + RoyaltyFee[] royaltyFees; + /// The ID of the network ledger + string ledgerId; + } + + /// Additional fungible properties of a Hedera Token. + struct FungibleTokenInfo { + /// The shared hedera token info + TokenInfo tokenInfo; + /// The number of decimal places a token is divisible by + int32 decimals; + } + + /// Additional non fungible properties of a Hedera Token. + struct NonFungibleTokenInfo { + /// The shared hedera token info + TokenInfo tokenInfo; + /// The serial number of the nft + int64 serialNumber; + /// The account id specifying the owner of the non fungible token + address ownerId; + /// The epoch second at which the token was created. + int64 creationTime; + /// The unique metadata of the NFT + bytes metadata; + /// The account id specifying an account that has been granted spending permissions on this nft + address spenderId; + } + + /// A fixed number of units (hbar or token) to assess as a fee during a transfer of + /// units of the token to which this fixed fee is attached. The denomination of + /// the fee depends on the values of tokenId, useHbarsForPayment and + /// useCurrentTokenForPayment. Exactly one of the values should be set. + struct FixedFee { + int64 amount; + // Specifies ID of token that should be used for fixed fee denomination + address tokenId; + // Specifies this fixed fee should be denominated in Hbar + bool useHbarsForPayment; + // Specifies this fixed fee should be denominated in the Token currently being created + bool useCurrentTokenForPayment; + // The ID of the account to receive the custom fee, expressed as a solidity address + address feeCollector; + } + + /// A fraction of the transferred units of a token to assess as a fee. The amount assessed will never + /// be less than the given minimumAmount, and never greater than the given maximumAmount. The + /// denomination is always units of the token to which this fractional fee is attached. + struct FractionalFee { + // A rational number's numerator, used to set the amount of a value transfer to collect as a custom fee + int64 numerator; + // A rational number's denominator, used to set the amount of a value transfer to collect as a custom fee + int64 denominator; + // The minimum amount to assess + int64 minimumAmount; + // The maximum amount to assess (zero implies no maximum) + int64 maximumAmount; + bool netOfTransfers; + // The ID of the account to receive the custom fee, expressed as a solidity address + address feeCollector; + } + + /// A fee to assess during a transfer that changes ownership of an NFT. Defines the fraction of + /// the fungible value exchanged for an NFT that the ledger should collect as a royalty. ("Fungible + /// value" includes both ℏ and units of fungible HTS tokens.) When the NFT sender does not receive + /// any fungible value, the ledger will assess the fallback fee, if present, to the new NFT owner. + /// Royalty fees can only be added to tokens of type type NON_FUNGIBLE_UNIQUE. + struct RoyaltyFee { + // A fraction's numerator of fungible value exchanged for an NFT to collect as royalty + int64 numerator; + // A fraction's denominator of fungible value exchanged for an NFT to collect as royalty + int64 denominator; + // If present, the fee to assess to the NFT receiver when no fungible value + // is exchanged with the sender. Consists of: + // amount: the amount to charge for the fee + // tokenId: Specifies ID of token that should be used for fixed fee denomination + // useHbarsForPayment: Specifies this fee should be denominated in Hbar + int64 amount; + address tokenId; + bool useHbarsForPayment; + // The ID of the account to receive the custom fee, expressed as a solidity address + address feeCollector; + } + + /********************** + * Direct HTS Calls * + **********************/ + + /// Performs transfers among combinations of tokens and hbars + /// @param transferList the list of hbar transfers to do + /// @param tokenTransfers the list of token transfers to do + /// @custom:version 0.3.0 the signature of the previous version was cryptoTransfer(TokenTransferList[] memory tokenTransfers) + function cryptoTransfer( + TransferList memory transferList, + TokenTransferList[] memory tokenTransfers + ) external returns (int64 responseCode); + + /// Mints an amount of the token to the defined treasury account + /// @param token The token for which to mint tokens. If token does not exist, transaction results in + /// INVALID_TOKEN_ID + /// @param amount Applicable to tokens of type FUNGIBLE_COMMON. The amount to mint to the Treasury Account. + /// Amount must be a positive non-zero number represented in the lowest denomination of the + /// token. The new supply must be lower than 2^63. + /// @param metadata Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created. + /// Maximum allowed size of each metadata is 100 bytes + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return newTotalSupply The new supply of tokens. For NFTs it is the total count of NFTs + /// @return serialNumbers If the token is an NFT the newly generate serial numbers, othersise empty. + function mintToken( + address token, + int64 amount, + bytes[] memory metadata + ) + external + returns ( + int64 responseCode, + int64 newTotalSupply, + int64[] memory serialNumbers + ); + + /// Burns an amount of the token from the defined treasury account + /// @param token The token for which to burn tokens. If token does not exist, transaction results in + /// INVALID_TOKEN_ID + /// @param amount Applicable to tokens of type FUNGIBLE_COMMON. The amount to burn from the Treasury Account. + /// Amount must be a positive non-zero number, not bigger than the token balance of the treasury + /// account (0; balance], represented in the lowest denomination. + /// @param serialNumbers Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be burned. + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return newTotalSupply The new supply of tokens. For NFTs it is the total count of NFTs + function burnToken( + address token, + int64 amount, + int64[] memory serialNumbers + ) external returns (int64 responseCode, int64 newTotalSupply); + + /// Associates the provided account with the provided tokens. Must be signed by the provided + /// Account's key or called from the accounts contract key + /// If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + /// If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + /// If any of the provided tokens is not found, the transaction will resolve to INVALID_TOKEN_REF. + /// If any of the provided tokens has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + /// If an association between the provided account and any of the tokens already exists, the + /// transaction will resolve to TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT. + /// If the provided account's associations count exceed the constraint of maximum token associations + /// per account, the transaction will resolve to TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED. + /// On success, associations between the provided account and tokens are made and the account is + /// ready to interact with the tokens. + /// @param account The account to be associated with the provided tokens + /// @param tokens The tokens to be associated with the provided account. In the case of NON_FUNGIBLE_UNIQUE + /// Type, once an account is associated, it can hold any number of NFTs (serial numbers) of that + /// token type + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function associateTokens( + address account, + address[] memory tokens + ) external returns (int64 responseCode); + + /// Single-token variant of associateTokens. Will be mapped to a single entry array call of associateTokens + /// @param account The account to be associated with the provided token + /// @param token The token to be associated with the provided account + function associateToken( + address account, + address token + ) external returns (int64 responseCode); + + /// Dissociates the provided account with the provided tokens. Must be signed by the provided + /// Account's key. + /// If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. + /// If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. + /// If any of the provided tokens is not found, the transaction will resolve to INVALID_TOKEN_REF. + /// If any of the provided tokens has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. + /// If an association between the provided account and any of the tokens does not exist, the + /// transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. + /// If a token has not been deleted and has not expired, and the user has a nonzero balance, the + /// transaction will resolve to TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES. + /// If a fungible token has expired, the user can disassociate even if their token balance is + /// not zero. + /// If a non fungible token has expired, the user can not disassociate if their token + /// balance is not zero. The transaction will resolve to TRANSACTION_REQUIRED_ZERO_TOKEN_BALANCES. + /// On success, associations between the provided account and tokens are removed. + /// @param account The account to be dissociated from the provided tokens + /// @param tokens The tokens to be dissociated from the provided account. + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function dissociateTokens( + address account, + address[] memory tokens + ) external returns (int64 responseCode); + + /// Single-token variant of dissociateTokens. Will be mapped to a single entry array call of dissociateTokens + /// @param account The account to be associated with the provided token + /// @param token The token to be associated with the provided account + function dissociateToken( + address account, + address token + ) external returns (int64 responseCode); + + /// Creates a Fungible Token with the specified properties + /// @param token the basic properties of the token being created + /// @param initialTotalSupply Specifies the initial supply of tokens to be put in circulation. The + /// initial supply is sent to the Treasury Account. The supply is in the lowest denomination possible. + /// @param decimals the number of decimal places a token is divisible by + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenAddress the created token's address + function createFungibleToken( + HederaToken memory token, + int64 initialTotalSupply, + int32 decimals + ) external payable returns (int64 responseCode, address tokenAddress); + + /// Creates a Fungible Token with the specified properties + /// @param token the basic properties of the token being created + /// @param initialTotalSupply Specifies the initial supply of tokens to be put in circulation. The + /// initial supply is sent to the Treasury Account. The supply is in the lowest denomination possible. + /// @param decimals the number of decimal places a token is divisible by. + /// @param fixedFees list of fixed fees to apply to the token + /// @param fractionalFees list of fractional fees to apply to the token + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenAddress the created token's address + function createFungibleTokenWithCustomFees( + HederaToken memory token, + int64 initialTotalSupply, + int32 decimals, + FixedFee[] memory fixedFees, + FractionalFee[] memory fractionalFees + ) external payable returns (int64 responseCode, address tokenAddress); + + /// Creates an Non Fungible Unique Token with the specified properties + /// @param token the basic properties of the token being created + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenAddress the created token's address + function createNonFungibleToken( + HederaToken memory token + ) external payable returns (int64 responseCode, address tokenAddress); + + /// Creates an Non Fungible Unique Token with the specified properties + /// @param token the basic properties of the token being created + /// @param fixedFees list of fixed fees to apply to the token + /// @param royaltyFees list of royalty fees to apply to the token + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenAddress the created token's address + function createNonFungibleTokenWithCustomFees( + HederaToken memory token, + FixedFee[] memory fixedFees, + RoyaltyFee[] memory royaltyFees + ) external payable returns (int64 responseCode, address tokenAddress); + + /********************** + * ABIV1 calls * + **********************/ + + /// Initiates a Fungible Token Transfer + /// @param token The ID of the token as a solidity address + /// @param accountId account to do a transfer to/from + /// @param amount The amount from the accountId at the same index + function transferTokens( + address token, + address[] memory accountId, + int64[] memory amount + ) external returns (int64 responseCode); + + /// Initiates a Non-Fungable Token Transfer + /// @param token The ID of the token as a solidity address + /// @param sender the sender of an nft + /// @param receiver the receiver of the nft sent by the same index at sender + /// @param serialNumber the serial number of the nft sent by the same index at sender + function transferNFTs( + address token, + address[] memory sender, + address[] memory receiver, + int64[] memory serialNumber + ) external returns (int64 responseCode); + + /// Transfers tokens where the calling account/contract is implicitly the first entry in the token transfer list, + /// where the amount is the value needed to zero balance the transfers. Regular signing rules apply for sending + /// (positive amount) or receiving (negative amount) + /// @param token The token to transfer to/from + /// @param sender The sender for the transaction + /// @param recipient The receiver of the transaction + /// @param amount Non-negative value to send. a negative value will result in a failure. + function transferToken( + address token, + address sender, + address recipient, + int64 amount + ) external returns (int64 responseCode); + + /// Transfers tokens where the calling account/contract is implicitly the first entry in the token transfer list, + /// where the amount is the value needed to zero balance the transfers. Regular signing rules apply for sending + /// (positive amount) or receiving (negative amount) + /// @param token The token to transfer to/from + /// @param sender The sender for the transaction + /// @param recipient The receiver of the transaction + /// @param serialNumber The serial number of the NFT to transfer. + function transferNFT( + address token, + address sender, + address recipient, + int64 serialNumber + ) external returns (int64 responseCode); + + /// Allows spender to withdraw from your account multiple times, up to the value amount. If this function is called + /// again it overwrites the current allowance with value. + /// Only Applicable to Fungible Tokens + /// @param token The hedera token address to approve + /// @param spender the account address authorized to spend + /// @param amount the amount of tokens authorized to spend. + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function approve( + address token, + address spender, + uint256 amount + ) external returns (int64 responseCode); + + /// Transfers `amount` tokens from `from` to `to` using the + // allowance mechanism. `amount` is then deducted from the caller's allowance. + /// Only applicable to fungible tokens + /// @param token The address of the fungible Hedera token to transfer + /// @param from The account address of the owner of the token, on the behalf of which to transfer `amount` tokens + /// @param to The account address of the receiver of the `amount` tokens + /// @param amount The amount of tokens to transfer from `from` to `to` + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function transferFrom( + address token, + address from, + address to, + uint256 amount + ) external returns (int64 responseCode); + + /// Returns the amount which spender is still allowed to withdraw from owner. + /// Only Applicable to Fungible Tokens + /// @param token The Hedera token address to check the allowance of + /// @param owner the owner of the tokens to be spent + /// @param spender the spender of the tokens + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return allowance The amount which spender is still allowed to withdraw from owner. + function allowance( + address token, + address owner, + address spender + ) external returns (int64 responseCode, uint256 allowance); + + /// Allow or reaffirm the approved address to transfer an NFT the approved address does not own. + /// Only Applicable to NFT Tokens + /// @param token The Hedera NFT token address to approve + /// @param approved The new approved NFT controller. To revoke approvals pass in the zero address. + /// @param serialNumber The NFT serial number to approve + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function approveNFT( + address token, + address approved, + uint256 serialNumber + ) external returns (int64 responseCode); + + /// Transfers `serialNumber` of `token` from `from` to `to` using the allowance mechanism. + /// Only applicable to NFT tokens + /// @param token The address of the non-fungible Hedera token to transfer + /// @param from The account address of the owner of `serialNumber` of `token` + /// @param to The account address of the receiver of `serialNumber` + /// @param serialNumber The NFT serial number to transfer + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function transferFromNFT( + address token, + address from, + address to, + uint256 serialNumber + ) external returns (int64 responseCode); + + /// Get the approved address for a single NFT + /// Only Applicable to NFT Tokens + /// @param token The Hedera NFT token address to check approval + /// @param serialNumber The NFT to find the approved address for + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return approved The approved address for this NFT, or the zero address if there is none + function getApproved( + address token, + uint256 serialNumber + ) external returns (int64 responseCode, address approved); + + /// Enable or disable approval for a third party ("operator") to manage + /// all of `msg.sender`'s assets + /// @param token The Hedera NFT token address to approve + /// @param operator Address to add to the set of authorized operators + /// @param approved True if the operator is approved, false to revoke approval + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function setApprovalForAll( + address token, + address operator, + bool approved + ) external returns (int64 responseCode); + + /// Query if an address is an authorized operator for another address + /// Only Applicable to NFT Tokens + /// @param token The Hedera NFT token address to approve + /// @param owner The address that owns the NFTs + /// @param operator The address that acts on behalf of the owner + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return approved True if `operator` is an approved operator for `owner`, false otherwise + function isApprovedForAll( + address token, + address owner, + address operator + ) external returns (int64 responseCode, bool approved); + + /// Query if token account is frozen + /// @param token The token address to check + /// @param account The account address associated with the token + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return frozen True if `account` is frozen for `token` + function isFrozen( + address token, + address account + ) external returns (int64 responseCode, bool frozen); + + /// Query if token account has kyc granted + /// @param token The token address to check + /// @param account The account address associated with the token + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return kycGranted True if `account` has kyc granted for `token` + function isKyc( + address token, + address account + ) external returns (int64 responseCode, bool kycGranted); + + /// Operation to delete token + /// @param token The token address to be deleted + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function deleteToken(address token) external returns (int64 responseCode); + + /// Query token custom fees + /// @param token The token address to check + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return fixedFees Set of fixed fees for `token` + /// @return fractionalFees Set of fractional fees for `token` + /// @return royaltyFees Set of royalty fees for `token` + function getTokenCustomFees( + address token + ) + external + returns ( + int64 responseCode, + FixedFee[] memory fixedFees, + FractionalFee[] memory fractionalFees, + RoyaltyFee[] memory royaltyFees + ); + + /// Query token default freeze status + /// @param token The token address to check + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return defaultFreezeStatus True if `token` default freeze status is frozen. + function getTokenDefaultFreezeStatus( + address token + ) external returns (int64 responseCode, bool defaultFreezeStatus); + + /// Query token default kyc status + /// @param token The token address to check + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return defaultKycStatus True if `token` default kyc status is KycNotApplicable and false if Revoked. + function getTokenDefaultKycStatus( + address token + ) external returns (int64 responseCode, bool defaultKycStatus); + + /// Query token expiry info + /// @param token The token address to check + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return expiry Expiry info for `token` + function getTokenExpiryInfo( + address token + ) external returns (int64 responseCode, Expiry memory expiry); + + /// Query fungible token info + /// @param token The token address to check + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return fungibleTokenInfo FungibleTokenInfo info for `token` + function getFungibleTokenInfo( + address token + ) + external + returns ( + int64 responseCode, + FungibleTokenInfo memory fungibleTokenInfo + ); + + /// Query token info + /// @param token The token address to check + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenInfo TokenInfo info for `token` + function getTokenInfo( + address token + ) external returns (int64 responseCode, TokenInfo memory tokenInfo); + + /// Query token KeyValue + /// @param token The token address to check + /// @param keyType The keyType of the desired KeyValue + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return key KeyValue info for key of type `keyType` + function getTokenKey( + address token, + uint keyType + ) external returns (int64 responseCode, KeyValue memory key); + + /// Query non fungible token info + /// @param token The token address to check + /// @param serialNumber The NFT serialNumber to check + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return nonFungibleTokenInfo NonFungibleTokenInfo info for `token` `serialNumber` + function getNonFungibleTokenInfo( + address token, + int64 serialNumber + ) + external + returns ( + int64 responseCode, + NonFungibleTokenInfo memory nonFungibleTokenInfo + ); + + /// Operation to freeze token account + /// @param token The token address + /// @param account The account address to be frozen + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function freezeToken( + address token, + address account + ) external returns (int64 responseCode); + + /// Operation to unfreeze token account + /// @param token The token address + /// @param account The account address to be unfrozen + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function unfreezeToken( + address token, + address account + ) external returns (int64 responseCode); + + /// Operation to grant kyc to token account + /// @param token The token address + /// @param account The account address to grant kyc + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function grantTokenKyc( + address token, + address account + ) external returns (int64 responseCode); + + /// Operation to revoke kyc to token account + /// @param token The token address + /// @param account The account address to revoke kyc + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function revokeTokenKyc( + address token, + address account + ) external returns (int64 responseCode); + + /// Operation to pause token + /// @param token The token address to be paused + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function pauseToken(address token) external returns (int64 responseCode); + + /// Operation to unpause token + /// @param token The token address to be unpaused + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function unpauseToken(address token) external returns (int64 responseCode); + + /// Operation to wipe fungible tokens from account + /// @param token The token address + /// @param account The account address to revoke kyc + /// @param amount The number of tokens to wipe + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function wipeTokenAccount( + address token, + address account, + int64 amount + ) external returns (int64 responseCode); + + /// Operation to wipe non fungible tokens from account + /// @param token The token address + /// @param account The account address to revoke kyc + /// @param serialNumbers The serial numbers of token to wipe + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function wipeTokenAccountNFT( + address token, + address account, + int64[] memory serialNumbers + ) external returns (int64 responseCode); + + /// Operation to update token info + /// @param token The token address + /// @param tokenInfo The hedera token info to update token with + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function updateTokenInfo( + address token, + HederaToken memory tokenInfo + ) external returns (int64 responseCode); + + /// Operation to update token expiry info + /// @param token The token address + /// @param expiryInfo The hedera token expiry info + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function updateTokenExpiryInfo( + address token, + Expiry memory expiryInfo + ) external returns (int64 responseCode); + + /// Operation to update token expiry info + /// @param token The token address + /// @param keys The token keys + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + function updateTokenKeys( + address token, + TokenKey[] memory keys + ) external returns (int64 responseCode); + + /// Query if valid token found for the given address + /// @param token The token address + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return isToken True if valid token found for the given address + function isToken( + address token + ) external returns (int64 responseCode, bool isToken); + + /// Query to return the token type for a given address + /// @param token The token address + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return tokenType the token type. 0 is FUNGIBLE_COMMON, 1 is NON_FUNGIBLE_UNIQUE, -1 is UNRECOGNIZED + function getTokenType( + address token + ) external returns (int64 responseCode, int32 tokenType); + + /// Initiates a Redirect For Token + /// @param token The token address + /// @param encodedFunctionSelector The function selector from the ERC20 interface + the bytes input for the function called + /// @return responseCode The response code for the status of the request. SUCCESS is 22. + /// @return response The result of the call that had been encoded and sent for execution. + function redirectForToken( + address token, + bytes memory encodedFunctionSelector + ) external returns (int64 responseCode, bytes memory response); +} diff --git a/tools/layer-zero-example/contracts/hts/KeyHelper.sol b/tools/layer-zero-example/contracts/hts/KeyHelper.sol new file mode 100644 index 0000000000..8888c42af8 --- /dev/null +++ b/tools/layer-zero-example/contracts/hts/KeyHelper.sol @@ -0,0 +1,182 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity >=0.5.0 <0.9.0; +pragma experimental ABIEncoderV2; + +import "./HederaTokenService.sol"; + +abstract contract KeyHelper { + using Bits for uint256; + address supplyContract; + + mapping(KeyType => uint256) keyTypes; + + enum KeyType { + ADMIN, + KYC, + FREEZE, + WIPE, + SUPPLY, + FEE, + PAUSE + } + enum KeyValueType { + INHERIT_ACCOUNT_KEY, + CONTRACT_ID, + ED25519, + SECP256K1, + DELEGETABLE_CONTRACT_ID + } + + constructor() { + keyTypes[KeyType.ADMIN] = 1; + keyTypes[KeyType.KYC] = 2; + keyTypes[KeyType.FREEZE] = 4; + keyTypes[KeyType.WIPE] = 8; + keyTypes[KeyType.SUPPLY] = 16; + keyTypes[KeyType.FEE] = 32; + keyTypes[KeyType.PAUSE] = 64; + } + + function getDefaultKeys() + internal + view + returns (IHederaTokenService.TokenKey[] memory keys) + { + keys = new IHederaTokenService.TokenKey[](2); + keys[0] = getSingleKey(KeyType.KYC, KeyValueType.CONTRACT_ID, ""); + keys[1] = IHederaTokenService.TokenKey( + getDuplexKeyType(KeyType.SUPPLY, KeyType.PAUSE), + getKeyValueType(KeyValueType.CONTRACT_ID, "") + ); + } + + function getAllTypeKeys( + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.TokenKey[] memory keys) { + keys = new IHederaTokenService.TokenKey[](1); + keys[0] = IHederaTokenService.TokenKey( + getAllKeyTypes(), + getKeyValueType(keyValueType, key) + ); + } + + function getCustomSingleTypeKeys( + KeyType keyType, + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.TokenKey[] memory keys) { + keys = new IHederaTokenService.TokenKey[](1); + keys[0] = IHederaTokenService.TokenKey( + getKeyType(keyType), + getKeyValueType(keyValueType, key) + ); + } + + function getCustomDuplexTypeKeys( + KeyType firstType, + KeyType secondType, + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.TokenKey[] memory keys) { + keys = new IHederaTokenService.TokenKey[](1); + keys[0] = IHederaTokenService.TokenKey( + getDuplexKeyType(firstType, secondType), + getKeyValueType(keyValueType, key) + ); + } + + function getSingleKey( + KeyType keyType, + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.TokenKey memory tokenKey) { + tokenKey = IHederaTokenService.TokenKey( + getKeyType(keyType), + getKeyValueType(keyValueType, key) + ); + } + + function getSingleKey( + KeyType keyType, + KeyValueType keyValueType, + address key + ) internal view returns (IHederaTokenService.TokenKey memory tokenKey) { + tokenKey = IHederaTokenService.TokenKey( + getKeyType(keyType), + getKeyValueType(keyValueType, key) + ); + } + + function getSingleKey( + KeyType firstType, + KeyType secondType, + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.TokenKey memory tokenKey) { + tokenKey = IHederaTokenService.TokenKey( + getDuplexKeyType(firstType, secondType), + getKeyValueType(keyValueType, key) + ); + } + + function getDuplexKeyType( + KeyType firstType, + KeyType secondType + ) internal pure returns (uint256 keyType) { + keyType = keyType.setBit(uint8(firstType)); + keyType = keyType.setBit(uint8(secondType)); + } + + function getAllKeyTypes() internal pure returns (uint256 keyType) { + keyType = keyType.setBit(uint8(KeyType.ADMIN)); + keyType = keyType.setBit(uint8(KeyType.KYC)); + keyType = keyType.setBit(uint8(KeyType.FREEZE)); + keyType = keyType.setBit(uint8(KeyType.WIPE)); + keyType = keyType.setBit(uint8(KeyType.SUPPLY)); + keyType = keyType.setBit(uint8(KeyType.FEE)); + keyType = keyType.setBit(uint8(KeyType.PAUSE)); + } + + function getKeyType(KeyType keyType) internal view returns (uint256) { + return keyTypes[keyType]; + } + + function getKeyValueType( + KeyValueType keyValueType, + bytes memory key + ) internal view returns (IHederaTokenService.KeyValue memory keyValue) { + if (keyValueType == KeyValueType.INHERIT_ACCOUNT_KEY) { + keyValue.inheritAccountKey = true; + } else if (keyValueType == KeyValueType.CONTRACT_ID) { + keyValue.contractId = supplyContract; + } else if (keyValueType == KeyValueType.ED25519) { + keyValue.ed25519 = key; + } else if (keyValueType == KeyValueType.SECP256K1) { + keyValue.ECDSA_secp256k1 = key; + } else if (keyValueType == KeyValueType.DELEGETABLE_CONTRACT_ID) { + keyValue.delegatableContractId = supplyContract; + } + } + + function getKeyValueType( + KeyValueType keyValueType, + address keyAddress + ) internal pure returns (IHederaTokenService.KeyValue memory keyValue) { + if (keyValueType == KeyValueType.CONTRACT_ID) { + keyValue.contractId = keyAddress; + } else if (keyValueType == KeyValueType.DELEGETABLE_CONTRACT_ID) { + keyValue.delegatableContractId = keyAddress; + } + } +} + +library Bits { + uint256 internal constant ONE = uint256(1); + + // Sets the bit at the given 'index' in 'self' to '1'. + // Returns the modified value. + function setBit(uint256 self, uint8 index) internal pure returns (uint256) { + return self | (ONE << index); + } +} diff --git a/tools/layer-zero-example/hardhat.config.js b/tools/layer-zero-example/hardhat.config.js index 3b0eb716c4..3a21da5958 100644 --- a/tools/layer-zero-example/hardhat.config.js +++ b/tools/layer-zero-example/hardhat.config.js @@ -95,18 +95,36 @@ task("deploy-oapp", "Deploy OApp contract") }); task("deploy-oft", "Deploy OFT contract") + .addParam('mint', 'Initial mint') + .addParam('decimals', 'Decimals') .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); const ENDPOINT_V2 = getEndpointAddress(hre.network.name) const contractFactory = await ethers.getContractFactory('ExampleOFT'); - const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address); + const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address, taskArgs.mint, taskArgs.decimals); await contract.deployTransaction.wait(); console.log(`(${hre.network.name}) ExampleOFT deployed to: ` + contract.address); }); +task("deploy-oft-hts", "Deploy OFT HTS contract") + .setAction(async (taskArgs, hre) => { + const ethers = hre.ethers; + const signers = await ethers.getSigners(); + const ENDPOINT_V2 = getEndpointAddress(hre.network.name) + + const contractFactory = await ethers.getContractFactory('ExampleOFTHTS'); + const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address, { + gasLimit: 10_000_000, + value: '30000000000000000000' // 30 hbars + }); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) ExampleOFTHTS deployed to: ` + contract.address); + }); + task("deploy-oft-adapter", "Deploy OFT adapter contract") .addParam('token', 'Token address') .setAction(async (taskArgs, hre) => { diff --git a/tools/layer-zero-example/package-lock.json b/tools/layer-zero-example/package-lock.json index 90055ac77d..1f623814ad 100644 --- a/tools/layer-zero-example/package-lock.json +++ b/tools/layer-zero-example/package-lock.json @@ -3932,20 +3932,6 @@ "dev": true, "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "license": "MIT", - "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", diff --git a/tools/layer-zero-example/test/oftHtsTests.js b/tools/layer-zero-example/test/oftHtsTests.js new file mode 100644 index 0000000000..876ac01b3c --- /dev/null +++ b/tools/layer-zero-example/test/oftHtsTests.js @@ -0,0 +1,112 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const hre = require('hardhat'); +const { ethers } = hre; +const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); +const { expect } = require('chai'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; +const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; +const amount = '100'; + +describe('OFTHTSTests', function() { + it('@hedera @send to bsc', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTHTS', process.env.OFT_HTS_HEDERA_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); + }); + + it('@bsc @send to hedera', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFT', process.env.OFT_HTS_BSC_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@hedera @test balance', async () => { + const signers = await ethers.getSigners(); + + const oftHts = await ethers.getContractAt('ExampleOFTHTS', process.env.OFT_HTS_HEDERA_CONTRACT); + const tokenAddress = await oftHts.htsTokenAddress(); + + const contract = await ethers.getContractAt('ERC20', tokenAddress); + const receiverBalance = await contract.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contract.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); + + it('@bsc @test balance', async () => { + const signers = await ethers.getSigners(); + + const contract = await ethers.getContractAt('ERC20', process.env.OFT_HTS_BSC_CONTRACT); + const receiverBalance = await contract.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contract.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); +}); From 5ee7083696cf988f4c43bb31a1cb3450e565d922 Mon Sep 17 00:00:00 2001 From: nikolay Date: Wed, 18 Dec 2024 15:00:50 +0200 Subject: [PATCH 05/14] chore: fix contracts Signed-off-by: nikolay --- tools/layer-zero-example/README.md | 2 ++ tools/layer-zero-example/contracts/BaseHTSOFT.sol | 2 +- tools/layer-zero-example/contracts/ERC20Mock.sol | 2 +- tools/layer-zero-example/contracts/ERC721Mock.sol | 2 +- .../layer-zero-example/contracts/ExampleOApp.sol | 2 +- tools/layer-zero-example/contracts/ExampleOFT.sol | 2 +- .../contracts/ExampleOFTAdapter.sol | 2 +- .../contracts/ExampleOFTHTS.sol | 14 +++++++------- .../layer-zero-example/contracts/ExampleONFT.sol | 2 +- .../contracts/ExampleONFTAdapter.sol | 2 +- tools/layer-zero-example/test/oftHtsTests.js | 15 +++++++++++++++ 11 files changed, 32 insertions(+), 15 deletions(-) diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index b7d7554451..9bf3a7a8aa 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -116,6 +116,8 @@ npx hardhat set-peer --source --target -- fill the .env +npx hardhat test --grep "OFTHTSTests @hedera @approve" --network hedera_testnet + npx hardhat test --grep "OFTHTSTests @hedera @send" --network hedera_testnet npx hardhat test --grep "OFTHTSTests @bsc @send" --network bsc_testnet diff --git a/tools/layer-zero-example/contracts/BaseHTSOFT.sol b/tools/layer-zero-example/contracts/BaseHTSOFT.sol index e2f644fcf0..b397e8cb86 100644 --- a/tools/layer-zero-example/contracts/BaseHTSOFT.sol +++ b/tools/layer-zero-example/contracts/BaseHTSOFT.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; diff --git a/tools/layer-zero-example/contracts/ERC20Mock.sol b/tools/layer-zero-example/contracts/ERC20Mock.sol index 210bb603e6..823e880011 100644 --- a/tools/layer-zero-example/contracts/ERC20Mock.sol +++ b/tools/layer-zero-example/contracts/ERC20Mock.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.22; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/tools/layer-zero-example/contracts/ERC721Mock.sol b/tools/layer-zero-example/contracts/ERC721Mock.sol index 030a2901d4..41c7f06097 100644 --- a/tools/layer-zero-example/contracts/ERC721Mock.sol +++ b/tools/layer-zero-example/contracts/ERC721Mock.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.22; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; diff --git a/tools/layer-zero-example/contracts/ExampleOApp.sol b/tools/layer-zero-example/contracts/ExampleOApp.sol index 2b47d498a6..7899bd62d1 100644 --- a/tools/layer-zero-example/contracts/ExampleOApp.sol +++ b/tools/layer-zero-example/contracts/ExampleOApp.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.22; import {OApp, Origin, MessagingFee} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OApp.sol"; diff --git a/tools/layer-zero-example/contracts/ExampleOFT.sol b/tools/layer-zero-example/contracts/ExampleOFT.sol index 80bd0ac89c..22f5cc6acb 100644 --- a/tools/layer-zero-example/contracts/ExampleOFT.sol +++ b/tools/layer-zero-example/contracts/ExampleOFT.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.22; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/tools/layer-zero-example/contracts/ExampleOFTAdapter.sol b/tools/layer-zero-example/contracts/ExampleOFTAdapter.sol index 12b9e5b84e..c3021e0f99 100644 --- a/tools/layer-zero-example/contracts/ExampleOFTAdapter.sol +++ b/tools/layer-zero-example/contracts/ExampleOFTAdapter.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.22; import {OFTAdapter} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTAdapter.sol"; diff --git a/tools/layer-zero-example/contracts/ExampleOFTHTS.sol b/tools/layer-zero-example/contracts/ExampleOFTHTS.sol index 4ceec65b36..e0d9396cef 100644 --- a/tools/layer-zero-example/contracts/ExampleOFTHTS.sol +++ b/tools/layer-zero-example/contracts/ExampleOFTHTS.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: MIT +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; @@ -34,7 +34,7 @@ contract ExampleOFTHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService, IHederaTokenService.Expiry memory expiry = IHederaTokenService.Expiry(0, address(this), 8000000); IHederaTokenService.HederaToken memory token = IHederaTokenService.HederaToken( - _name, _symbol, address(this), "memo", true, 1000, false, keys, expiry + _name, _symbol, address(this), "memo", true, 5000, false, keys, expiry ); (int responseCode, address tokenAddress) = HederaTokenService.createFungibleToken( @@ -42,6 +42,9 @@ contract ExampleOFTHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService, ); require(responseCode == HederaResponseCodes.SUCCESS, "Failed to create HTS token"); + int256 transferResponse = HederaTokenService.transferToken(tokenAddress, address(this), msg.sender, 1000); + require(transferResponse == HederaResponseCodes.SUCCESS, "HTS: Transfer failed"); + htsTokenAddress = tokenAddress; emit CreatedToken(tokenAddress); @@ -64,11 +67,8 @@ contract ExampleOFTHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService, ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) { (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid); - address spender = _msgSender(); - if (_from != spender) { - int256 response = HederaTokenService.approve(htsTokenAddress, spender, amountSentLD); - require(response == HederaResponseCodes.SUCCESS, "HTS: Approve failed"); - } + int256 transferResponse = HederaTokenService.transferToken(htsTokenAddress, _from, address(this), int64(uint64(_amountLD))); + require(transferResponse == HederaResponseCodes.SUCCESS, "HTS: Transfer failed"); (int256 response,) = HederaTokenService.burnToken(htsTokenAddress, int64(uint64(amountSentLD)), new int64[](0)); require(response == HederaResponseCodes.SUCCESS, "HTS: Burn failed"); diff --git a/tools/layer-zero-example/contracts/ExampleONFT.sol b/tools/layer-zero-example/contracts/ExampleONFT.sol index 89edfb3dcb..95924ef2df 100644 --- a/tools/layer-zero-example/contracts/ExampleONFT.sol +++ b/tools/layer-zero-example/contracts/ExampleONFT.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.22; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/tools/layer-zero-example/contracts/ExampleONFTAdapter.sol b/tools/layer-zero-example/contracts/ExampleONFTAdapter.sol index a52efd2d40..da94fb6a79 100644 --- a/tools/layer-zero-example/contracts/ExampleONFTAdapter.sol +++ b/tools/layer-zero-example/contracts/ExampleONFTAdapter.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.22; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/tools/layer-zero-example/test/oftHtsTests.js b/tools/layer-zero-example/test/oftHtsTests.js index 876ac01b3c..154cb76617 100644 --- a/tools/layer-zero-example/test/oftHtsTests.js +++ b/tools/layer-zero-example/test/oftHtsTests.js @@ -29,6 +29,17 @@ const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; const amount = '100'; describe('OFTHTSTests', function() { + it('@hedera @approve oft hts contract', async() => { + const oftHts = await ethers.getContractAt('ExampleOFTHTS', process.env.OFT_HTS_HEDERA_CONTRACT); + const tokenAddress = await oftHts.htsTokenAddress(); + + const contract = await ethers.getContractAt('ERC20', tokenAddress); + const txApprove = await contract.approve(process.env.OFT_HTS_HEDERA_CONTRACT, amount) + const receipt = await txApprove.wait(); + + expect(receipt.status).to.equal(1); + }); + it('@hedera @send to bsc', async () => { const signers = await ethers.getSigners(); @@ -92,7 +103,9 @@ describe('OFTHTSTests', function() { const contract = await ethers.getContractAt('ERC20', tokenAddress); const receiverBalance = await contract.balanceOf(receiverAddress); + console.log(`(${hre.network.name}) oft contract balance: ${await contract.balanceOf(process.env.OFT_HTS_HEDERA_CONTRACT)}`); console.log(`(${hre.network.name}) signer balance: ${await contract.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) total supply: ${await contract.totalSupply()}`); console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); expect(receiverBalance).to.equal(amount); @@ -104,7 +117,9 @@ describe('OFTHTSTests', function() { const contract = await ethers.getContractAt('ERC20', process.env.OFT_HTS_BSC_CONTRACT); const receiverBalance = await contract.balanceOf(receiverAddress); + console.log(`(${hre.network.name}) oft contract balance: ${await contract.balanceOf(process.env.OFT_HTS_BSC_CONTRACT)}`); console.log(`(${hre.network.name}) signer balance: ${await contract.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) total supply: ${await contract.totalSupply()}`); console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); expect(receiverBalance).to.equal(amount); From 45a22590ba1fd8d005f1161750460ffa00eb6fe8 Mon Sep 17 00:00:00 2001 From: nikolay Date: Thu, 19 Dec 2024 12:27:13 +0200 Subject: [PATCH 06/14] chore: rename contracts Signed-off-by: nikolay --- tools/layer-zero-example/.env.example | 4 +- tools/layer-zero-example/README.md | 14 +++--- .../contracts/BaseHTSOFT.sol | 45 ------------------- .../contracts/ExampleHTSConnector.sol | 18 ++++++++ .../{ExampleOFTHTS.sol => HTSConnector.sol} | 41 ++++++++++++++--- tools/layer-zero-example/hardhat.config.js | 6 +-- .../{oftHtsTests.js => htsConnectorTests.js} | 18 ++++---- 7 files changed, 75 insertions(+), 71 deletions(-) delete mode 100644 tools/layer-zero-example/contracts/BaseHTSOFT.sol create mode 100644 tools/layer-zero-example/contracts/ExampleHTSConnector.sol rename tools/layer-zero-example/contracts/{ExampleOFTHTS.sol => HTSConnector.sol} (73%) rename tools/layer-zero-example/test/{oftHtsTests.js => htsConnectorTests.js} (86%) diff --git a/tools/layer-zero-example/.env.example b/tools/layer-zero-example/.env.example index 9441da5f14..84a2e6b485 100644 --- a/tools/layer-zero-example/.env.example +++ b/tools/layer-zero-example/.env.example @@ -27,5 +27,5 @@ ONFT_ADAPTER_HEDERA_CONTRACT=0x ONFT_ADAPTER_BSC_CONTRACT=0x # OFT HTS config -OFT_HTS_HEDERA_CONTRACT=0x -OFT_HTS_BSC_CONTRACT=0x +HTS_CONNECTOR_HEDERA_CONTRACT=0x +HTS_CONNECTOR_BSC_CONTRACT=0x diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index 9bf3a7a8aa..605c78971c 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -106,9 +106,9 @@ wait a couple minutes, the LZ progress can be tracked on https://testnet.layerze npx hardhat test --grep "ONFTAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "ONFTAdapterTests @bsc @test" --network bsc_testnet -### OFT HTS +### HTS Connector -npx hardhat deploy-oft-hts --network hedera_testnet +npx hardhat deploy-hts-connector --network hedera_testnet npx hardhat deploy-oft --decimals 8 --mint 1000 --network bsc_testnet npx hardhat set-peer --source --target --network hedera_testnet @@ -116,12 +116,12 @@ npx hardhat set-peer --source --target -- fill the .env -npx hardhat test --grep "OFTHTSTests @hedera @approve" --network hedera_testnet +npx hardhat test --grep "HTSConnectorTests @hedera @approve" --network hedera_testnet -npx hardhat test --grep "OFTHTSTests @hedera @send" --network hedera_testnet -npx hardhat test --grep "OFTHTSTests @bsc @send" --network bsc_testnet +npx hardhat test --grep "HTSConnectorTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "HTSConnectorTests @bsc @send" --network bsc_testnet wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ -npx hardhat test --grep "OFTHTSTests @hedera @test" --network hedera_testnet -npx hardhat test --grep "OFTHTSTests @bsc @test" --network bsc_testnet +npx hardhat test --grep "HTSConnectorTests @hedera @test" --network hedera_testnet +npx hardhat test --grep "HTSConnectorTests @bsc @test" --network bsc_testnet diff --git a/tools/layer-zero-example/contracts/BaseHTSOFT.sol b/tools/layer-zero-example/contracts/BaseHTSOFT.sol deleted file mode 100644 index b397e8cb86..0000000000 --- a/tools/layer-zero-example/contracts/BaseHTSOFT.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -pragma solidity ^0.8.20; - -import {OFTCore} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol"; - -/** - * @title OFT Contract - * @dev OFT is an ERC-20 token that extends the functionality of the OFTCore contract. - */ -abstract contract BaseHTSOFT is OFTCore { - /** - * @dev Constructor for the OFT contract. - * @param _name The name of the OFT. - * @param _symbol The symbol of the OFT. - * @param _lzEndpoint The LayerZero endpoint address. - * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. - */ - constructor( - string memory _name, - string memory _symbol, - address _lzEndpoint, - address _delegate - ) OFTCore(8, _lzEndpoint, _delegate) {} - - /** - * @dev Retrieves the address of the underlying ERC20 implementation. - * @return The address of the OFT token. - * - * @dev In the case of OFT, address(this) and erc20 are the same contract. - */ - function token() public view returns (address) { - return address(this); - } - - /** - * @notice Indicates whether the OFT contract requires approval of the 'token()' to send. - * @return requiresApproval Needs approval of the underlying token implementation. - * - * @dev In the case of OFT where the contract IS the token, approval is NOT required. - */ - function approvalRequired() external pure virtual returns (bool) { - return false; - } -} diff --git a/tools/layer-zero-example/contracts/ExampleHTSConnector.sol b/tools/layer-zero-example/contracts/ExampleHTSConnector.sol new file mode 100644 index 0000000000..e8236d305f --- /dev/null +++ b/tools/layer-zero-example/contracts/ExampleHTSConnector.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "./hts/HederaTokenService.sol"; +import "./hts/IHederaTokenService.sol"; +import "./hts/KeyHelper.sol"; +import "./hts/ExpiryHelper.sol"; +import "./HTSConnector.sol"; + +contract ExampleHTSConnector is Ownable, HTSConnector { + constructor( + string memory _name, + string memory _symbol, + address _lzEndpoint, + address _delegate + ) payable HTSConnector(_name, _symbol, _lzEndpoint, _delegate) Ownable(_delegate) {} +} diff --git a/tools/layer-zero-example/contracts/ExampleOFTHTS.sol b/tools/layer-zero-example/contracts/HTSConnector.sol similarity index 73% rename from tools/layer-zero-example/contracts/ExampleOFTHTS.sol rename to tools/layer-zero-example/contracts/HTSConnector.sol index e0d9396cef..33a0e2a3c9 100644 --- a/tools/layer-zero-example/contracts/ExampleOFTHTS.sol +++ b/tools/layer-zero-example/contracts/HTSConnector.sol @@ -1,24 +1,34 @@ // SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.0; +pragma solidity ^0.8.20; -import "@openzeppelin/contracts/access/Ownable.sol"; +import {OFTCore} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol"; import "./hts/HederaTokenService.sol"; import "./hts/IHederaTokenService.sol"; import "./hts/KeyHelper.sol"; import "./hts/ExpiryHelper.sol"; -import "./BaseHTSOFT.sol"; -contract ExampleOFTHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService, BaseHTSOFT { +/** + * @title OFT Contract + * @dev OFT is an ERC-20 token that extends the functionality of the OFTCore contract. + */ +abstract contract HTSConnector is OFTCore, KeyHelper, ExpiryHelper, HederaTokenService { address public htsTokenAddress; event CreatedToken(address tokenAddress); + /** + * @dev Constructor for the OFT contract. + * @param _name The name of the OFT. + * @param _symbol The symbol of the OFT. + * @param _lzEndpoint The LayerZero endpoint address. + * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. + */ constructor( string memory _name, string memory _symbol, address _lzEndpoint, address _delegate - ) payable BaseHTSOFT(_name, _symbol, _lzEndpoint, _delegate) Ownable(_delegate) { + ) payable OFTCore(8, _lzEndpoint, _delegate) { IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](2); keys[0] = getSingleKey( KeyType.ADMIN, @@ -50,6 +60,27 @@ contract ExampleOFTHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService, emit CreatedToken(tokenAddress); } + /** + * @dev Retrieves the address of the underlying ERC20 implementation. + * @return The address of the OFT token. + * + * @dev In the case of OFT, address(this) and erc20 are the same contract. + */ + function token() public view returns (address) { + return address(this); + } + + /** + * @notice Indicates whether the OFT contract requires approval of the 'token()' to send. + * @return requiresApproval Needs approval of the underlying token implementation. + * + * @dev In the case of OFT where the contract IS the token, approval is NOT required. + */ + function approvalRequired() external pure virtual returns (bool) { + return false; + } + + /** * @dev Burns tokens from the sender's specified balance. * @param _from The address to debit the tokens from. diff --git a/tools/layer-zero-example/hardhat.config.js b/tools/layer-zero-example/hardhat.config.js index 3a21da5958..c3d0eeab64 100644 --- a/tools/layer-zero-example/hardhat.config.js +++ b/tools/layer-zero-example/hardhat.config.js @@ -109,20 +109,20 @@ task("deploy-oft", "Deploy OFT contract") console.log(`(${hre.network.name}) ExampleOFT deployed to: ` + contract.address); }); -task("deploy-oft-hts", "Deploy OFT HTS contract") +task("deploy-hts-connector", "Deploy HTS connector contract") .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); const ENDPOINT_V2 = getEndpointAddress(hre.network.name) - const contractFactory = await ethers.getContractFactory('ExampleOFTHTS'); + const contractFactory = await ethers.getContractFactory('ExampleHTSConnector'); const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address, { gasLimit: 10_000_000, value: '30000000000000000000' // 30 hbars }); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ExampleOFTHTS deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ExampleHTSConnector deployed to: ` + contract.address); }); task("deploy-oft-adapter", "Deploy OFT adapter contract") diff --git a/tools/layer-zero-example/test/oftHtsTests.js b/tools/layer-zero-example/test/htsConnectorTests.js similarity index 86% rename from tools/layer-zero-example/test/oftHtsTests.js rename to tools/layer-zero-example/test/htsConnectorTests.js index 154cb76617..81a6cf2b59 100644 --- a/tools/layer-zero-example/test/oftHtsTests.js +++ b/tools/layer-zero-example/test/htsConnectorTests.js @@ -28,13 +28,13 @@ const BSC_EID = 40102; const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; const amount = '100'; -describe('OFTHTSTests', function() { +describe('HTSConnectorTests', function() { it('@hedera @approve oft hts contract', async() => { - const oftHts = await ethers.getContractAt('ExampleOFTHTS', process.env.OFT_HTS_HEDERA_CONTRACT); + const oftHts = await ethers.getContractAt('ExampleHTSConnector', process.env.HTS_CONNECTOR_HEDERA_CONTRACT); const tokenAddress = await oftHts.htsTokenAddress(); const contract = await ethers.getContractAt('ERC20', tokenAddress); - const txApprove = await contract.approve(process.env.OFT_HTS_HEDERA_CONTRACT, amount) + const txApprove = await contract.approve(process.env.HTS_CONNECTOR_HEDERA_CONTRACT, amount) const receipt = await txApprove.wait(); expect(receipt.status).to.equal(1); @@ -53,7 +53,7 @@ describe('OFTHTSTests', function() { oftCmd: ethers.utils.arrayify('0x') }; - const contract = await ethers.getContractAt('ExampleOFTHTS', process.env.OFT_HTS_HEDERA_CONTRACT); + const contract = await ethers.getContractAt('ExampleHTSConnector', process.env.HTS_CONNECTOR_HEDERA_CONTRACT); const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { gasLimit: 10_000_000, value: '5000000000000000000' @@ -80,7 +80,7 @@ describe('OFTHTSTests', function() { oftCmd: ethers.utils.arrayify('0x') }; - const contract = await ethers.getContractAt('ExampleOFT', process.env.OFT_HTS_BSC_CONTRACT); + const contract = await ethers.getContractAt('ExampleOFT', process.env.HTS_CONNECTOR_BSC_CONTRACT); const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { gasLimit: 1_000_000, value: '1000000000000000' @@ -97,13 +97,13 @@ describe('OFTHTSTests', function() { it('@hedera @test balance', async () => { const signers = await ethers.getSigners(); - const oftHts = await ethers.getContractAt('ExampleOFTHTS', process.env.OFT_HTS_HEDERA_CONTRACT); + const oftHts = await ethers.getContractAt('ExampleHTSConnector', process.env.HTS_CONNECTOR_HEDERA_CONTRACT); const tokenAddress = await oftHts.htsTokenAddress(); const contract = await ethers.getContractAt('ERC20', tokenAddress); const receiverBalance = await contract.balanceOf(receiverAddress); - console.log(`(${hre.network.name}) oft contract balance: ${await contract.balanceOf(process.env.OFT_HTS_HEDERA_CONTRACT)}`); + console.log(`(${hre.network.name}) oft contract balance: ${await contract.balanceOf(process.env.HTS_CONNECTOR_HEDERA_CONTRACT)}`); console.log(`(${hre.network.name}) signer balance: ${await contract.balanceOf(signers[0].address)}`); console.log(`(${hre.network.name}) total supply: ${await contract.totalSupply()}`); console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); @@ -114,10 +114,10 @@ describe('OFTHTSTests', function() { it('@bsc @test balance', async () => { const signers = await ethers.getSigners(); - const contract = await ethers.getContractAt('ERC20', process.env.OFT_HTS_BSC_CONTRACT); + const contract = await ethers.getContractAt('ERC20', process.env.HTS_CONNECTOR_BSC_CONTRACT); const receiverBalance = await contract.balanceOf(receiverAddress); - console.log(`(${hre.network.name}) oft contract balance: ${await contract.balanceOf(process.env.OFT_HTS_BSC_CONTRACT)}`); + console.log(`(${hre.network.name}) oft contract balance: ${await contract.balanceOf(process.env.HTS_CONNECTOR_BSC_CONTRACT)}`); console.log(`(${hre.network.name}) signer balance: ${await contract.balanceOf(signers[0].address)}`); console.log(`(${hre.network.name}) total supply: ${await contract.totalSupply()}`); console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); From 447a0ff315e85847ee13e9f58e69879ec1a41568 Mon Sep 17 00:00:00 2001 From: nikolay Date: Thu, 19 Dec 2024 13:37:28 +0200 Subject: [PATCH 07/14] chore: add hts adapter Signed-off-by: nikolay --- tools/layer-zero-example/README.md | 28 +++- .../contracts/CreateHTS.sol | 42 ++++++ .../contracts/ERC20Mock.sol | 11 +- tools/layer-zero-example/hardhat.config.js | 27 +++- .../test/htsAdapterTests.js | 139 ++++++++++++++++++ 5 files changed, 238 insertions(+), 9 deletions(-) create mode 100644 tools/layer-zero-example/contracts/CreateHTS.sol create mode 100644 tools/layer-zero-example/test/htsAdapterTests.js diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index 605c78971c..d91f1a1ec3 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -39,8 +39,8 @@ npx hardhat test --grep "OFTTests @bsc @test" --network bsc_testnet ### OFT Adapter -npx hardhat deploy-erc20 --network hedera_testnet -npx hardhat deploy-erc20 --network bsc_testnet +npx hardhat deploy-erc20 --decimals 18 --mint 10000000000000000000 --network hedera_testnet +npx hardhat deploy-erc20 --decimals 18 --mint 10000000000000000000 --network bsc_testnet npx hardhat deploy-oft-adapter --token --network hedera_testnet npx hardhat deploy-oft-adapter --token --network bsc_testnet @@ -125,3 +125,27 @@ wait a couple minutes, the LZ progress can be tracked on https://testnet.layerze npx hardhat test --grep "HTSConnectorTests @hedera @test" --network hedera_testnet npx hardhat test --grep "HTSConnectorTests @bsc @test" --network bsc_testnet + +### HTS Adapter + +npx hardhat create-hts-token --network hedera_testnet +npx hardhat deploy-erc20 --decimals 8 --mint 1000 --network bsc_testnet + +npx hardhat deploy-oft-adapter --token --network hedera_testnet +npx hardhat deploy-oft-adapter --token --network bsc_testnet + +npx hardhat set-peer --source --target --network hedera_testnet +npx hardhat set-peer --source --target --network bsc_testnet + +fill the .env + +npx hardhat test --grep "HTSAdapterTests @hedera @fund-and-approve" --network hedera_testnet +npx hardhat test --grep "HTSAdapterTests @bsc @fund-and-approve" --network bsc_testnet + +npx hardhat test --grep "HTSAdapterTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "HTSAdapterTests @bsc @send" --network bsc_testnet + +wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ + +npx hardhat test --grep "HTSAdapterTests @hedera @test" --network hedera_testnet +npx hardhat test --grep "HTSAdapterTests @bsc @test" --network bsc_testnet diff --git a/tools/layer-zero-example/contracts/CreateHTS.sol b/tools/layer-zero-example/contracts/CreateHTS.sol new file mode 100644 index 0000000000..81f37d8950 --- /dev/null +++ b/tools/layer-zero-example/contracts/CreateHTS.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.20; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "./hts/HederaTokenService.sol"; +import "./hts/IHederaTokenService.sol"; +import "./hts/KeyHelper.sol"; +import "./hts/ExpiryHelper.sol"; + +contract CreateHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService { + address public htsTokenAddress; + + constructor(string memory _name, string memory _symbol, address _delegate) payable Ownable(_delegate) { + IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](2); + keys[0] = getSingleKey( + KeyType.ADMIN, + KeyType.PAUSE, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + keys[1] = getSingleKey( + KeyType.SUPPLY, + KeyValueType.INHERIT_ACCOUNT_KEY, + bytes("") + ); + + IHederaTokenService.Expiry memory expiry = IHederaTokenService.Expiry(0, address(this), 8000000); + IHederaTokenService.HederaToken memory token = IHederaTokenService.HederaToken( + _name, _symbol, address(this), "memo", true, 5000, false, keys, expiry + ); + + (int responseCode, address tokenAddress) = HederaTokenService.createFungibleToken( + token, 1000, int32(int256(uint256(8))) + ); + require(responseCode == HederaResponseCodes.SUCCESS, "Failed to create HTS token"); + + int256 transferResponse = HederaTokenService.transferToken(tokenAddress, address(this), msg.sender, 1000); + require(transferResponse == HederaResponseCodes.SUCCESS, "HTS: Transfer failed"); + + htsTokenAddress = tokenAddress; + } +} diff --git a/tools/layer-zero-example/contracts/ERC20Mock.sol b/tools/layer-zero-example/contracts/ERC20Mock.sol index 823e880011..34f21d4f36 100644 --- a/tools/layer-zero-example/contracts/ERC20Mock.sol +++ b/tools/layer-zero-example/contracts/ERC20Mock.sol @@ -4,7 +4,14 @@ pragma solidity ^0.8.22; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract ERC20Mock is ERC20 { - constructor() ERC20("ERC20Mock", "E20M") { - _mint(msg.sender, 10000000000000000000); + uint8 decimalsArg = 18; + + constructor(uint256 _initialMint, uint8 _decimals) ERC20("ERC20Mock", "E20M") { + _mint(msg.sender, _initialMint); + decimalsArg = _decimals; + } + + function decimals() public view override returns (uint8) { + return decimalsArg; } } diff --git a/tools/layer-zero-example/hardhat.config.js b/tools/layer-zero-example/hardhat.config.js index c3d0eeab64..968ab832c0 100644 --- a/tools/layer-zero-example/hardhat.config.js +++ b/tools/layer-zero-example/hardhat.config.js @@ -64,9 +64,11 @@ const getEndpointAddress = (network) => { } task('deploy-erc20', "Deploy ERC20 token") + .addParam('mint', 'Initial mint') + .addParam('decimals', 'Decimals') .setAction(async (taskArgs, hre) => { const contractFactory = await ethers.getContractFactory('ERC20Mock'); - const contract = await contractFactory.deploy(); + const contract = await contractFactory.deploy(taskArgs.mint, taskArgs.decimals); await contract.deployTransaction.wait(); console.log(`(${hre.network.name}) ERC20 deployed to: ` + contract.address); @@ -100,7 +102,7 @@ task("deploy-oft", "Deploy OFT contract") .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); - const ENDPOINT_V2 = getEndpointAddress(hre.network.name) + const ENDPOINT_V2 = getEndpointAddress(hre.network.name); const contractFactory = await ethers.getContractFactory('ExampleOFT'); const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address, taskArgs.mint, taskArgs.decimals); @@ -113,7 +115,7 @@ task("deploy-hts-connector", "Deploy HTS connector contract") .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); - const ENDPOINT_V2 = getEndpointAddress(hre.network.name) + const ENDPOINT_V2 = getEndpointAddress(hre.network.name); const contractFactory = await ethers.getContractFactory('ExampleHTSConnector'); const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address, { @@ -125,12 +127,27 @@ task("deploy-hts-connector", "Deploy HTS connector contract") console.log(`(${hre.network.name}) ExampleHTSConnector deployed to: ` + contract.address); }); +task("create-hts-token", "Create a HTS token") + .setAction(async (taskArgs, hre) => { + const ethers = hre.ethers; + const signers = await ethers.getSigners(); + + const contractFactory = await ethers.getContractFactory('CreateHTS'); + const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', signers[0].address, { + gasLimit: 10_000_000, + value: '30000000000000000000' // 30 hbars + }); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) Token address: ` + await contract.htsTokenAddress()); + }); + task("deploy-oft-adapter", "Deploy OFT adapter contract") .addParam('token', 'Token address') .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); - const ENDPOINT_V2 = getEndpointAddress(hre.network.name) + const ENDPOINT_V2 = getEndpointAddress(hre.network.name); const contractFactory = await ethers.getContractFactory('ExampleOFTAdapter'); const contract = await contractFactory.deploy(taskArgs.token, ENDPOINT_V2, signers[0].address); @@ -164,7 +181,7 @@ task("deploy-onft-adapter", "Deploy OFT contract") .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); - const ENDPOINT_V2 = getEndpointAddress(hre.network.name) + const ENDPOINT_V2 = getEndpointAddress(hre.network.name); const contractFactory = await ethers.getContractFactory('ExampleONFTAdapter'); const contract = await contractFactory.deploy(taskArgs.token, ENDPOINT_V2, signers[0].address); diff --git a/tools/layer-zero-example/test/htsAdapterTests.js b/tools/layer-zero-example/test/htsAdapterTests.js new file mode 100644 index 0000000000..f2f9d8ac9d --- /dev/null +++ b/tools/layer-zero-example/test/htsAdapterTests.js @@ -0,0 +1,139 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const hre = require('hardhat'); +const { ethers } = hre; +const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); +const { expect } = require('chai'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; +const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; +const amount = '100'; + +describe('HTSAdapterTests', function() { + it('@hedera @fund-and-approve transfer to adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_HTS_HEDERA_CONTRACT); + const transferTx = await contractERC20.transfer(process.env.HTS_ADAPTER_HEDERA_CONTRACT, amount); + const receipt = await transferTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @fund-and-approve transfer to adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_ERC20_BSC_CONTRACT); + const transferTx = await contractERC20.transfer(process.env.HTS_ADAPTER_BSC_CONTRACT, amount); + const receipt = await transferTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @fund-and-approve adapter approval', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_HTS_HEDERA_CONTRACT); + const approveTx = await contractERC20.approve(process.env.HTS_ADAPTER_HEDERA_CONTRACT, amount); + const receipt = await approveTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @fund-and-approve adapter approval', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_ERC20_BSC_CONTRACT); + const approveTx = await contractERC20.approve(process.env.HTS_ADAPTER_BSC_CONTRACT, amount); + const receipt = await approveTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @send to bsc', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTAdapter', process.env.HTS_ADAPTER_HEDERA_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Bsc via tx: ${tx.hash}`); + }); + + it('@bsc @send to hedera', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTAdapter', process.env.HTS_ADAPTER_BSC_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@hedera @test balance', async () => { + const signers = await ethers.getSigners(); + + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_HTS_HEDERA_CONTRACT); + const receiverBalance = await contractERC20.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contractERC20.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) adapter balance: ${await contractERC20.balanceOf(process.env.HTS_ADAPTER_HEDERA_CONTRACT)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); + + it('@bsc @test balance', async () => { + const signers = await ethers.getSigners(); + + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_ERC20_BSC_CONTRACT); + const receiverBalance = await contractERC20.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contractERC20.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) adapter balance: ${await contractERC20.balanceOf(process.env.HTS_ADAPTER_BSC_CONTRACT)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); +}); From 30813ab9229bfe90bb61888b3b81b3a69d424841 Mon Sep 17 00:00:00 2001 From: nikolay Date: Thu, 19 Dec 2024 16:29:01 +0200 Subject: [PATCH 08/14] chore: add whbar example Signed-off-by: nikolay --- tools/layer-zero-example/.env.example | 14 +- tools/layer-zero-example/README.md | 24 +++ tools/layer-zero-example/contracts/WHBAR.sol | 72 +++++++++ tools/layer-zero-example/hardhat.config.js | 9 ++ tools/layer-zero-example/test/whbarTests.js | 151 +++++++++++++++++++ 5 files changed, 269 insertions(+), 1 deletion(-) create mode 100644 tools/layer-zero-example/contracts/WHBAR.sol create mode 100644 tools/layer-zero-example/test/whbarTests.js diff --git a/tools/layer-zero-example/.env.example b/tools/layer-zero-example/.env.example index 84a2e6b485..3d47c98e8a 100644 --- a/tools/layer-zero-example/.env.example +++ b/tools/layer-zero-example/.env.example @@ -26,6 +26,18 @@ ERC721_BSC_CONTRACT=0x ONFT_ADAPTER_HEDERA_CONTRACT=0x ONFT_ADAPTER_BSC_CONTRACT=0x -# OFT HTS config +# HTS Connector config HTS_CONNECTOR_HEDERA_CONTRACT=0x HTS_CONNECTOR_BSC_CONTRACT=0x + +# HTS Adapter config +HTS_ADAPTER_HTS_HEDERA_CONTRACT=0x +HTS_ADAPTER_ERC20_BSC_CONTRACT=0x +HTS_ADAPTER_HEDERA_CONTRACT=0x +HTS_ADAPTER_BSC_CONTRACT=0x + +# WHBAR config +WHBAR_HEDERA_CONTRACT=0x +WHBAR_BSC_CONTRACT=0x +WHBAR_HEDERA_ADAPTER_CONTRACT=0x +WHBAR_BSC_ADAPTER_CONTRACT=0x diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index d91f1a1ec3..cb256496be 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -149,3 +149,27 @@ wait a couple minutes, the LZ progress can be tracked on https://testnet.layerze npx hardhat test --grep "HTSAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "HTSAdapterTests @bsc @test" --network bsc_testnet + +### WHBAR flow + +npx hardhat deploy-whbar --network hedera_testnet +npx hardhat deploy-erc20 --decimals 8 --mint 100000000 --network bsc_testnet + +npx hardhat deploy-oft-adapter --token --network hedera_testnet +npx hardhat deploy-oft-adapter --token --network bsc_testnet + +npx hardhat set-peer --source --target --network hedera_testnet +npx hardhat set-peer --source --target --network bsc_testnet + +fill the .env + +npx hardhat test --grep "WHBARTests @hedera @deposit" --network hedera_testnet + +npx hardhat test --grep "WHBARTests @hedera @fund-and-approve" --network hedera_testnet +npx hardhat test --grep "WHBARTests @bsc @fund-and-approve" --network bsc_testnet + +npx hardhat test --grep "WHBARTests @hedera @send" --network hedera_testnet +npx hardhat test --grep "WHBARTests @bsc @send" --network bsc_testnet + +npx hardhat test --grep "WHBARTests @hedera @test" --network hedera_testnet +npx hardhat test --grep "WHBARTests @bsc @test" --network bsc_testnet diff --git a/tools/layer-zero-example/contracts/WHBAR.sol b/tools/layer-zero-example/contracts/WHBAR.sol new file mode 100644 index 0000000000..3e1c50331d --- /dev/null +++ b/tools/layer-zero-example/contracts/WHBAR.sol @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.22; + +contract WHBAR { + string public name = "Wrapped HBAR"; + string public symbol = "WHBAR"; + uint8 public decimals = 8; + + event Approval(address indexed src, address indexed guy, uint wad); + event Transfer(address indexed src, address indexed dst, uint wad); + event Deposit(address indexed dst, uint wad); + event Withdrawal(address indexed src, uint wad); + + mapping(address => uint) public balanceOf; + mapping(address => mapping(address => uint)) public allowance; + + fallback() external payable { + deposit(); + } + + receive() external payable { + deposit(); + } + + function deposit() public payable { + balanceOf[msg.sender] += msg.value; + + emit Deposit(msg.sender, msg.value); + } + + function withdraw(uint wad) public { + require(balanceOf[msg.sender] >= wad); + + balanceOf[msg.sender] -= wad; + payable(msg.sender).transfer(wad); + + emit Withdrawal(msg.sender, wad); + } + + function totalSupply() public view returns (uint) { + return address(this).balance; + } + + function approve(address guy, uint wad) public returns (bool) { + allowance[msg.sender][guy] = wad; + + emit Approval(msg.sender, guy, wad); + + return true; + } + + function transfer(address dst, uint wad) public returns (bool) { + return transferFrom(msg.sender, dst, wad); + } + + function transferFrom(address src, address dst, uint wad) public returns (bool) { + require(balanceOf[src] >= wad); + + if (src != msg.sender && allowance[src][msg.sender] != + type(uint256).max) { + require(allowance[src][msg.sender] >= wad); + allowance[src][msg.sender] -= wad; + } + + balanceOf[src] -= wad; + balanceOf[dst] += wad; + + emit Transfer(src, dst, wad); + + return true; + } +} \ No newline at end of file diff --git a/tools/layer-zero-example/hardhat.config.js b/tools/layer-zero-example/hardhat.config.js index 968ab832c0..e2118af85e 100644 --- a/tools/layer-zero-example/hardhat.config.js +++ b/tools/layer-zero-example/hardhat.config.js @@ -63,6 +63,15 @@ const getEndpointAddress = (network) => { return ENDPOINT_V2; } +task('deploy-whbar', "Deploy WHBAR") + .setAction(async (taskArgs, hre) => { + const contractFactory = await ethers.getContractFactory('WHBAR'); + const contract = await contractFactory.deploy(); + await contract.deployTransaction.wait(); + + console.log(`(${hre.network.name}) WHBAR to: ` + contract.address); + }); + task('deploy-erc20', "Deploy ERC20 token") .addParam('mint', 'Initial mint') .addParam('decimals', 'Decimals') diff --git a/tools/layer-zero-example/test/whbarTests.js b/tools/layer-zero-example/test/whbarTests.js new file mode 100644 index 0000000000..d816cda38a --- /dev/null +++ b/tools/layer-zero-example/test/whbarTests.js @@ -0,0 +1,151 @@ +/*- + * + * Hedera JSON RPC Relay - Hardhat Example + * + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const hre = require('hardhat'); +const { ethers } = hre; +const { Options, addressToBytes32 } = require('@layerzerolabs/lz-v2-utilities'); +const { expect } = require('chai'); + +const HEDERA_EID = 40285; +const BSC_EID = 40102; +const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; +const amount = '50000000'; + +describe.only('WHBARTests', function() { + it('@hedera @deposit 1 hbar', async () => { + const signers = await ethers.getSigners(); + const contract = await ethers.getContractAt('WHBAR', process.env.WHBAR_HEDERA_CONTRACT); + + const tx = await contract.deposit({ + value: '1000000000000000000' // 1 hbar + }); + await tx.wait(); + + expect(await contract.balanceOf(signers[0].address)).to.equal(100_000_000); + }); + + it('@hedera @fund-and-approve transfer to adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_HEDERA_CONTRACT); + const transferTx = await contractERC20.transfer(process.env.WHBAR_HEDERA_ADAPTER_CONTRACT, amount); + const receipt = await transferTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @fund-and-approve transfer to adapter', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_BSC_CONTRACT); + const transferTx = await contractERC20.transfer(process.env.WHBAR_BSC_ADAPTER_CONTRACT, amount); + const receipt = await transferTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @fund-and-approve adapter approval', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_HEDERA_CONTRACT); + const approveTx = await contractERC20.approve(process.env.WHBAR_HEDERA_ADAPTER_CONTRACT, amount); + const receipt = await approveTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@bsc @fund-and-approve adapter approval', async () => { + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_BSC_CONTRACT); + const approveTx = await contractERC20.approve(process.env.WHBAR_BSC_ADAPTER_CONTRACT, amount); + const receipt = await approveTx.wait(); + expect(!!receipt.status).to.be.true; + }); + + it('@hedera @send to bsc', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: BSC_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTAdapter', process.env.WHBAR_HEDERA_ADAPTER_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '500000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 10_000_000, + value: '5000000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Bsc via tx: ${tx.hash}`); + }); + + it('@bsc @send to hedera', async () => { + const signers = await ethers.getSigners(); + + const sendParam = { + dstEid: HEDERA_EID, + to: addressToBytes32(receiverAddress), + amountLD: amount, + minAmountLD: amount, + extraOptions: Options.newOptions().addExecutorLzReceiveOption(3000000, 0).toBytes(), + composeMsg: ethers.utils.arrayify('0x'), + oftCmd: ethers.utils.arrayify('0x') + }; + + const contract = await ethers.getContractAt('ExampleOFTAdapter', process.env.WHBAR_BSC_ADAPTER_CONTRACT); + const tx = await contract.send(sendParam, { nativeFee: '1000000000000000', lzTokenFee: 0 }, signers[0].address, { + gasLimit: 1_000_000, + value: '1000000000000000' + }); + + const receipt = await tx.wait(); + if (!receipt.status) { + process.exit(`Execution failed. Tx hash: ${tx.hash}`); + } + + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); + }); + + it('@hedera @test balance', async () => { + const signers = await ethers.getSigners(); + + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_HEDERA_CONTRACT); + const receiverBalance = await contractERC20.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contractERC20.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) adapter balance: ${await contractERC20.balanceOf(process.env.WHBAR_HEDERA_ADAPTER_CONTRACT)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); + + it('@bsc @test balance', async () => { + const signers = await ethers.getSigners(); + + const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_BSC_CONTRACT); + const receiverBalance = await contractERC20.balanceOf(receiverAddress); + + console.log(`(${hre.network.name}) signer balance: ${await contractERC20.balanceOf(signers[0].address)}`); + console.log(`(${hre.network.name}) adapter balance: ${await contractERC20.balanceOf(process.env.WHBAR_BSC_ADAPTER_CONTRACT)}`); + console.log(`(${hre.network.name}) receiver balance: ${receiverBalance}`); + + expect(receiverBalance).to.equal(amount); + }); +}); From cb1d5e10685d5161de751fc056a7f894f4b06939 Mon Sep 17 00:00:00 2001 From: nikolay Date: Fri, 20 Dec 2024 15:49:35 +0200 Subject: [PATCH 09/14] chore: cleanup and fix readme Signed-off-by: nikolay --- tools/layer-zero-example/README.md | 110 ++- .../contracts/CreateHTS.sol | 7 +- .../contracts/ExampleHTSConnector.sol | 1 - .../contracts/HTSConnector.sol | 42 +- tools/layer-zero-example/contracts/WHBAR.sol | 1 + .../contracts/hts/ExpiryHelper.sol | 21 - .../contracts/hts/HederaResponseCodes.sol | 330 --------- .../contracts/hts/HederaTokenService.sol | 143 +--- .../contracts/hts/IHederaTokenService.sol | 638 ------------------ .../contracts/hts/KeyHelper.sol | 81 --- tools/layer-zero-example/hardhat.config.js | 2 + 11 files changed, 129 insertions(+), 1247 deletions(-) delete mode 100644 tools/layer-zero-example/contracts/hts/ExpiryHelper.sol delete mode 100644 tools/layer-zero-example/contracts/hts/HederaResponseCodes.sol diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index cb256496be..34924a6cf6 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -2,109 +2,193 @@ ### OApp +Message-passing interface to send and receive arbitrary pieces of data between contracts existing on different chains. + +- Deploying the oapp contract on each network we're going to interact +``` npx hardhat deploy-oapp --network hedera_testnet npx hardhat deploy-oapp --network bsc_testnet +``` +- In order to connect oapps together, we need to set the peer of the target oapp, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts +``` npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet +``` -fill the .env +- Fill the .env +- On these steps, we're sending messages from one chain to another and vice versa +``` npx hardhat test --grep "OAppTests @hedera @send" --network hedera_testnet npx hardhat test --grep "OAppTests @bsc @send" --network bsc_testnet +``` -wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Finally we're checking whether the messages are received on both chains +``` npx hardhat test --grep "OAppTests @hedera @test" --network hedera_testnet npx hardhat test --grep "OAppTests @bsc @test" --network bsc_testnet - +``` ### OFT +Allows fungible tokens to be transferred across multiple chains. + +- Deploying OFT tokens which under the hood are ERC20s and contain the messaging between chains functionality provided by LZ +``` npx hardhat deploy-oft --decimals 18 --mint 1000000000000000000 --network hedera_testnet npx hardhat deploy-oft --decimals 18 --mint 1000000000000000000 --network bsc_testnet +``` +- In order to connect OFTs together, we need to set the peer of the target OFT, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts +``` npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet +``` -fill the .env +- Fill the .env +- On these steps, we're sending tokens between chains. That means we're burning tokens on the source chain and minting new ones on the destination chain +``` npx hardhat test --grep "OFTTests @hedera @send" --network hedera_testnet npx hardhat test --grep "OFTTests @bsc @send" --network bsc_testnet +``` -wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Finally we're checking whether the token balances are as expected on both the source and destination chains. +``` npx hardhat test --grep "OFTTests @hedera @test" --network hedera_testnet npx hardhat test --grep "OFTTests @bsc @test" --network bsc_testnet +``` ### OFT Adapter +If your token already exists on the chain you want to connect, you can deploy the OFT Adapter contract to act as an intermediary lockbox for the token. + +- Deploying ERC20 tokens on each chain +``` npx hardhat deploy-erc20 --decimals 18 --mint 10000000000000000000 --network hedera_testnet npx hardhat deploy-erc20 --decimals 18 --mint 10000000000000000000 --network bsc_testnet +``` +- Deploying an OFT Adapter which will be used as a lockbox of ERC20s deployed the step above +``` npx hardhat deploy-oft-adapter --token --network hedera_testnet npx hardhat deploy-oft-adapter --token --network bsc_testnet +``` +- In order to connect OFT Adapters together, we need to set the peer of the target OFT Adapter, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts +``` npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet +``` -fill the .env +- Fill the .env +- Here we're funding the Adapter on both chains with some liquidity and after that we're approving it to spend the signer's token +``` npx hardhat test --grep "OFTAdapterTests @hedera @fund-and-approve" --network hedera_testnet npx hardhat test --grep "OFTAdapterTests @bsc @fund-and-approve" --network bsc_testnet +``` +- On these steps, we're sending already existing tokens that are used by OFT Adapter between different chains +``` npx hardhat test --grep "OFTAdapterTests @hedera @send" --network hedera_testnet npx hardhat test --grep "OFTAdapterTests @bsc @send" --network bsc_testnet +``` -wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Finally we're checking the balances on each chain +``` npx hardhat test --grep "OFTAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "OFTAdapterTests @bsc @test" --network bsc_testnet +``` ### ONFT +Allows non-fungible tokens to be transferred across multiple chains. + +- Deploying ONFT tokens which under the hood are ERC721s and contain the messaging between chains functionality provided by LZ +``` npx hardhat deploy-onft --network hedera_testnet npx hardhat deploy-onft --network bsc_testnet +``` +- In order to connect ONFTs together, we need to set the peer of the target ONFT, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts +``` npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet +``` -fill the .env +- Fill the .env +- On these steps, we're sending NFTs between chains. That means we're burning the NFT on the source chain and minting new one on the destination chain +``` npx hardhat test --grep "ONFTTests @hedera @send" --network hedera_testnet npx hardhat test --grep "ONFTTests @bsc @send" --network bsc_testnet +``` -wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Finally we're checking whether the NFTs are transferred successfully +``` npx hardhat test --grep "ONFTTests @hedera @send" --network hedera_testnet npx hardhat test --grep "ONFTTests @bsc @send" --network bsc_testnet +``` ### ONFT Adapter +If your NFT contract already exists on the chain you want to connect, you can deploy the ONFT Adapter contract to act as an intermediary lockbox. + +- Deploying ERC721s on each chain we want to connect +``` npx hardhat deploy-erc721 --network hedera_testnet npx hardhat deploy-erc721 --network bsc_testnet +``` +- Deploying an ONFT Adapter which will be used as a lockbox of ERC721s deployed the step above +``` npx hardhat deploy-onft-adapter --token --network hedera_testnet npx hardhat deploy-onft-adapter --token --network bsc_testnet +``` +- In order to connect ONFT Adapters together, we need to set the peer of the target ONFT Adapter, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts +``` npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet +``` -fill the .env +- Fill the .env +- First, we have to mint some NFTs on each chain +``` npx hardhat test --grep "ONFTAdapterTests @hedera @mint" --network hedera_testnet npx hardhat test --grep "ONFTAdapterTests @bsc @mint" --network bsc_testnet +``` +- Then, we have to approve the Adapter to be able to spend the NFT we want to send to another chain +``` npx hardhat test --grep "ONFTAdapterTests @hedera @approve" --network hedera_testnet npx hardhat test --grep "ONFTAdapterTests @bsc @approve" --network bsc_testnet +``` +- On these steps, we're sending already existing NFTs between chains +``` npx hardhat test --grep "ONFTAdapterTests @hedera @send" --network hedera_testnet npx hardhat test --grep "ONFTAdapterTests @bsc @send" --network bsc_testnet +``` -wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Finally we're checking whether the NFTs are transferred successfully +``` npx hardhat test --grep "ONFTAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "ONFTAdapterTests @bsc @test" --network bsc_testnet +``` ### HTS Connector @@ -121,7 +205,7 @@ npx hardhat test --grep "HTSConnectorTests @hedera @approve" --network hedera_te npx hardhat test --grep "HTSConnectorTests @hedera @send" --network hedera_testnet npx hardhat test --grep "HTSConnectorTests @bsc @send" --network bsc_testnet -wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ npx hardhat test --grep "HTSConnectorTests @hedera @test" --network hedera_testnet npx hardhat test --grep "HTSConnectorTests @bsc @test" --network bsc_testnet @@ -145,7 +229,7 @@ npx hardhat test --grep "HTSAdapterTests @bsc @fund-and-approve" --network bsc_t npx hardhat test --grep "HTSAdapterTests @hedera @send" --network hedera_testnet npx hardhat test --grep "HTSAdapterTests @bsc @send" --network bsc_testnet -wait a couple minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ npx hardhat test --grep "HTSAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "HTSAdapterTests @bsc @test" --network bsc_testnet diff --git a/tools/layer-zero-example/contracts/CreateHTS.sol b/tools/layer-zero-example/contracts/CreateHTS.sol index 81f37d8950..6a58707fd2 100644 --- a/tools/layer-zero-example/contracts/CreateHTS.sol +++ b/tools/layer-zero-example/contracts/CreateHTS.sol @@ -5,9 +5,8 @@ import "@openzeppelin/contracts/access/Ownable.sol"; import "./hts/HederaTokenService.sol"; import "./hts/IHederaTokenService.sol"; import "./hts/KeyHelper.sol"; -import "./hts/ExpiryHelper.sol"; -contract CreateHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService { +contract CreateHTS is Ownable, KeyHelper, HederaTokenService { address public htsTokenAddress; constructor(string memory _name, string memory _symbol, address _delegate) payable Ownable(_delegate) { @@ -32,10 +31,10 @@ contract CreateHTS is Ownable, KeyHelper, ExpiryHelper, HederaTokenService { (int responseCode, address tokenAddress) = HederaTokenService.createFungibleToken( token, 1000, int32(int256(uint256(8))) ); - require(responseCode == HederaResponseCodes.SUCCESS, "Failed to create HTS token"); + require(responseCode == HederaTokenService.SUCCESS_CODE, "Failed to create HTS token"); int256 transferResponse = HederaTokenService.transferToken(tokenAddress, address(this), msg.sender, 1000); - require(transferResponse == HederaResponseCodes.SUCCESS, "HTS: Transfer failed"); + require(transferResponse == HederaTokenService.SUCCESS_CODE, "HTS: Transfer failed"); htsTokenAddress = tokenAddress; } diff --git a/tools/layer-zero-example/contracts/ExampleHTSConnector.sol b/tools/layer-zero-example/contracts/ExampleHTSConnector.sol index e8236d305f..8623904afb 100644 --- a/tools/layer-zero-example/contracts/ExampleHTSConnector.sol +++ b/tools/layer-zero-example/contracts/ExampleHTSConnector.sol @@ -5,7 +5,6 @@ import "@openzeppelin/contracts/access/Ownable.sol"; import "./hts/HederaTokenService.sol"; import "./hts/IHederaTokenService.sol"; import "./hts/KeyHelper.sol"; -import "./hts/ExpiryHelper.sol"; import "./HTSConnector.sol"; contract ExampleHTSConnector is Ownable, HTSConnector { diff --git a/tools/layer-zero-example/contracts/HTSConnector.sol b/tools/layer-zero-example/contracts/HTSConnector.sol index 33a0e2a3c9..f8f144b6a6 100644 --- a/tools/layer-zero-example/contracts/HTSConnector.sol +++ b/tools/layer-zero-example/contracts/HTSConnector.sol @@ -5,21 +5,20 @@ import {OFTCore} from "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol"; import "./hts/HederaTokenService.sol"; import "./hts/IHederaTokenService.sol"; import "./hts/KeyHelper.sol"; -import "./hts/ExpiryHelper.sol"; /** - * @title OFT Contract - * @dev OFT is an ERC-20 token that extends the functionality of the OFTCore contract. + * @title HTS Connector + * @dev HTS Connector is a HTS token that extends the functionality of the OFTCore contract. */ -abstract contract HTSConnector is OFTCore, KeyHelper, ExpiryHelper, HederaTokenService { +abstract contract HTSConnector is OFTCore, KeyHelper, HederaTokenService { address public htsTokenAddress; - event CreatedToken(address tokenAddress); + event TokenCreated(address tokenAddress); /** - * @dev Constructor for the OFT contract. - * @param _name The name of the OFT. - * @param _symbol The symbol of the OFT. + * @dev Constructor for the HTS Connector contract. + * @param _name The name of HTS token + * @param _symbol The symbol of HTS token * @param _lzEndpoint The LayerZero endpoint address. * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. */ @@ -50,37 +49,32 @@ abstract contract HTSConnector is OFTCore, KeyHelper, ExpiryHelper, HederaTokenS (int responseCode, address tokenAddress) = HederaTokenService.createFungibleToken( token, 1000, int32(int256(uint256(8))) ); - require(responseCode == HederaResponseCodes.SUCCESS, "Failed to create HTS token"); + require(responseCode == HederaTokenService.SUCCESS_CODE, "Failed to create HTS token"); int256 transferResponse = HederaTokenService.transferToken(tokenAddress, address(this), msg.sender, 1000); - require(transferResponse == HederaResponseCodes.SUCCESS, "HTS: Transfer failed"); + require(transferResponse == HederaTokenService.SUCCESS_CODE, "HTS: Transfer failed"); htsTokenAddress = tokenAddress; - emit CreatedToken(tokenAddress); + emit TokenCreated(tokenAddress); } /** - * @dev Retrieves the address of the underlying ERC20 implementation. - * @return The address of the OFT token. - * - * @dev In the case of OFT, address(this) and erc20 are the same contract. + * @dev Retrieves the address of the underlying HTS implementation. + * @return The address of the HTS token. */ function token() public view returns (address) { - return address(this); + return htsTokenAddress; } /** - * @notice Indicates whether the OFT contract requires approval of the 'token()' to send. + * @notice Indicates whether the HTS Connector contract requires approval of the 'token()' to send. * @return requiresApproval Needs approval of the underlying token implementation. - * - * @dev In the case of OFT where the contract IS the token, approval is NOT required. */ function approvalRequired() external pure virtual returns (bool) { return false; } - /** * @dev Burns tokens from the sender's specified balance. * @param _from The address to debit the tokens from. @@ -99,10 +93,10 @@ abstract contract HTSConnector is OFTCore, KeyHelper, ExpiryHelper, HederaTokenS (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid); int256 transferResponse = HederaTokenService.transferToken(htsTokenAddress, _from, address(this), int64(uint64(_amountLD))); - require(transferResponse == HederaResponseCodes.SUCCESS, "HTS: Transfer failed"); + require(transferResponse == HederaTokenService.SUCCESS_CODE, "HTS: Transfer failed"); (int256 response,) = HederaTokenService.burnToken(htsTokenAddress, int64(uint64(amountSentLD)), new int64[](0)); - require(response == HederaResponseCodes.SUCCESS, "HTS: Burn failed"); + require(response == HederaTokenService.SUCCESS_CODE, "HTS: Burn failed"); } /** @@ -118,10 +112,10 @@ abstract contract HTSConnector is OFTCore, KeyHelper, ExpiryHelper, HederaTokenS uint32 /*_srcEid*/ ) internal virtual override returns (uint256) { (int256 response, ,) = HederaTokenService.mintToken(htsTokenAddress, int64(uint64(_amountLD)), new bytes[](0)); - require(response == HederaResponseCodes.SUCCESS, "HTS: Mint failed"); + require(response == HederaTokenService.SUCCESS_CODE, "HTS: Mint failed"); int256 transferResponse = HederaTokenService.transferToken(htsTokenAddress, address(this), _to, int64(uint64(_amountLD))); - require(transferResponse == HederaResponseCodes.SUCCESS, "HTS: Transfer failed"); + require(transferResponse == HederaTokenService.SUCCESS_CODE, "HTS: Transfer failed"); return _amountLD; } diff --git a/tools/layer-zero-example/contracts/WHBAR.sol b/tools/layer-zero-example/contracts/WHBAR.sol index 3e1c50331d..6118f6b898 100644 --- a/tools/layer-zero-example/contracts/WHBAR.sol +++ b/tools/layer-zero-example/contracts/WHBAR.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.22; +// the contract is based on WETH9 with updated solidity versions and functions contract WHBAR { string public name = "Wrapped HBAR"; string public symbol = "WHBAR"; diff --git a/tools/layer-zero-example/contracts/hts/ExpiryHelper.sol b/tools/layer-zero-example/contracts/hts/ExpiryHelper.sol deleted file mode 100644 index 9ae1405141..0000000000 --- a/tools/layer-zero-example/contracts/hts/ExpiryHelper.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.5.0 <0.9.0; -pragma experimental ABIEncoderV2; - -import "./HederaTokenService.sol"; - -abstract contract ExpiryHelper { - function createAutoRenewExpiry( - address autoRenewAccount, - int64 autoRenewPeriod - ) internal pure returns (IHederaTokenService.Expiry memory expiry) { - expiry.autoRenewAccount = autoRenewAccount; - expiry.autoRenewPeriod = autoRenewPeriod; - } - - function createSecondExpiry( - int64 second - ) internal pure returns (IHederaTokenService.Expiry memory expiry) { - expiry.second = second; - } -} diff --git a/tools/layer-zero-example/contracts/hts/HederaResponseCodes.sol b/tools/layer-zero-example/contracts/hts/HederaResponseCodes.sol deleted file mode 100644 index 2633baa4f8..0000000000 --- a/tools/layer-zero-example/contracts/hts/HederaResponseCodes.sol +++ /dev/null @@ -1,330 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity >=0.4.9 <0.9.0; - -library HederaResponseCodes { - // response codes - int32 internal constant OK = 0; // The transaction passed the precheck validations. - int32 internal constant INVALID_TRANSACTION = 1; // For any error not handled by specific error codes listed below. - int32 internal constant PAYER_ACCOUNT_NOT_FOUND = 2; //Payer account does not exist. - int32 internal constant INVALID_NODE_ACCOUNT = 3; //Node Account provided does not match the node account of the node the transaction was submitted to. - int32 internal constant TRANSACTION_EXPIRED = 4; // Pre-Check error when TransactionValidStart + transactionValidDuration is less than current consensus time. - int32 internal constant INVALID_TRANSACTION_START = 5; // Transaction start time is greater than current consensus time - int32 internal constant INVALID_TRANSACTION_DURATION = 6; //valid transaction duration is a positive non zero number that does not exceed 120 seconds - int32 internal constant INVALID_SIGNATURE = 7; // The transaction signature is not valid - int32 internal constant MEMO_TOO_LONG = 8; //Transaction memo size exceeded 100 bytes - int32 internal constant INSUFFICIENT_TX_FEE = 9; // The fee provided in the transaction is insufficient for this type of transaction - int32 internal constant INSUFFICIENT_PAYER_BALANCE = 10; // The payer account has insufficient cryptocurrency to pay the transaction fee - int32 internal constant DUPLICATE_TRANSACTION = 11; // This transaction ID is a duplicate of one that was submitted to this node or reached consensus in the last 180 seconds (receipt period) - int32 internal constant BUSY = 12; //If API is throttled out - int32 internal constant NOT_SUPPORTED = 13; //The API is not currently supported - - int32 internal constant INVALID_FILE_ID = 14; //The file id is invalid or does not exist - int32 internal constant INVALID_ACCOUNT_ID = 15; //The account id is invalid or does not exist - int32 internal constant INVALID_CONTRACT_ID = 16; //The contract id is invalid or does not exist - int32 internal constant INVALID_TRANSACTION_ID = 17; //Transaction id is not valid - int32 internal constant RECEIPT_NOT_FOUND = 18; //Receipt for given transaction id does not exist - int32 internal constant RECORD_NOT_FOUND = 19; //Record for given transaction id does not exist - int32 internal constant INVALID_SOLIDITY_ID = 20; //The solidity id is invalid or entity with this solidity id does not exist - - int32 internal constant UNKNOWN = 21; // The responding node has submitted the transaction to the network. Its final status is still unknown. - int32 internal constant SUCCESS = 22; // The transaction succeeded - int32 internal constant FAIL_INVALID = 23; // There was a system error and the transaction failed because of invalid request parameters. - int32 internal constant FAIL_FEE = 24; // There was a system error while performing fee calculation, reserved for future. - int32 internal constant FAIL_BALANCE = 25; // There was a system error while performing balance checks, reserved for future. - - int32 internal constant KEY_REQUIRED = 26; //Key not provided in the transaction body - int32 internal constant BAD_ENCODING = 27; //Unsupported algorithm/encoding used for keys in the transaction - int32 internal constant INSUFFICIENT_ACCOUNT_BALANCE = 28; //When the account balance is not sufficient for the transfer - int32 internal constant INVALID_SOLIDITY_ADDRESS = 29; //During an update transaction when the system is not able to find the Users Solidity address - - int32 internal constant INSUFFICIENT_GAS = 30; //Not enough gas was supplied to execute transaction - int32 internal constant CONTRACT_SIZE_LIMIT_EXCEEDED = 31; //contract byte code size is over the limit - int32 internal constant LOCAL_CALL_MODIFICATION_EXCEPTION = 32; //local execution (query) is requested for a function which changes state - int32 internal constant CONTRACT_REVERT_EXECUTED = 33; //Contract REVERT OPCODE executed - int32 internal constant CONTRACT_EXECUTION_EXCEPTION = 34; //For any contract execution related error not handled by specific error codes listed above. - int32 internal constant INVALID_RECEIVING_NODE_ACCOUNT = 35; //In Query validation, account with +ve(amount) value should be Receiving node account, the receiver account should be only one account in the list - int32 internal constant MISSING_QUERY_HEADER = 36; // Header is missing in Query request - - int32 internal constant ACCOUNT_UPDATE_FAILED = 37; // The update of the account failed - int32 internal constant INVALID_KEY_ENCODING = 38; // Provided key encoding was not supported by the system - int32 internal constant NULL_SOLIDITY_ADDRESS = 39; // null solidity address - - int32 internal constant CONTRACT_UPDATE_FAILED = 40; // update of the contract failed - int32 internal constant INVALID_QUERY_HEADER = 41; // the query header is invalid - - int32 internal constant INVALID_FEE_SUBMITTED = 42; // Invalid fee submitted - int32 internal constant INVALID_PAYER_SIGNATURE = 43; // Payer signature is invalid - - int32 internal constant KEY_NOT_PROVIDED = 44; // The keys were not provided in the request. - int32 internal constant INVALID_EXPIRATION_TIME = 45; // Expiration time provided in the transaction was invalid. - int32 internal constant NO_WACL_KEY = 46; //WriteAccess Control Keys are not provided for the file - int32 internal constant FILE_CONTENT_EMPTY = 47; //The contents of file are provided as empty. - int32 internal constant INVALID_ACCOUNT_AMOUNTS = 48; // The crypto transfer credit and debit do not sum equal to 0 - int32 internal constant EMPTY_TRANSACTION_BODY = 49; // Transaction body provided is empty - int32 internal constant INVALID_TRANSACTION_BODY = 50; // Invalid transaction body provided - - int32 internal constant INVALID_SIGNATURE_TYPE_MISMATCHING_KEY = 51; // the type of key (base ed25519 key, KeyList, or ThresholdKey) does not match the type of signature (base ed25519 signature, SignatureList, or ThresholdKeySignature) - int32 internal constant INVALID_SIGNATURE_COUNT_MISMATCHING_KEY = 52; // the number of key (KeyList, or ThresholdKey) does not match that of signature (SignatureList, or ThresholdKeySignature). e.g. if a keyList has 3 base keys, then the corresponding signatureList should also have 3 base signatures. - - int32 internal constant EMPTY_LIVE_HASH_BODY = 53; // the livehash body is empty - int32 internal constant EMPTY_LIVE_HASH = 54; // the livehash data is missing - int32 internal constant EMPTY_LIVE_HASH_KEYS = 55; // the keys for a livehash are missing - int32 internal constant INVALID_LIVE_HASH_SIZE = 56; // the livehash data is not the output of a SHA-384 digest - - int32 internal constant EMPTY_QUERY_BODY = 57; // the query body is empty - int32 internal constant EMPTY_LIVE_HASH_QUERY = 58; // the crypto livehash query is empty - int32 internal constant LIVE_HASH_NOT_FOUND = 59; // the livehash is not present - int32 internal constant ACCOUNT_ID_DOES_NOT_EXIST = 60; // the account id passed has not yet been created. - int32 internal constant LIVE_HASH_ALREADY_EXISTS = 61; // the livehash already exists for a given account - - int32 internal constant INVALID_FILE_WACL = 62; // File WACL keys are invalid - int32 internal constant SERIALIZATION_FAILED = 63; // Serialization failure - int32 internal constant TRANSACTION_OVERSIZE = 64; // The size of the Transaction is greater than transactionMaxBytes - int32 internal constant TRANSACTION_TOO_MANY_LAYERS = 65; // The Transaction has more than 50 levels - int32 internal constant CONTRACT_DELETED = 66; //Contract is marked as deleted - - int32 internal constant PLATFORM_NOT_ACTIVE = 67; // the platform node is either disconnected or lagging behind. - int32 internal constant KEY_PREFIX_MISMATCH = 68; // one internal key matches more than one prefixes on the signature map - int32 internal constant PLATFORM_TRANSACTION_NOT_CREATED = 69; // transaction not created by platform due to large backlog - int32 internal constant INVALID_RENEWAL_PERIOD = 70; // auto renewal period is not a positive number of seconds - int32 internal constant INVALID_PAYER_ACCOUNT_ID = 71; // the response code when a smart contract id is passed for a crypto API request - int32 internal constant ACCOUNT_DELETED = 72; // the account has been marked as deleted - int32 internal constant FILE_DELETED = 73; // the file has been marked as deleted - int32 internal constant ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS = 74; // same accounts repeated in the transfer account list - int32 internal constant SETTING_NEGATIVE_ACCOUNT_BALANCE = 75; // attempting to set negative balance value for crypto account - int32 internal constant OBTAINER_REQUIRED = 76; // when deleting smart contract that has crypto balance either transfer account or transfer smart contract is required - int32 internal constant OBTAINER_SAME_CONTRACT_ID = 77; //when deleting smart contract that has crypto balance you can not use the same contract id as transferContractId as the one being deleted - int32 internal constant OBTAINER_DOES_NOT_EXIST = 78; //transferAccountId or transferContractId specified for contract delete does not exist - int32 internal constant MODIFYING_IMMUTABLE_CONTRACT = 79; //attempting to modify (update or delete a immutable smart contract, i.e. one created without a admin key) - int32 internal constant FILE_SYSTEM_EXCEPTION = 80; //Unexpected exception thrown by file system functions - int32 internal constant AUTORENEW_DURATION_NOT_IN_RANGE = 81; // the duration is not a subset of [MINIMUM_AUTORENEW_DURATION,MAXIMUM_AUTORENEW_DURATION] - int32 internal constant ERROR_DECODING_BYTESTRING = 82; // Decoding the smart contract binary to a byte array failed. Check that the input is a valid hex string. - int32 internal constant CONTRACT_FILE_EMPTY = 83; // File to create a smart contract was of length zero - int32 internal constant CONTRACT_BYTECODE_EMPTY = 84; // Bytecode for smart contract is of length zero - int32 internal constant INVALID_INITIAL_BALANCE = 85; // Attempt to set negative initial balance - int32 internal constant INVALID_RECEIVE_RECORD_THRESHOLD = 86; // [Deprecated]. attempt to set negative receive record threshold - int32 internal constant INVALID_SEND_RECORD_THRESHOLD = 87; // [Deprecated]. attempt to set negative send record threshold - int32 internal constant ACCOUNT_IS_NOT_GENESIS_ACCOUNT = 88; // Special Account Operations should be performed by only Genesis account, return this code if it is not Genesis Account - int32 internal constant PAYER_ACCOUNT_UNAUTHORIZED = 89; // The fee payer account doesn't have permission to submit such Transaction - int32 internal constant INVALID_FREEZE_TRANSACTION_BODY = 90; // FreezeTransactionBody is invalid - int32 internal constant FREEZE_TRANSACTION_BODY_NOT_FOUND = 91; // FreezeTransactionBody does not exist - int32 internal constant TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 92; //Exceeded the number of accounts (both from and to) allowed for crypto transfer list - int32 internal constant RESULT_SIZE_LIMIT_EXCEEDED = 93; // Smart contract result size greater than specified maxResultSize - int32 internal constant NOT_SPECIAL_ACCOUNT = 94; //The payer account is not a special account(account 0.0.55) - int32 internal constant CONTRACT_NEGATIVE_GAS = 95; // Negative gas was offered in smart contract call - int32 internal constant CONTRACT_NEGATIVE_VALUE = 96; // Negative value / initial balance was specified in a smart contract call / create - int32 internal constant INVALID_FEE_FILE = 97; // Failed to update fee file - int32 internal constant INVALID_EXCHANGE_RATE_FILE = 98; // Failed to update exchange rate file - int32 internal constant INSUFFICIENT_LOCAL_CALL_GAS = 99; // Payment tendered for contract local call cannot cover both the fee and the gas - int32 internal constant ENTITY_NOT_ALLOWED_TO_DELETE = 100; // Entities with Entity ID below 1000 are not allowed to be deleted - int32 internal constant AUTHORIZATION_FAILED = 101; // Violating one of these rules: 1) treasury account can update all entities below 0.0.1000, 2) account 0.0.50 can update all entities from 0.0.51 - 0.0.80, 3) Network Function Master Account A/c 0.0.50 - Update all Network Function accounts & perform all the Network Functions listed below, 4) Network Function Accounts: i) A/c 0.0.55 - Update Address Book files (0.0.101/102), ii) A/c 0.0.56 - Update Fee schedule (0.0.111), iii) A/c 0.0.57 - Update Exchange Rate (0.0.112). - int32 internal constant FILE_UPLOADED_PROTO_INVALID = 102; // Fee Schedule Proto uploaded but not valid (append or update is required) - int32 internal constant FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK = 103; // Fee Schedule Proto uploaded but not valid (append or update is required) - int32 internal constant FEE_SCHEDULE_FILE_PART_UPLOADED = 104; // Fee Schedule Proto File Part uploaded - int32 internal constant EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED = 105; // The change on Exchange Rate exceeds Exchange_Rate_Allowed_Percentage - int32 internal constant MAX_CONTRACT_STORAGE_EXCEEDED = 106; // Contract permanent storage exceeded the currently allowable limit - int32 internal constant TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT = 107; // Transfer Account should not be same as Account to be deleted - int32 internal constant TOTAL_LEDGER_BALANCE_INVALID = 108; - int32 internal constant EXPIRATION_REDUCTION_NOT_ALLOWED = 110; // The expiration date/time on a smart contract may not be reduced - int32 internal constant MAX_GAS_LIMIT_EXCEEDED = 111; //Gas exceeded currently allowable gas limit per transaction - int32 internal constant MAX_FILE_SIZE_EXCEEDED = 112; // File size exceeded the currently allowable limit - - int32 internal constant INVALID_TOPIC_ID = 150; // The Topic ID specified is not in the system. - int32 internal constant INVALID_ADMIN_KEY = 155; // A provided admin key was invalid. - int32 internal constant INVALID_SUBMIT_KEY = 156; // A provided submit key was invalid. - int32 internal constant UNAUTHORIZED = 157; // An attempted operation was not authorized (ie - a deleteTopic for a topic with no adminKey). - int32 internal constant INVALID_TOPIC_MESSAGE = 158; // A ConsensusService message is empty. - int32 internal constant INVALID_AUTORENEW_ACCOUNT = 159; // The autoRenewAccount specified is not a valid, active account. - int32 internal constant AUTORENEW_ACCOUNT_NOT_ALLOWED = 160; // An adminKey was not specified on the topic, so there must not be an autoRenewAccount. - // The topic has expired, was not automatically renewed, and is in a 7 day grace period before the topic will be - // deleted unrecoverably. This error response code will not be returned until autoRenew functionality is supported - // by HAPI. - int32 internal constant TOPIC_EXPIRED = 162; - int32 internal constant INVALID_CHUNK_NUMBER = 163; // chunk number must be from 1 to total (chunks) inclusive. - int32 internal constant INVALID_CHUNK_TRANSACTION_ID = 164; // For every chunk, the payer account that is part of initialTransactionID must match the Payer Account of this transaction. The entire initialTransactionID should match the transactionID of the first chunk, but this is not checked or enforced by Hedera except when the chunk number is 1. - int32 internal constant ACCOUNT_FROZEN_FOR_TOKEN = 165; // Account is frozen and cannot transact with the token - int32 internal constant TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED = 166; // An involved account already has more than tokens.maxPerAccount associations with non-deleted tokens. - int32 internal constant INVALID_TOKEN_ID = 167; // The token is invalid or does not exist - int32 internal constant INVALID_TOKEN_DECIMALS = 168; // Invalid token decimals - int32 internal constant INVALID_TOKEN_INITIAL_SUPPLY = 169; // Invalid token initial supply - int32 internal constant INVALID_TREASURY_ACCOUNT_FOR_TOKEN = 170; // Treasury Account does not exist or is deleted - int32 internal constant INVALID_TOKEN_SYMBOL = 171; // Token Symbol is not UTF-8 capitalized alphabetical string - int32 internal constant TOKEN_HAS_NO_FREEZE_KEY = 172; // Freeze key is not set on token - int32 internal constant TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN = 173; // Amounts in transfer list are not net zero - int32 internal constant MISSING_TOKEN_SYMBOL = 174; // A token symbol was not provided - int32 internal constant TOKEN_SYMBOL_TOO_LONG = 175; // The provided token symbol was too long - int32 internal constant ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN = 176; // KYC must be granted and account does not have KYC granted - int32 internal constant TOKEN_HAS_NO_KYC_KEY = 177; // KYC key is not set on token - int32 internal constant INSUFFICIENT_TOKEN_BALANCE = 178; // Token balance is not sufficient for the transaction - int32 internal constant TOKEN_WAS_DELETED = 179; // Token transactions cannot be executed on deleted token - int32 internal constant TOKEN_HAS_NO_SUPPLY_KEY = 180; // Supply key is not set on token - int32 internal constant TOKEN_HAS_NO_WIPE_KEY = 181; // Wipe key is not set on token - int32 internal constant INVALID_TOKEN_MINT_AMOUNT = 182; // The requested token mint amount would cause an invalid total supply - int32 internal constant INVALID_TOKEN_BURN_AMOUNT = 183; // The requested token burn amount would cause an invalid total supply - int32 internal constant TOKEN_NOT_ASSOCIATED_TO_ACCOUNT = 184; // A required token-account relationship is missing - int32 internal constant CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT = 185; // The target of a wipe operation was the token treasury account - int32 internal constant INVALID_KYC_KEY = 186; // The provided KYC key was invalid. - int32 internal constant INVALID_WIPE_KEY = 187; // The provided wipe key was invalid. - int32 internal constant INVALID_FREEZE_KEY = 188; // The provided freeze key was invalid. - int32 internal constant INVALID_SUPPLY_KEY = 189; // The provided supply key was invalid. - int32 internal constant MISSING_TOKEN_NAME = 190; // Token Name is not provided - int32 internal constant TOKEN_NAME_TOO_LONG = 191; // Token Name is too long - int32 internal constant INVALID_WIPING_AMOUNT = 192; // The provided wipe amount must not be negative, zero or bigger than the token holder balance - int32 internal constant TOKEN_IS_IMMUTABLE = 193; // Token does not have Admin key set, thus update/delete transactions cannot be performed - int32 internal constant TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT = 194; // An associateToken operation specified a token already associated to the account - int32 internal constant TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES = 195; // An attempted operation is invalid until all token balances for the target account are zero - int32 internal constant ACCOUNT_IS_TREASURY = 196; // An attempted operation is invalid because the account is a treasury - int32 internal constant TOKEN_ID_REPEATED_IN_TOKEN_LIST = 197; // Same TokenIDs present in the token list - int32 internal constant TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 198; // Exceeded the number of token transfers (both from and to) allowed for token transfer list - int32 internal constant EMPTY_TOKEN_TRANSFER_BODY = 199; // TokenTransfersTransactionBody has no TokenTransferList - int32 internal constant EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS = 200; // TokenTransfersTransactionBody has a TokenTransferList with no AccountAmounts - int32 internal constant INVALID_SCHEDULE_ID = 201; // The Scheduled entity does not exist; or has now expired, been deleted, or been executed - int32 internal constant SCHEDULE_IS_IMMUTABLE = 202; // The Scheduled entity cannot be modified. Admin key not set - int32 internal constant INVALID_SCHEDULE_PAYER_ID = 203; // The provided Scheduled Payer does not exist - int32 internal constant INVALID_SCHEDULE_ACCOUNT_ID = 204; // The Schedule Create Transaction TransactionID account does not exist - int32 internal constant NO_NEW_VALID_SIGNATURES = 205; // The provided sig map did not contain any new valid signatures from required signers of the scheduled transaction - int32 internal constant UNRESOLVABLE_REQUIRED_SIGNERS = 206; // The required signers for a scheduled transaction cannot be resolved, for example because they do not exist or have been deleted - int32 internal constant SCHEDULED_TRANSACTION_NOT_IN_WHITELIST = 207; // Only whitelisted transaction types may be scheduled - int32 internal constant SOME_SIGNATURES_WERE_INVALID = 208; // At least one of the signatures in the provided sig map did not represent a valid signature for any required signer - int32 internal constant TRANSACTION_ID_FIELD_NOT_ALLOWED = 209; // The scheduled field in the TransactionID may not be set to true - int32 internal constant IDENTICAL_SCHEDULE_ALREADY_CREATED = 210; // A schedule already exists with the same identifying fields of an attempted ScheduleCreate (that is, all fields other than scheduledPayerAccountID) - int32 internal constant INVALID_ZERO_BYTE_IN_STRING = 211; // A string field in the transaction has a UTF-8 encoding with the prohibited zero byte - int32 internal constant SCHEDULE_ALREADY_DELETED = 212; // A schedule being signed or deleted has already been deleted - int32 internal constant SCHEDULE_ALREADY_EXECUTED = 213; // A schedule being signed or deleted has already been executed - int32 internal constant MESSAGE_SIZE_TOO_LARGE = 214; // ConsensusSubmitMessage request's message size is larger than allowed. - int32 internal constant OPERATION_REPEATED_IN_BUCKET_GROUPS = 215; // An operation was assigned to more than one throttle group in a given bucket - int32 internal constant BUCKET_CAPACITY_OVERFLOW = 216; // The capacity needed to satisfy all opsPerSec groups in a bucket overflowed a signed 8-byte integral type - int32 internal constant NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION = 217; // Given the network size in the address book, the node-level capacity for an operation would never be enough to accept a single request; usually means a bucket burstPeriod should be increased - int32 internal constant BUCKET_HAS_NO_THROTTLE_GROUPS = 218; // A bucket was defined without any throttle groups - int32 internal constant THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC = 219; // A throttle group was granted zero opsPerSec - int32 internal constant SUCCESS_BUT_MISSING_EXPECTED_OPERATION = 220; // The throttle definitions file was updated, but some supported operations were not assigned a bucket - int32 internal constant UNPARSEABLE_THROTTLE_DEFINITIONS = 221; // The new contents for the throttle definitions system file were not valid protobuf - int32 internal constant INVALID_THROTTLE_DEFINITIONS = 222; // The new throttle definitions system file were invalid, and no more specific error could be divined - int32 internal constant ACCOUNT_EXPIRED_AND_PENDING_REMOVAL = 223; // The transaction references an account which has passed its expiration without renewal funds available, and currently remains in the ledger only because of the grace period given to expired entities - int32 internal constant INVALID_TOKEN_MAX_SUPPLY = 224; // Invalid token max supply - int32 internal constant INVALID_TOKEN_NFT_SERIAL_NUMBER = 225; // Invalid token nft serial number - int32 internal constant INVALID_NFT_ID = 226; // Invalid nft id - int32 internal constant METADATA_TOO_LONG = 227; // Nft metadata is too long - int32 internal constant BATCH_SIZE_LIMIT_EXCEEDED = 228; // Repeated operations count exceeds the limit - int32 internal constant INVALID_QUERY_RANGE = 229; // The range of data to be gathered is out of the set boundaries - int32 internal constant FRACTION_DIVIDES_BY_ZERO = 230; // A custom fractional fee set a denominator of zero - int32 internal constant INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE = 231; // The transaction payer could not afford a custom fee - int32 internal constant CUSTOM_FEES_LIST_TOO_LONG = 232; // More than 10 custom fees were specified - int32 internal constant INVALID_CUSTOM_FEE_COLLECTOR = 233; // Any of the feeCollector accounts for customFees is invalid - int32 internal constant INVALID_TOKEN_ID_IN_CUSTOM_FEES = 234; // Any of the token Ids in customFees is invalid - int32 internal constant TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR = 235; // Any of the token Ids in customFees are not associated to feeCollector - int32 internal constant TOKEN_MAX_SUPPLY_REACHED = 236; // A token cannot have more units minted due to its configured supply ceiling - int32 internal constant SENDER_DOES_NOT_OWN_NFT_SERIAL_NO = 237; // The transaction attempted to move an NFT serial number from an account other than its owner - int32 internal constant CUSTOM_FEE_NOT_FULLY_SPECIFIED = 238; // A custom fee schedule entry did not specify either a fixed or fractional fee - int32 internal constant CUSTOM_FEE_MUST_BE_POSITIVE = 239; // Only positive fees may be assessed at this time - int32 internal constant TOKEN_HAS_NO_FEE_SCHEDULE_KEY = 240; // Fee schedule key is not set on token - int32 internal constant CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE = 241; // A fractional custom fee exceeded the range of a 64-bit signed integer - int32 internal constant ROYALTY_FRACTION_CANNOT_EXCEED_ONE = 242; // A royalty cannot exceed the total fungible value exchanged for an NFT - int32 internal constant FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT = - 243; // Each fractional custom fee must have its maximum_amount, if specified, at least its minimum_amount - int32 internal constant CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES = 244; // A fee schedule update tried to clear the custom fees from a token whose fee schedule was already empty - int32 internal constant CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON = - 245; // Only tokens of type FUNGIBLE_COMMON can be used to as fee schedule denominations - int32 - internal constant CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = - 246; // Only tokens of type FUNGIBLE_COMMON can have fractional fees - int32 internal constant INVALID_CUSTOM_FEE_SCHEDULE_KEY = 247; // The provided custom fee schedule key was invalid - int32 internal constant INVALID_TOKEN_MINT_METADATA = 248; // The requested token mint metadata was invalid - int32 internal constant INVALID_TOKEN_BURN_METADATA = 249; // The requested token burn metadata was invalid - int32 internal constant CURRENT_TREASURY_STILL_OWNS_NFTS = 250; // The treasury for a unique token cannot be changed until it owns no NFTs - int32 internal constant ACCOUNT_STILL_OWNS_NFTS = 251; // An account cannot be dissociated from a unique token if it owns NFTs for the token - int32 internal constant TREASURY_MUST_OWN_BURNED_NFT = 252; // A NFT can only be burned when owned by the unique token's treasury - int32 internal constant ACCOUNT_DOES_NOT_OWN_WIPED_NFT = 253; // An account did not own the NFT to be wiped - int32 - internal constant ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = - 254; // An AccountAmount token transfers list referenced a token type other than FUNGIBLE_COMMON - int32 internal constant MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED = 255; // All the NFTs allowed in the current price regime have already been minted - int32 internal constant PAYER_ACCOUNT_DELETED = 256; // The payer account has been marked as deleted - int32 internal constant CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH = - 257; // The reference chain of custom fees for a transferred token exceeded the maximum length of 2 - int32 internal constant CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS = - 258; // More than 20 balance adjustments were to satisfy a CryptoTransfer and its implied custom fee payments - int32 internal constant INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE = - 259; // The sender account in the token transfer transaction could not afford a custom fee - int32 internal constant SERIAL_NUMBER_LIMIT_REACHED = 260; // Currently no more than 4,294,967,295 NFTs may be minted for a given unique token type - int32 - internal constant CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE = - 261; // Only tokens of type NON_FUNGIBLE_UNIQUE can have royalty fees - int32 internal constant NO_REMAINING_AUTOMATIC_ASSOCIATIONS = 262; // The account has reached the limit on the automatic associations count. - int32 internal constant EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT = - 263; // Already existing automatic associations are more than the new maximum automatic associations. - int32 - internal constant REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT = - 264; // Cannot set the number of automatic associations for an account more than the maximum allowed tokens.maxPerAccount. - int32 internal constant TOKEN_IS_PAUSED = 265; // Token is paused. This Token cannot be a part of any kind of Transaction until unpaused. - int32 internal constant TOKEN_HAS_NO_PAUSE_KEY = 266; // Pause key is not set on token - int32 internal constant INVALID_PAUSE_KEY = 267; // The provided pause key was invalid - int32 internal constant FREEZE_UPDATE_FILE_DOES_NOT_EXIST = 268; // The update file in a freeze transaction body must exist. - int32 internal constant FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH = 269; // The hash of the update file in a freeze transaction body must match the in-memory hash. - int32 internal constant NO_UPGRADE_HAS_BEEN_PREPARED = 270; // A FREEZE_UPGRADE transaction was handled with no previous update prepared. - int32 internal constant NO_FREEZE_IS_SCHEDULED = 271; // A FREEZE_ABORT transaction was handled with no scheduled freeze. - int32 internal constant UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE = - 272; // The update file hash when handling a FREEZE_UPGRADE transaction differs from the file hash at the time of handling the PREPARE_UPGRADE transaction. - int32 internal constant FREEZE_START_TIME_MUST_BE_FUTURE = 273; // The given freeze start time was in the (consensus) past. - int32 internal constant PREPARED_UPDATE_FILE_IS_IMMUTABLE = 274; // The prepared update file cannot be updated or appended until either the upgrade has been completed, or a FREEZE_ABORT has been handled. - int32 internal constant FREEZE_ALREADY_SCHEDULED = 275; // Once a freeze is scheduled, it must be aborted before any other type of freeze can be performed. - int32 internal constant FREEZE_UPGRADE_IN_PROGRESS = 276; // If an NMT upgrade has been prepared, the following operation must be a FREEZE_UPGRADE (To issue a FREEZE_ONLY, submit a FREEZE_ABORT first.) - int32 internal constant UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED = 277; // If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must confirm the id of the file to be used in the upgrade. - int32 internal constant UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED = 278; // If an NMT upgrade has been prepared, the subsequent FREEZE_UPGRADE transaction must confirm the hash of the file to be used in the upgrade. - int32 internal constant CONSENSUS_GAS_EXHAUSTED = 279; // Consensus throttle did not allow execution of this transaction. System is throttled at consensus level. - int32 internal constant REVERTED_SUCCESS = 280; // A precompiled contract succeeded, but was later reverted. - int32 internal constant MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED = 281; // All contract storage allocated to the current price regime has been consumed. - int32 internal constant INVALID_ALIAS_KEY = 282; // An alias used in a CryptoTransfer transaction is not the serialization of a primitive Key message -- that is, a Key with a single Ed25519 or ECDSA(secp256k1) public key and no unknown protobuf fields. - int32 internal constant UNEXPECTED_TOKEN_DECIMALS = 283; // A fungible token transfer expected a different number of decimals than the involved type actually has. - int32 internal constant INVALID_PROXY_ACCOUNT_ID = 284; // [Deprecated] The proxy account id is invalid or does not exist. - int32 internal constant INVALID_TRANSFER_ACCOUNT_ID = 285; // The transfer account id in CryptoDelete transaction is invalid or does not exist. - int32 internal constant INVALID_FEE_COLLECTOR_ACCOUNT_ID = 286; // The fee collector account id in TokenFeeScheduleUpdate is invalid or does not exist. - int32 internal constant ALIAS_IS_IMMUTABLE = 287; // The alias already set on an account cannot be updated using CryptoUpdate transaction. - int32 internal constant SPENDER_ACCOUNT_SAME_AS_OWNER = 288; // An approved allowance specifies a spender account that is the same as the hbar/token owner account. - int32 internal constant AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY = 289; // The establishment or adjustment of an approved allowance cause the token allowance to exceed the token maximum supply. - int32 internal constant NEGATIVE_ALLOWANCE_AMOUNT = 290; // The specified amount for an approved allowance cannot be negative. - int32 internal constant CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON = 291; // [Deprecated] The approveForAll flag cannot be set for a fungible token. - int32 internal constant SPENDER_DOES_NOT_HAVE_ALLOWANCE = 292; // The spender does not have an existing approved allowance with the hbar/token owner. - int32 internal constant AMOUNT_EXCEEDS_ALLOWANCE = 293; // The transfer amount exceeds the current approved allowance for the spender account. - int32 internal constant MAX_ALLOWANCES_EXCEEDED = 294; // The payer account of an approveAllowances or adjustAllowance transaction is attempting to go beyond the maximum allowed number of allowances. - int32 internal constant EMPTY_ALLOWANCES = 295; // No allowances have been specified in the approval transaction. - int32 internal constant SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES = 296; // [Deprecated] Spender is repeated more than once in Crypto or Token or NFT allowance lists in a single CryptoApproveAllowance transaction. - int32 internal constant REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES = 297; // [Deprecated] Serial numbers are repeated in nft allowance for a single spender account - int32 internal constant FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES = 298; // Fungible common token used in NFT allowances - int32 internal constant NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES = 299; // Non fungible token used in fungible token allowances - int32 internal constant INVALID_ALLOWANCE_OWNER_ID = 300; // The account id specified as the owner is invalid or does not exist. - int32 internal constant INVALID_ALLOWANCE_SPENDER_ID = 301; // The account id specified as the spender is invalid or does not exist. - int32 internal constant REPEATED_ALLOWANCES_TO_DELETE = 302; // [Deprecated] If the CryptoDeleteAllowance transaction has repeated crypto or token or Nft allowances to delete. - int32 internal constant INVALID_DELEGATING_SPENDER = 303; // If the account Id specified as the delegating spender is invalid or does not exist. - int32 internal constant DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL = - 304; // The delegating Spender cannot grant approveForAll allowance on a NFT token type for another spender. - int32 internal constant DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL = - 305; // The delegating Spender cannot grant allowance on a NFT serial for another spender as it doesnt not have approveForAll granted on token-owner. - int32 internal constant SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE = 306; // The scheduled transaction could not be created because it's expiration_time was too far in the future. - int32 - internal constant SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME = - 307; // The scheduled transaction could not be created because it's expiration_time was less than or equal to the consensus time. - int32 internal constant SCHEDULE_FUTURE_THROTTLE_EXCEEDED = 308; // The scheduled transaction could not be created because it would cause throttles to be violated on the specified expiration_time. - int32 internal constant SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED = 309; // The scheduled transaction could not be created because it would cause the gas limit to be violated on the specified expiration_time. - int32 internal constant INVALID_ETHEREUM_TRANSACTION = 310; // The ethereum transaction either failed parsing or failed signature validation, or some other EthereumTransaction error not covered by another response code. - int32 internal constant WRONG_CHAIN_ID = 311; // EthereumTransaction was signed against a chainId that this network does not support. - int32 internal constant WRONG_NONCE = 312; // This transaction specified an ethereumNonce that is not the current ethereumNonce of the account. - int32 internal constant ACCESS_LIST_UNSUPPORTED = 313; // The ethereum transaction specified an access list, which the network does not support. - int32 internal constant SCHEDULE_PENDING_EXPIRATION = 314; // A schedule being signed or deleted has passed it's expiration date and is pending execution if needed and then expiration. - int32 internal constant CONTRACT_IS_TOKEN_TREASURY = 315; // A selfdestruct or ContractDelete targeted a contract that is a token treasury. - int32 internal constant CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES = 316; // A selfdestruct or ContractDelete targeted a contract with non-zero token balances. - int32 internal constant CONTRACT_EXPIRED_AND_PENDING_REMOVAL = 317; // A contract referenced by a transaction is "detached"; that is, expired and lacking any hbar funds for auto-renewal payment---but still within its post-expiry grace period. - int32 internal constant CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT = 318; // A ContractUpdate requested removal of a contract's auto-renew account, but that contract has no auto-renew account. - int32 internal constant PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION = 319; // A delete transaction submitted via HAPI set permanent_removal=true - int32 internal constant PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED = 320; // A CryptoCreate or ContractCreate used the deprecated proxyAccountID field. - int32 internal constant SELF_STAKING_IS_NOT_ALLOWED = 321; // An account set the staked_account_id to itself in CryptoUpdate or ContractUpdate transactions. - int32 internal constant INVALID_STAKING_ID = 322; // The staking account id or staking node id given is invalid or does not exist. - int32 internal constant STAKING_NOT_ENABLED = 323; // Native staking, while implemented, has not yet enabled by the council. - int32 internal constant INVALID_PRNG_RANGE = 324; // The range provided in UtilPrng transaction is negative. - int32 internal constant MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED = - 325; // The maximum number of entities allowed in the current price regime have been created. - int32 internal constant INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE = 326; // The full prefix signature for precompile is not valid - int32 internal constant INSUFFICIENT_BALANCES_FOR_STORAGE_RENT = 327; // The combined balances of a contract and its auto-renew account (if any) did not cover the rent charged for net new storage used in a transaction. - int32 internal constant MAX_CHILD_RECORDS_EXCEEDED = 328; // A contract transaction tried to use more than the allowed number of child records, via either system contract records or internal contract creations. - int32 internal constant INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES = 329; // The combined balances of a contract and its auto-renew account (if any) or balance of an account did not cover the auto-renewal fees in a transaction. -} diff --git a/tools/layer-zero-example/contracts/hts/HederaTokenService.sol b/tools/layer-zero-example/contracts/hts/HederaTokenService.sol index cfc7d0be61..e52cd4a9f9 100644 --- a/tools/layer-zero-example/contracts/hts/HederaTokenService.sol +++ b/tools/layer-zero-example/contracts/hts/HederaTokenService.sol @@ -2,10 +2,13 @@ pragma solidity >=0.5.0 <0.9.0; pragma experimental ABIEncoderV2; -import "./HederaResponseCodes.sol"; import "./IHederaTokenService.sol"; abstract contract HederaTokenService { + // all response codes are defined here https://github.com/hashgraph/hedera-smart-contracts/blob/main/contracts/system-contracts/HederaResponseCodes.sol + int32 constant UNKNOWN_CODE = 21; + int32 constant SUCCESS_CODE = 22; + address constant precompileAddress = address(0x167); // 90 days in seconds int32 constant defaultAutoRenewPeriod = 7776000; @@ -20,27 +23,6 @@ abstract contract HederaTokenService { /// Generic event event CallResponseEvent(bool, bytes); - /// Performs transfers among combinations of tokens and hbars - /// @param transferList the list of hbar transfers to do - /// @param tokenTransfers the list of transfers to do - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @custom:version 0.3.0 the signature of the previous version was cryptoTransfer(TokenTransferList[] memory tokenTransfers) - function cryptoTransfer( - IHederaTokenService.TransferList memory transferList, - IHederaTokenService.TokenTransferList[] memory tokenTransfers - ) internal returns (int responseCode) { - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector( - IHederaTokenService.cryptoTransfer.selector, - transferList, - tokenTransfers - ) - ); - responseCode = success - ? abi.decode(result, (int32)) - : HederaResponseCodes.UNKNOWN; - } - /// Mints an amount of the token to the defined treasury account /// @param token The token for which to mint tokens. If token does not exist, transaction results in /// INVALID_TOKEN_ID @@ -74,7 +56,7 @@ abstract contract HederaTokenService { ); (responseCode, newTotalSupply, serialNumbers) = success ? abi.decode(result, (int32, int64, int64[])) - : (HederaResponseCodes.UNKNOWN, int64(0), new int64[](0)); + : (HederaTokenService.UNKNOWN_CODE, int64(0), new int64[](0)); } /// Burns an amount of the token from the defined treasury account @@ -101,39 +83,7 @@ abstract contract HederaTokenService { ); (responseCode, newTotalSupply) = success ? abi.decode(result, (int32, int64)) - : (HederaResponseCodes.UNKNOWN, int64(0)); - } - - function associateToken( - address account, - address token - ) internal returns (int responseCode) { - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector( - IHederaTokenService.associateToken.selector, - account, - token - ) - ); - responseCode = success - ? abi.decode(result, (int32)) - : HederaResponseCodes.UNKNOWN; - } - - function dissociateToken( - address account, - address token - ) internal returns (int responseCode) { - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector( - IHederaTokenService.dissociateToken.selector, - account, - token - ) - ); - responseCode = success - ? abi.decode(result, (int32)) - : HederaResponseCodes.UNKNOWN; + : (HederaTokenService.UNKNOWN_CODE, int64(0)); } /// Creates a Fungible Token with the specified properties @@ -165,84 +115,7 @@ abstract contract HederaTokenService { (responseCode, tokenAddress) = success ? abi.decode(result, (int32, address)) - : (HederaResponseCodes.UNKNOWN, address(0)); - } - - /// Retrieves general token info for a given token - /// @param token The ID of the token as a solidity address - /// @dev This function reverts if the call is not successful - function getTokenInfo( - address token - ) - internal - returns ( - int responseCode, - IHederaTokenService.TokenInfo memory tokenInfo - ) - { - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector( - IHederaTokenService.getTokenInfo.selector, - token - ) - ); - IHederaTokenService.TokenInfo memory defaultTokenInfo; - (responseCode, tokenInfo) = success - ? abi.decode(result, (int32, IHederaTokenService.TokenInfo)) - : (HederaResponseCodes.UNKNOWN, defaultTokenInfo); - } - - /// Allows spender to withdraw from your account multiple times, up to the value amount. If this function is called - /// again it overwrites the current allowance with value. - /// Only Applicable to Fungible Tokens - /// @param token The hedera token address to approve - /// @param spender the account authorized to spend - /// @param amount the amount of tokens authorized to spend. - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function approve( - address token, - address spender, - uint256 amount - ) internal returns (int responseCode) { - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector( - IHederaTokenService.approve.selector, - token, - spender, - amount - ) - ); - responseCode = success - ? abi.decode(result, (int32)) - : HederaResponseCodes.UNKNOWN; - } - - /// Transfers `amount` tokens from `from` to `to` using the - // allowance mechanism. `amount` is then deducted from the caller's allowance. - /// Only applicable to fungible tokens - /// @param token The address of the fungible Hedera token to transfer - /// @param from The account address of the owner of the token, on the behalf of which to transfer `amount` tokens - /// @param to The account address of the receiver of the `amount` tokens - /// @param amount The amount of tokens to transfer from `from` to `to` - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function transferFrom( - address token, - address from, - address to, - uint256 amount - ) external returns (int64 responseCode) { - (bool success, bytes memory result) = precompileAddress.call( - abi.encodeWithSelector( - IHederaTokenService.transferFrom.selector, - token, - from, - to, - amount - ) - ); - responseCode = success - ? abi.decode(result, (int32)) - : HederaResponseCodes.UNKNOWN; + : (HederaTokenService.UNKNOWN_CODE, address(0)); } /// Transfers tokens where the calling account/contract is implicitly the first entry in the token transfer list, @@ -269,6 +142,6 @@ abstract contract HederaTokenService { ); responseCode = success ? abi.decode(result, (int32)) - : HederaResponseCodes.UNKNOWN; + : HederaTokenService.UNKNOWN_CODE; } } diff --git a/tools/layer-zero-example/contracts/hts/IHederaTokenService.sol b/tools/layer-zero-example/contracts/hts/IHederaTokenService.sol index 8d0c56e2c3..c56fd96199 100644 --- a/tools/layer-zero-example/contracts/hts/IHederaTokenService.sol +++ b/tools/layer-zero-example/contracts/hts/IHederaTokenService.sol @@ -3,60 +3,6 @@ pragma solidity >=0.4.9 <0.9.0; pragma experimental ABIEncoderV2; interface IHederaTokenService { - /// Transfers cryptocurrency among two or more accounts by making the desired adjustments to their - /// balances. Each transfer list can specify up to 10 adjustments. Each negative amount is withdrawn - /// from the corresponding account (a sender), and each positive one is added to the corresponding - /// account (a receiver). The amounts list must sum to zero. Each amount is a number of tinybars - /// (there are 100,000,000 tinybars in one hbar). If any sender account fails to have sufficient - /// hbars, then the entire transaction fails, and none of those transfers occur, though the - /// transaction fee is still charged. This transaction must be signed by the keys for all the sending - /// accounts, and for any receiving accounts that have receiverSigRequired == true. The signatures - /// are in the same order as the accounts, skipping those accounts that don't need a signature. - /// @custom:version 0.3.0 previous version did not include isApproval - struct AccountAmount { - // The Account ID, as a solidity address, that sends/receives cryptocurrency or tokens - address accountID; - // The amount of the lowest denomination of the given token that - // the account sends(negative) or receives(positive) - int64 amount; - // If true then the transfer is expected to be an approved allowance and the - // accountID is expected to be the owner. The default is false (omitted). - bool isApproval; - } - - /// A sender account, a receiver account, and the serial number of an NFT of a Token with - /// NON_FUNGIBLE_UNIQUE type. When minting NFTs the sender will be the default AccountID instance - /// (0.0.0 aka 0x0) and when burning NFTs, the receiver will be the default AccountID instance. - /// @custom:version 0.3.0 previous version did not include isApproval - struct NftTransfer { - // The solidity address of the sender - address senderAccountID; - // The solidity address of the receiver - address receiverAccountID; - // The serial number of the NFT - int64 serialNumber; - // If true then the transfer is expected to be an approved allowance and the - // accountID is expected to be the owner. The default is false (omitted). - bool isApproval; - } - - struct TokenTransferList { - // The ID of the token as a solidity address - address token; - // Applicable to tokens of type FUNGIBLE_COMMON. Multiple list of AccountAmounts, each of which - // has an account and amount. - AccountAmount[] transfers; - // Applicable to tokens of type NON_FUNGIBLE_UNIQUE. Multiple list of NftTransfers, each of - // which has a sender and receiver account, including the serial number of the NFT - NftTransfer[] nftTransfers; - } - - struct TransferList { - // Multiple list of AccountAmounts, each of which has an account and amount. - // Used to transfer hbars between the accounts in the list. - AccountAmount[] transfers; - } - /// Expiry properties of a Hedera token - second, autoRenewAccount, autoRenewPeriod struct Expiry { // The epoch second at which the token should expire; if an auto-renew account and period are @@ -144,120 +90,10 @@ interface IHederaTokenService { Expiry expiry; } - /// Additional post creation fungible and non fungible properties of a Hedera Token. - struct TokenInfo { - /// Basic properties of a Hedera Token - HederaToken token; - /// The number of tokens (fungible) or serials (non-fungible) of the token - int64 totalSupply; - /// Specifies whether the token is deleted or not - bool deleted; - /// Specifies whether the token kyc was defaulted with KycNotApplicable (true) or Revoked (false) - bool defaultKycStatus; - /// Specifies whether the token is currently paused or not - bool pauseStatus; - /// The fixed fees collected when transferring the token - FixedFee[] fixedFees; - /// The fractional fees collected when transferring the token - FractionalFee[] fractionalFees; - /// The royalty fees collected when transferring the token - RoyaltyFee[] royaltyFees; - /// The ID of the network ledger - string ledgerId; - } - - /// Additional fungible properties of a Hedera Token. - struct FungibleTokenInfo { - /// The shared hedera token info - TokenInfo tokenInfo; - /// The number of decimal places a token is divisible by - int32 decimals; - } - - /// Additional non fungible properties of a Hedera Token. - struct NonFungibleTokenInfo { - /// The shared hedera token info - TokenInfo tokenInfo; - /// The serial number of the nft - int64 serialNumber; - /// The account id specifying the owner of the non fungible token - address ownerId; - /// The epoch second at which the token was created. - int64 creationTime; - /// The unique metadata of the NFT - bytes metadata; - /// The account id specifying an account that has been granted spending permissions on this nft - address spenderId; - } - - /// A fixed number of units (hbar or token) to assess as a fee during a transfer of - /// units of the token to which this fixed fee is attached. The denomination of - /// the fee depends on the values of tokenId, useHbarsForPayment and - /// useCurrentTokenForPayment. Exactly one of the values should be set. - struct FixedFee { - int64 amount; - // Specifies ID of token that should be used for fixed fee denomination - address tokenId; - // Specifies this fixed fee should be denominated in Hbar - bool useHbarsForPayment; - // Specifies this fixed fee should be denominated in the Token currently being created - bool useCurrentTokenForPayment; - // The ID of the account to receive the custom fee, expressed as a solidity address - address feeCollector; - } - - /// A fraction of the transferred units of a token to assess as a fee. The amount assessed will never - /// be less than the given minimumAmount, and never greater than the given maximumAmount. The - /// denomination is always units of the token to which this fractional fee is attached. - struct FractionalFee { - // A rational number's numerator, used to set the amount of a value transfer to collect as a custom fee - int64 numerator; - // A rational number's denominator, used to set the amount of a value transfer to collect as a custom fee - int64 denominator; - // The minimum amount to assess - int64 minimumAmount; - // The maximum amount to assess (zero implies no maximum) - int64 maximumAmount; - bool netOfTransfers; - // The ID of the account to receive the custom fee, expressed as a solidity address - address feeCollector; - } - - /// A fee to assess during a transfer that changes ownership of an NFT. Defines the fraction of - /// the fungible value exchanged for an NFT that the ledger should collect as a royalty. ("Fungible - /// value" includes both ℏ and units of fungible HTS tokens.) When the NFT sender does not receive - /// any fungible value, the ledger will assess the fallback fee, if present, to the new NFT owner. - /// Royalty fees can only be added to tokens of type type NON_FUNGIBLE_UNIQUE. - struct RoyaltyFee { - // A fraction's numerator of fungible value exchanged for an NFT to collect as royalty - int64 numerator; - // A fraction's denominator of fungible value exchanged for an NFT to collect as royalty - int64 denominator; - // If present, the fee to assess to the NFT receiver when no fungible value - // is exchanged with the sender. Consists of: - // amount: the amount to charge for the fee - // tokenId: Specifies ID of token that should be used for fixed fee denomination - // useHbarsForPayment: Specifies this fee should be denominated in Hbar - int64 amount; - address tokenId; - bool useHbarsForPayment; - // The ID of the account to receive the custom fee, expressed as a solidity address - address feeCollector; - } - /********************** * Direct HTS Calls * **********************/ - /// Performs transfers among combinations of tokens and hbars - /// @param transferList the list of hbar transfers to do - /// @param tokenTransfers the list of token transfers to do - /// @custom:version 0.3.0 the signature of the previous version was cryptoTransfer(TokenTransferList[] memory tokenTransfers) - function cryptoTransfer( - TransferList memory transferList, - TokenTransferList[] memory tokenTransfers - ) external returns (int64 responseCode); - /// Mints an amount of the token to the defined treasury account /// @param token The token for which to mint tokens. If token does not exist, transaction results in /// INVALID_TOKEN_ID @@ -296,67 +132,6 @@ interface IHederaTokenService { int64[] memory serialNumbers ) external returns (int64 responseCode, int64 newTotalSupply); - /// Associates the provided account with the provided tokens. Must be signed by the provided - /// Account's key or called from the accounts contract key - /// If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - /// If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - /// If any of the provided tokens is not found, the transaction will resolve to INVALID_TOKEN_REF. - /// If any of the provided tokens has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - /// If an association between the provided account and any of the tokens already exists, the - /// transaction will resolve to TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT. - /// If the provided account's associations count exceed the constraint of maximum token associations - /// per account, the transaction will resolve to TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED. - /// On success, associations between the provided account and tokens are made and the account is - /// ready to interact with the tokens. - /// @param account The account to be associated with the provided tokens - /// @param tokens The tokens to be associated with the provided account. In the case of NON_FUNGIBLE_UNIQUE - /// Type, once an account is associated, it can hold any number of NFTs (serial numbers) of that - /// token type - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function associateTokens( - address account, - address[] memory tokens - ) external returns (int64 responseCode); - - /// Single-token variant of associateTokens. Will be mapped to a single entry array call of associateTokens - /// @param account The account to be associated with the provided token - /// @param token The token to be associated with the provided account - function associateToken( - address account, - address token - ) external returns (int64 responseCode); - - /// Dissociates the provided account with the provided tokens. Must be signed by the provided - /// Account's key. - /// If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID. - /// If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED. - /// If any of the provided tokens is not found, the transaction will resolve to INVALID_TOKEN_REF. - /// If any of the provided tokens has been deleted, the transaction will resolve to TOKEN_WAS_DELETED. - /// If an association between the provided account and any of the tokens does not exist, the - /// transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT. - /// If a token has not been deleted and has not expired, and the user has a nonzero balance, the - /// transaction will resolve to TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES. - /// If a fungible token has expired, the user can disassociate even if their token balance is - /// not zero. - /// If a non fungible token has expired, the user can not disassociate if their token - /// balance is not zero. The transaction will resolve to TRANSACTION_REQUIRED_ZERO_TOKEN_BALANCES. - /// On success, associations between the provided account and tokens are removed. - /// @param account The account to be dissociated from the provided tokens - /// @param tokens The tokens to be dissociated from the provided account. - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function dissociateTokens( - address account, - address[] memory tokens - ) external returns (int64 responseCode); - - /// Single-token variant of dissociateTokens. Will be mapped to a single entry array call of dissociateTokens - /// @param account The account to be associated with the provided token - /// @param token The token to be associated with the provided account - function dissociateToken( - address account, - address token - ) external returns (int64 responseCode); - /// Creates a Fungible Token with the specified properties /// @param token the basic properties of the token being created /// @param initialTotalSupply Specifies the initial supply of tokens to be put in circulation. The @@ -370,69 +145,6 @@ interface IHederaTokenService { int32 decimals ) external payable returns (int64 responseCode, address tokenAddress); - /// Creates a Fungible Token with the specified properties - /// @param token the basic properties of the token being created - /// @param initialTotalSupply Specifies the initial supply of tokens to be put in circulation. The - /// initial supply is sent to the Treasury Account. The supply is in the lowest denomination possible. - /// @param decimals the number of decimal places a token is divisible by. - /// @param fixedFees list of fixed fees to apply to the token - /// @param fractionalFees list of fractional fees to apply to the token - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return tokenAddress the created token's address - function createFungibleTokenWithCustomFees( - HederaToken memory token, - int64 initialTotalSupply, - int32 decimals, - FixedFee[] memory fixedFees, - FractionalFee[] memory fractionalFees - ) external payable returns (int64 responseCode, address tokenAddress); - - /// Creates an Non Fungible Unique Token with the specified properties - /// @param token the basic properties of the token being created - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return tokenAddress the created token's address - function createNonFungibleToken( - HederaToken memory token - ) external payable returns (int64 responseCode, address tokenAddress); - - /// Creates an Non Fungible Unique Token with the specified properties - /// @param token the basic properties of the token being created - /// @param fixedFees list of fixed fees to apply to the token - /// @param royaltyFees list of royalty fees to apply to the token - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return tokenAddress the created token's address - function createNonFungibleTokenWithCustomFees( - HederaToken memory token, - FixedFee[] memory fixedFees, - RoyaltyFee[] memory royaltyFees - ) external payable returns (int64 responseCode, address tokenAddress); - - /********************** - * ABIV1 calls * - **********************/ - - /// Initiates a Fungible Token Transfer - /// @param token The ID of the token as a solidity address - /// @param accountId account to do a transfer to/from - /// @param amount The amount from the accountId at the same index - function transferTokens( - address token, - address[] memory accountId, - int64[] memory amount - ) external returns (int64 responseCode); - - /// Initiates a Non-Fungable Token Transfer - /// @param token The ID of the token as a solidity address - /// @param sender the sender of an nft - /// @param receiver the receiver of the nft sent by the same index at sender - /// @param serialNumber the serial number of the nft sent by the same index at sender - function transferNFTs( - address token, - address[] memory sender, - address[] memory receiver, - int64[] memory serialNumber - ) external returns (int64 responseCode); - /// Transfers tokens where the calling account/contract is implicitly the first entry in the token transfer list, /// where the amount is the value needed to zero balance the transfers. Regular signing rules apply for sending /// (positive amount) or receiving (negative amount) @@ -446,354 +158,4 @@ interface IHederaTokenService { address recipient, int64 amount ) external returns (int64 responseCode); - - /// Transfers tokens where the calling account/contract is implicitly the first entry in the token transfer list, - /// where the amount is the value needed to zero balance the transfers. Regular signing rules apply for sending - /// (positive amount) or receiving (negative amount) - /// @param token The token to transfer to/from - /// @param sender The sender for the transaction - /// @param recipient The receiver of the transaction - /// @param serialNumber The serial number of the NFT to transfer. - function transferNFT( - address token, - address sender, - address recipient, - int64 serialNumber - ) external returns (int64 responseCode); - - /// Allows spender to withdraw from your account multiple times, up to the value amount. If this function is called - /// again it overwrites the current allowance with value. - /// Only Applicable to Fungible Tokens - /// @param token The hedera token address to approve - /// @param spender the account address authorized to spend - /// @param amount the amount of tokens authorized to spend. - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function approve( - address token, - address spender, - uint256 amount - ) external returns (int64 responseCode); - - /// Transfers `amount` tokens from `from` to `to` using the - // allowance mechanism. `amount` is then deducted from the caller's allowance. - /// Only applicable to fungible tokens - /// @param token The address of the fungible Hedera token to transfer - /// @param from The account address of the owner of the token, on the behalf of which to transfer `amount` tokens - /// @param to The account address of the receiver of the `amount` tokens - /// @param amount The amount of tokens to transfer from `from` to `to` - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function transferFrom( - address token, - address from, - address to, - uint256 amount - ) external returns (int64 responseCode); - - /// Returns the amount which spender is still allowed to withdraw from owner. - /// Only Applicable to Fungible Tokens - /// @param token The Hedera token address to check the allowance of - /// @param owner the owner of the tokens to be spent - /// @param spender the spender of the tokens - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return allowance The amount which spender is still allowed to withdraw from owner. - function allowance( - address token, - address owner, - address spender - ) external returns (int64 responseCode, uint256 allowance); - - /// Allow or reaffirm the approved address to transfer an NFT the approved address does not own. - /// Only Applicable to NFT Tokens - /// @param token The Hedera NFT token address to approve - /// @param approved The new approved NFT controller. To revoke approvals pass in the zero address. - /// @param serialNumber The NFT serial number to approve - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function approveNFT( - address token, - address approved, - uint256 serialNumber - ) external returns (int64 responseCode); - - /// Transfers `serialNumber` of `token` from `from` to `to` using the allowance mechanism. - /// Only applicable to NFT tokens - /// @param token The address of the non-fungible Hedera token to transfer - /// @param from The account address of the owner of `serialNumber` of `token` - /// @param to The account address of the receiver of `serialNumber` - /// @param serialNumber The NFT serial number to transfer - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function transferFromNFT( - address token, - address from, - address to, - uint256 serialNumber - ) external returns (int64 responseCode); - - /// Get the approved address for a single NFT - /// Only Applicable to NFT Tokens - /// @param token The Hedera NFT token address to check approval - /// @param serialNumber The NFT to find the approved address for - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return approved The approved address for this NFT, or the zero address if there is none - function getApproved( - address token, - uint256 serialNumber - ) external returns (int64 responseCode, address approved); - - /// Enable or disable approval for a third party ("operator") to manage - /// all of `msg.sender`'s assets - /// @param token The Hedera NFT token address to approve - /// @param operator Address to add to the set of authorized operators - /// @param approved True if the operator is approved, false to revoke approval - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function setApprovalForAll( - address token, - address operator, - bool approved - ) external returns (int64 responseCode); - - /// Query if an address is an authorized operator for another address - /// Only Applicable to NFT Tokens - /// @param token The Hedera NFT token address to approve - /// @param owner The address that owns the NFTs - /// @param operator The address that acts on behalf of the owner - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return approved True if `operator` is an approved operator for `owner`, false otherwise - function isApprovedForAll( - address token, - address owner, - address operator - ) external returns (int64 responseCode, bool approved); - - /// Query if token account is frozen - /// @param token The token address to check - /// @param account The account address associated with the token - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return frozen True if `account` is frozen for `token` - function isFrozen( - address token, - address account - ) external returns (int64 responseCode, bool frozen); - - /// Query if token account has kyc granted - /// @param token The token address to check - /// @param account The account address associated with the token - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return kycGranted True if `account` has kyc granted for `token` - function isKyc( - address token, - address account - ) external returns (int64 responseCode, bool kycGranted); - - /// Operation to delete token - /// @param token The token address to be deleted - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function deleteToken(address token) external returns (int64 responseCode); - - /// Query token custom fees - /// @param token The token address to check - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return fixedFees Set of fixed fees for `token` - /// @return fractionalFees Set of fractional fees for `token` - /// @return royaltyFees Set of royalty fees for `token` - function getTokenCustomFees( - address token - ) - external - returns ( - int64 responseCode, - FixedFee[] memory fixedFees, - FractionalFee[] memory fractionalFees, - RoyaltyFee[] memory royaltyFees - ); - - /// Query token default freeze status - /// @param token The token address to check - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return defaultFreezeStatus True if `token` default freeze status is frozen. - function getTokenDefaultFreezeStatus( - address token - ) external returns (int64 responseCode, bool defaultFreezeStatus); - - /// Query token default kyc status - /// @param token The token address to check - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return defaultKycStatus True if `token` default kyc status is KycNotApplicable and false if Revoked. - function getTokenDefaultKycStatus( - address token - ) external returns (int64 responseCode, bool defaultKycStatus); - - /// Query token expiry info - /// @param token The token address to check - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return expiry Expiry info for `token` - function getTokenExpiryInfo( - address token - ) external returns (int64 responseCode, Expiry memory expiry); - - /// Query fungible token info - /// @param token The token address to check - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return fungibleTokenInfo FungibleTokenInfo info for `token` - function getFungibleTokenInfo( - address token - ) - external - returns ( - int64 responseCode, - FungibleTokenInfo memory fungibleTokenInfo - ); - - /// Query token info - /// @param token The token address to check - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return tokenInfo TokenInfo info for `token` - function getTokenInfo( - address token - ) external returns (int64 responseCode, TokenInfo memory tokenInfo); - - /// Query token KeyValue - /// @param token The token address to check - /// @param keyType The keyType of the desired KeyValue - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return key KeyValue info for key of type `keyType` - function getTokenKey( - address token, - uint keyType - ) external returns (int64 responseCode, KeyValue memory key); - - /// Query non fungible token info - /// @param token The token address to check - /// @param serialNumber The NFT serialNumber to check - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return nonFungibleTokenInfo NonFungibleTokenInfo info for `token` `serialNumber` - function getNonFungibleTokenInfo( - address token, - int64 serialNumber - ) - external - returns ( - int64 responseCode, - NonFungibleTokenInfo memory nonFungibleTokenInfo - ); - - /// Operation to freeze token account - /// @param token The token address - /// @param account The account address to be frozen - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function freezeToken( - address token, - address account - ) external returns (int64 responseCode); - - /// Operation to unfreeze token account - /// @param token The token address - /// @param account The account address to be unfrozen - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function unfreezeToken( - address token, - address account - ) external returns (int64 responseCode); - - /// Operation to grant kyc to token account - /// @param token The token address - /// @param account The account address to grant kyc - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function grantTokenKyc( - address token, - address account - ) external returns (int64 responseCode); - - /// Operation to revoke kyc to token account - /// @param token The token address - /// @param account The account address to revoke kyc - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function revokeTokenKyc( - address token, - address account - ) external returns (int64 responseCode); - - /// Operation to pause token - /// @param token The token address to be paused - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function pauseToken(address token) external returns (int64 responseCode); - - /// Operation to unpause token - /// @param token The token address to be unpaused - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function unpauseToken(address token) external returns (int64 responseCode); - - /// Operation to wipe fungible tokens from account - /// @param token The token address - /// @param account The account address to revoke kyc - /// @param amount The number of tokens to wipe - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function wipeTokenAccount( - address token, - address account, - int64 amount - ) external returns (int64 responseCode); - - /// Operation to wipe non fungible tokens from account - /// @param token The token address - /// @param account The account address to revoke kyc - /// @param serialNumbers The serial numbers of token to wipe - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function wipeTokenAccountNFT( - address token, - address account, - int64[] memory serialNumbers - ) external returns (int64 responseCode); - - /// Operation to update token info - /// @param token The token address - /// @param tokenInfo The hedera token info to update token with - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function updateTokenInfo( - address token, - HederaToken memory tokenInfo - ) external returns (int64 responseCode); - - /// Operation to update token expiry info - /// @param token The token address - /// @param expiryInfo The hedera token expiry info - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function updateTokenExpiryInfo( - address token, - Expiry memory expiryInfo - ) external returns (int64 responseCode); - - /// Operation to update token expiry info - /// @param token The token address - /// @param keys The token keys - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - function updateTokenKeys( - address token, - TokenKey[] memory keys - ) external returns (int64 responseCode); - - /// Query if valid token found for the given address - /// @param token The token address - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return isToken True if valid token found for the given address - function isToken( - address token - ) external returns (int64 responseCode, bool isToken); - - /// Query to return the token type for a given address - /// @param token The token address - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return tokenType the token type. 0 is FUNGIBLE_COMMON, 1 is NON_FUNGIBLE_UNIQUE, -1 is UNRECOGNIZED - function getTokenType( - address token - ) external returns (int64 responseCode, int32 tokenType); - - /// Initiates a Redirect For Token - /// @param token The token address - /// @param encodedFunctionSelector The function selector from the ERC20 interface + the bytes input for the function called - /// @return responseCode The response code for the status of the request. SUCCESS is 22. - /// @return response The result of the call that had been encoded and sent for execution. - function redirectForToken( - address token, - bytes memory encodedFunctionSelector - ) external returns (int64 responseCode, bytes memory response); } diff --git a/tools/layer-zero-example/contracts/hts/KeyHelper.sol b/tools/layer-zero-example/contracts/hts/KeyHelper.sol index 8888c42af8..21333f0bdf 100644 --- a/tools/layer-zero-example/contracts/hts/KeyHelper.sol +++ b/tools/layer-zero-example/contracts/hts/KeyHelper.sol @@ -37,55 +37,6 @@ abstract contract KeyHelper { keyTypes[KeyType.PAUSE] = 64; } - function getDefaultKeys() - internal - view - returns (IHederaTokenService.TokenKey[] memory keys) - { - keys = new IHederaTokenService.TokenKey[](2); - keys[0] = getSingleKey(KeyType.KYC, KeyValueType.CONTRACT_ID, ""); - keys[1] = IHederaTokenService.TokenKey( - getDuplexKeyType(KeyType.SUPPLY, KeyType.PAUSE), - getKeyValueType(KeyValueType.CONTRACT_ID, "") - ); - } - - function getAllTypeKeys( - KeyValueType keyValueType, - bytes memory key - ) internal view returns (IHederaTokenService.TokenKey[] memory keys) { - keys = new IHederaTokenService.TokenKey[](1); - keys[0] = IHederaTokenService.TokenKey( - getAllKeyTypes(), - getKeyValueType(keyValueType, key) - ); - } - - function getCustomSingleTypeKeys( - KeyType keyType, - KeyValueType keyValueType, - bytes memory key - ) internal view returns (IHederaTokenService.TokenKey[] memory keys) { - keys = new IHederaTokenService.TokenKey[](1); - keys[0] = IHederaTokenService.TokenKey( - getKeyType(keyType), - getKeyValueType(keyValueType, key) - ); - } - - function getCustomDuplexTypeKeys( - KeyType firstType, - KeyType secondType, - KeyValueType keyValueType, - bytes memory key - ) internal view returns (IHederaTokenService.TokenKey[] memory keys) { - keys = new IHederaTokenService.TokenKey[](1); - keys[0] = IHederaTokenService.TokenKey( - getDuplexKeyType(firstType, secondType), - getKeyValueType(keyValueType, key) - ); - } - function getSingleKey( KeyType keyType, KeyValueType keyValueType, @@ -97,17 +48,6 @@ abstract contract KeyHelper { ); } - function getSingleKey( - KeyType keyType, - KeyValueType keyValueType, - address key - ) internal view returns (IHederaTokenService.TokenKey memory tokenKey) { - tokenKey = IHederaTokenService.TokenKey( - getKeyType(keyType), - getKeyValueType(keyValueType, key) - ); - } - function getSingleKey( KeyType firstType, KeyType secondType, @@ -128,16 +68,6 @@ abstract contract KeyHelper { keyType = keyType.setBit(uint8(secondType)); } - function getAllKeyTypes() internal pure returns (uint256 keyType) { - keyType = keyType.setBit(uint8(KeyType.ADMIN)); - keyType = keyType.setBit(uint8(KeyType.KYC)); - keyType = keyType.setBit(uint8(KeyType.FREEZE)); - keyType = keyType.setBit(uint8(KeyType.WIPE)); - keyType = keyType.setBit(uint8(KeyType.SUPPLY)); - keyType = keyType.setBit(uint8(KeyType.FEE)); - keyType = keyType.setBit(uint8(KeyType.PAUSE)); - } - function getKeyType(KeyType keyType) internal view returns (uint256) { return keyTypes[keyType]; } @@ -158,17 +88,6 @@ abstract contract KeyHelper { keyValue.delegatableContractId = supplyContract; } } - - function getKeyValueType( - KeyValueType keyValueType, - address keyAddress - ) internal pure returns (IHederaTokenService.KeyValue memory keyValue) { - if (keyValueType == KeyValueType.CONTRACT_ID) { - keyValue.contractId = keyAddress; - } else if (keyValueType == KeyValueType.DELEGETABLE_CONTRACT_ID) { - keyValue.delegatableContractId = keyAddress; - } - } } library Bits { diff --git a/tools/layer-zero-example/hardhat.config.js b/tools/layer-zero-example/hardhat.config.js index e2118af85e..b21e74f123 100644 --- a/tools/layer-zero-example/hardhat.config.js +++ b/tools/layer-zero-example/hardhat.config.js @@ -54,6 +54,8 @@ module.exports = { const getEndpointAddress = (network) => { let ENDPOINT_V2; + // we're using the official LZ endpoints + // a list of all endpoint addresses can be found here https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts if (network === 'hedera_testnet') { ENDPOINT_V2 = '0xbD672D1562Dd32C23B563C989d8140122483631d'; } else if (network === 'bsc_testnet') { From e4c1f479ba5e08bae2465623c361fe58c1cff661 Mon Sep 17 00:00:00 2001 From: nikolay Date: Fri, 20 Dec 2024 16:22:21 +0200 Subject: [PATCH 10/14] chore: add hts connector to the readme Signed-off-by: nikolay --- tools/layer-zero-example/README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index 34924a6cf6..62fc6128f5 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -192,23 +192,40 @@ npx hardhat test --grep "ONFTAdapterTests @bsc @test" --network bsc_testnet ### HTS Connector +That's a variant of OFT but using HTS token. Due to several incompatibilities between ERC20 and HTS tokens, we're not able to use it out-of-the-box. All of them are described in the "HTS Adapter vs HTS Connector" section below. + +- Deploying OFT on an EVM chain and HTS Connector on the Hedera chain. The HTS Connector extends OFTCore and creates HTS token within its constructor. Also, overrides OFTCore _debit and _credit with related HTS mint and burn precompile calls +``` npx hardhat deploy-hts-connector --network hedera_testnet npx hardhat deploy-oft --decimals 8 --mint 1000 --network bsc_testnet +``` +- In order to connect OFTs together, we need to set the peer of the target OFT, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts +``` npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet +``` -fill the .env +- Fill the .env +- Approving HTS Connector to use some signer's tokens +``` npx hardhat test --grep "HTSConnectorTests @hedera @approve" --network hedera_testnet +``` +- On these steps, we're sending tokens from an EVM chain to Hedera and receiving HTS tokens and vice versa +``` npx hardhat test --grep "HTSConnectorTests @hedera @send" --network hedera_testnet npx hardhat test --grep "HTSConnectorTests @bsc @send" --network bsc_testnet +``` -Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +Finally we're checking whether the balances are expected on both source and destination chains +``` npx hardhat test --grep "HTSConnectorTests @hedera @test" --network hedera_testnet npx hardhat test --grep "HTSConnectorTests @bsc @test" --network bsc_testnet +``` ### HTS Adapter @@ -257,3 +274,9 @@ npx hardhat test --grep "WHBARTests @bsc @send" --network bsc_testnet npx hardhat test --grep "WHBARTests @hedera @test" --network hedera_testnet npx hardhat test --grep "WHBARTests @bsc @test" --network bsc_testnet + +### Useful information: +- The addresses of endpoints [here](https://github.com/hashgraph/hedera-json-rpc-relay/blob/1030-lz-setup/tools/layer-zero-example/hardhat.config.js#L60) are the official LZ endpoints. A entire list of LZ supported endpoints can be found on https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts. + +### HTS Adapter vs HTS Connector +... \ No newline at end of file From f4b1bfefb4fc63ff0fe29963ea2452759b095032 Mon Sep 17 00:00:00 2001 From: nikolay Date: Fri, 20 Dec 2024 16:39:28 +0200 Subject: [PATCH 11/14] chore: fix readme Signed-off-by: nikolay --- tools/layer-zero-example/README.md | 105 +++++++++++++++++++---------- 1 file changed, 69 insertions(+), 36 deletions(-) diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index 62fc6128f5..ae982cff54 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -5,13 +5,13 @@ Message-passing interface to send and receive arbitrary pieces of data between contracts existing on different chains. - Deploying the oapp contract on each network we're going to interact -``` +```typescript npx hardhat deploy-oapp --network hedera_testnet npx hardhat deploy-oapp --network bsc_testnet ``` - In order to connect oapps together, we need to set the peer of the target oapp, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts -``` +```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet ``` @@ -19,7 +19,7 @@ npx hardhat set-peer --source --target - Fill the .env - On these steps, we're sending messages from one chain to another and vice versa -``` +```typescript npx hardhat test --grep "OAppTests @hedera @send" --network hedera_testnet npx hardhat test --grep "OAppTests @bsc @send" --network bsc_testnet ``` @@ -27,7 +27,7 @@ npx hardhat test --grep "OAppTests @bsc @send" --network bsc_testnet - Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ - Finally we're checking whether the messages are received on both chains -``` +```typescript npx hardhat test --grep "OAppTests @hedera @test" --network hedera_testnet npx hardhat test --grep "OAppTests @bsc @test" --network bsc_testnet ``` @@ -37,13 +37,13 @@ npx hardhat test --grep "OAppTests @bsc @test" --network bsc_testnet Allows fungible tokens to be transferred across multiple chains. - Deploying OFT tokens which under the hood are ERC20s and contain the messaging between chains functionality provided by LZ -``` +```typescript npx hardhat deploy-oft --decimals 18 --mint 1000000000000000000 --network hedera_testnet npx hardhat deploy-oft --decimals 18 --mint 1000000000000000000 --network bsc_testnet ``` - In order to connect OFTs together, we need to set the peer of the target OFT, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts -``` +```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet ``` @@ -51,7 +51,7 @@ npx hardhat set-peer --source --target -- - Fill the .env - On these steps, we're sending tokens between chains. That means we're burning tokens on the source chain and minting new ones on the destination chain -``` +```typescript npx hardhat test --grep "OFTTests @hedera @send" --network hedera_testnet npx hardhat test --grep "OFTTests @bsc @send" --network bsc_testnet ``` @@ -59,7 +59,7 @@ npx hardhat test --grep "OFTTests @bsc @send" --network bsc_testnet - Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ - Finally we're checking whether the token balances are as expected on both the source and destination chains. -``` +```typescript npx hardhat test --grep "OFTTests @hedera @test" --network hedera_testnet npx hardhat test --grep "OFTTests @bsc @test" --network bsc_testnet ``` @@ -69,19 +69,19 @@ npx hardhat test --grep "OFTTests @bsc @test" --network bsc_testnet If your token already exists on the chain you want to connect, you can deploy the OFT Adapter contract to act as an intermediary lockbox for the token. - Deploying ERC20 tokens on each chain -``` +```typescript npx hardhat deploy-erc20 --decimals 18 --mint 10000000000000000000 --network hedera_testnet npx hardhat deploy-erc20 --decimals 18 --mint 10000000000000000000 --network bsc_testnet ``` -- Deploying an OFT Adapter which will be used as a lockbox of ERC20s deployed the step above -``` +- Deploying an OFT Adapters which will be used as a lockbox of ERC20s deployed the step above +```typescript npx hardhat deploy-oft-adapter --token --network hedera_testnet npx hardhat deploy-oft-adapter --token --network bsc_testnet ``` - In order to connect OFT Adapters together, we need to set the peer of the target OFT Adapter, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts -``` +```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet ``` @@ -89,13 +89,13 @@ npx hardhat set-peer --source --target - Finally we're checking the balances on each chain -``` +```typescript npx hardhat test --grep "OFTAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "OFTAdapterTests @bsc @test" --network bsc_testnet ``` @@ -113,13 +113,13 @@ npx hardhat test --grep "OFTAdapterTests @bsc @test" --network bsc_testnet Allows non-fungible tokens to be transferred across multiple chains. - Deploying ONFT tokens which under the hood are ERC721s and contain the messaging between chains functionality provided by LZ -``` +```typescript npx hardhat deploy-onft --network hedera_testnet npx hardhat deploy-onft --network bsc_testnet ``` - In order to connect ONFTs together, we need to set the peer of the target ONFT, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts -``` +```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet ``` @@ -127,7 +127,7 @@ npx hardhat set-peer --source --target - Fill the .env - On these steps, we're sending NFTs between chains. That means we're burning the NFT on the source chain and minting new one on the destination chain -``` +```typescript npx hardhat test --grep "ONFTTests @hedera @send" --network hedera_testnet npx hardhat test --grep "ONFTTests @bsc @send" --network bsc_testnet ``` @@ -135,7 +135,7 @@ npx hardhat test --grep "ONFTTests @bsc @send" --network bsc_testnet - Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ - Finally we're checking whether the NFTs are transferred successfully -``` +```typescript npx hardhat test --grep "ONFTTests @hedera @send" --network hedera_testnet npx hardhat test --grep "ONFTTests @bsc @send" --network bsc_testnet ``` @@ -145,19 +145,19 @@ npx hardhat test --grep "ONFTTests @bsc @send" --network bsc_testnet If your NFT contract already exists on the chain you want to connect, you can deploy the ONFT Adapter contract to act as an intermediary lockbox. - Deploying ERC721s on each chain we want to connect -``` +```typescript npx hardhat deploy-erc721 --network hedera_testnet npx hardhat deploy-erc721 --network bsc_testnet ``` - Deploying an ONFT Adapter which will be used as a lockbox of ERC721s deployed the step above -``` +```typescript npx hardhat deploy-onft-adapter --token --network hedera_testnet npx hardhat deploy-onft-adapter --token --network bsc_testnet ``` - In order to connect ONFT Adapters together, we need to set the peer of the target ONFT Adapter, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts -``` +```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet ``` @@ -165,19 +165,19 @@ npx hardhat set-peer --source --target - Finally we're checking whether the NFTs are transferred successfully -``` +```typescript npx hardhat test --grep "ONFTAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "ONFTAdapterTests @bsc @test" --network bsc_testnet ``` ### HTS Connector -That's a variant of OFT but using HTS token. Due to several incompatibilities between ERC20 and HTS tokens, we're not able to use it out-of-the-box. All of them are described in the "HTS Adapter vs HTS Connector" section below. +That's a variant of OFT but using an HTS token. Due to several incompatibilities between ERC20 and HTS tokens, we're not able to use them out of the box. All of them are described in the "HTS Adapter vs HTS Connector" section below. - Deploying OFT on an EVM chain and HTS Connector on the Hedera chain. The HTS Connector extends OFTCore and creates HTS token within its constructor. Also, overrides OFTCore _debit and _credit with related HTS mint and burn precompile calls -``` +```typescript npx hardhat deploy-hts-connector --network hedera_testnet npx hardhat deploy-oft --decimals 8 --mint 1000 --network bsc_testnet ``` - In order to connect OFTs together, we need to set the peer of the target OFT, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts -``` +```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet ``` @@ -209,12 +209,12 @@ npx hardhat set-peer --source --target -- - Fill the .env - Approving HTS Connector to use some signer's tokens -``` +```typescript npx hardhat test --grep "HTSConnectorTests @hedera @approve" --network hedera_testnet ``` - On these steps, we're sending tokens from an EVM chain to Hedera and receiving HTS tokens and vice versa -``` +```typescript npx hardhat test --grep "HTSConnectorTests @hedera @send" --network hedera_testnet npx hardhat test --grep "HTSConnectorTests @bsc @send" --network bsc_testnet ``` @@ -222,58 +222,91 @@ npx hardhat test --grep "HTSConnectorTests @bsc @send" --network bsc_testnet - Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ Finally we're checking whether the balances are expected on both source and destination chains -``` +```typescript npx hardhat test --grep "HTSConnectorTests @hedera @test" --network hedera_testnet npx hardhat test --grep "HTSConnectorTests @bsc @test" --network bsc_testnet ``` ### HTS Adapter +If your HTS token already exists on Hedera and you want to connect it to another chain, you can deploy the OFT Adapter contract to act as an intermediary lockbox for it. + +- Deploying ERC20 and HTS +```typescript npx hardhat create-hts-token --network hedera_testnet npx hardhat deploy-erc20 --decimals 8 --mint 1000 --network bsc_testnet +``` -npx hardhat deploy-oft-adapter --token --network hedera_testnet +- Deploying an OFT Adapters which will be used as lockboxes of ERC20 and HTS deployed the step above +```typescript +npx hardhat deploy-oft-adapter --token --network hedera_testnet npx hardhat deploy-oft-adapter --token --network bsc_testnet +``` +- In order to connect OFT Adapters together, we need to set the peer of the target OFT Adapter, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts +```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet +``` -fill the .env +- Fill the .env +- Here we're funding the Adapter on both chains with some liquidity and after that we're approving it to spend the signer's token +```typescript npx hardhat test --grep "HTSAdapterTests @hedera @fund-and-approve" --network hedera_testnet npx hardhat test --grep "HTSAdapterTests @bsc @fund-and-approve" --network bsc_testnet +``` +- On these steps, we're sending already existing tokens that are used by OFT Adapter between different chains +```typescript npx hardhat test --grep "HTSAdapterTests @hedera @send" --network hedera_testnet npx hardhat test --grep "HTSAdapterTests @bsc @send" --network bsc_testnet - +``` Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ +- Finally we're checking whether the tokens are transferred successfully +```typescript npx hardhat test --grep "HTSAdapterTests @hedera @test" --network hedera_testnet npx hardhat test --grep "HTSAdapterTests @bsc @test" --network bsc_testnet +``` ### WHBAR flow +```typescript npx hardhat deploy-whbar --network hedera_testnet npx hardhat deploy-erc20 --decimals 8 --mint 100000000 --network bsc_testnet +``` +```typescript npx hardhat deploy-oft-adapter --token --network hedera_testnet npx hardhat deploy-oft-adapter --token --network bsc_testnet +``` +```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet +``` -fill the .env +- Fill the .env +```typescript npx hardhat test --grep "WHBARTests @hedera @deposit" --network hedera_testnet +``` +```typescript npx hardhat test --grep "WHBARTests @hedera @fund-and-approve" --network hedera_testnet npx hardhat test --grep "WHBARTests @bsc @fund-and-approve" --network bsc_testnet +``` +```typescript npx hardhat test --grep "WHBARTests @hedera @send" --network hedera_testnet npx hardhat test --grep "WHBARTests @bsc @send" --network bsc_testnet +``` +```typescript npx hardhat test --grep "WHBARTests @hedera @test" --network hedera_testnet npx hardhat test --grep "WHBARTests @bsc @test" --network bsc_testnet +``` ### Useful information: - The addresses of endpoints [here](https://github.com/hashgraph/hedera-json-rpc-relay/blob/1030-lz-setup/tools/layer-zero-example/hardhat.config.js#L60) are the official LZ endpoints. A entire list of LZ supported endpoints can be found on https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts. From 4cac520f89f83baca4b4af0ef8b64f3cc24f8248 Mon Sep 17 00:00:00 2001 From: nikolay Date: Fri, 20 Dec 2024 16:40:52 +0200 Subject: [PATCH 12/14] chore: fix readme Signed-off-by: nikolay --- tools/layer-zero-example/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index ae982cff54..d0ae03a5ea 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -262,7 +262,8 @@ npx hardhat test --grep "HTSAdapterTests @bsc @fund-and-approve" --network bsc_t npx hardhat test --grep "HTSAdapterTests @hedera @send" --network hedera_testnet npx hardhat test --grep "HTSAdapterTests @bsc @send" --network bsc_testnet ``` -Wait a couple of minutes, the LZ progress can be tracked on https://testnet.layerzeroscan.com/tx/ + +- Wait a couple of minutes, the LZ progress can be tracked on `https://testnet.layerzeroscan.com/tx/` - Finally we're checking whether the tokens are transferred successfully ```typescript From c11d82eac26310387d0849faf9264f1926f198ee Mon Sep 17 00:00:00 2001 From: nikolay Date: Fri, 3 Jan 2025 14:43:34 +0200 Subject: [PATCH 13/14] chore: resolve comments Signed-off-by: nikolay --- .../contracts/CreateHTS.sol | 8 +-- .../contracts/HTSConnector.sol | 8 +-- .../contracts/hts/KeyHelper.sol | 20 ------ tools/layer-zero-example/hardhat.config.js | 64 +++++++++---------- .../test/htsAdapterTests.js | 6 +- .../test/htsConnectorTests.js | 3 +- .../test/oftAdapterTests.js | 6 +- .../test/onftAdapterTests.js | 8 ++- tools/layer-zero-example/test/whbarTests.js | 9 ++- 9 files changed, 60 insertions(+), 72 deletions(-) diff --git a/tools/layer-zero-example/contracts/CreateHTS.sol b/tools/layer-zero-example/contracts/CreateHTS.sol index 6a58707fd2..bdc541894a 100644 --- a/tools/layer-zero-example/contracts/CreateHTS.sol +++ b/tools/layer-zero-example/contracts/CreateHTS.sol @@ -10,14 +10,8 @@ contract CreateHTS is Ownable, KeyHelper, HederaTokenService { address public htsTokenAddress; constructor(string memory _name, string memory _symbol, address _delegate) payable Ownable(_delegate) { - IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](2); + IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](1); keys[0] = getSingleKey( - KeyType.ADMIN, - KeyType.PAUSE, - KeyValueType.INHERIT_ACCOUNT_KEY, - bytes("") - ); - keys[1] = getSingleKey( KeyType.SUPPLY, KeyValueType.INHERIT_ACCOUNT_KEY, bytes("") diff --git a/tools/layer-zero-example/contracts/HTSConnector.sol b/tools/layer-zero-example/contracts/HTSConnector.sol index f8f144b6a6..da21587fbe 100644 --- a/tools/layer-zero-example/contracts/HTSConnector.sol +++ b/tools/layer-zero-example/contracts/HTSConnector.sol @@ -28,14 +28,8 @@ abstract contract HTSConnector is OFTCore, KeyHelper, HederaTokenService { address _lzEndpoint, address _delegate ) payable OFTCore(8, _lzEndpoint, _delegate) { - IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](2); + IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](1); keys[0] = getSingleKey( - KeyType.ADMIN, - KeyType.PAUSE, - KeyValueType.INHERIT_ACCOUNT_KEY, - bytes("") - ); - keys[1] = getSingleKey( KeyType.SUPPLY, KeyValueType.INHERIT_ACCOUNT_KEY, bytes("") diff --git a/tools/layer-zero-example/contracts/hts/KeyHelper.sol b/tools/layer-zero-example/contracts/hts/KeyHelper.sol index 21333f0bdf..696366cc9e 100644 --- a/tools/layer-zero-example/contracts/hts/KeyHelper.sol +++ b/tools/layer-zero-example/contracts/hts/KeyHelper.sol @@ -48,26 +48,6 @@ abstract contract KeyHelper { ); } - function getSingleKey( - KeyType firstType, - KeyType secondType, - KeyValueType keyValueType, - bytes memory key - ) internal view returns (IHederaTokenService.TokenKey memory tokenKey) { - tokenKey = IHederaTokenService.TokenKey( - getDuplexKeyType(firstType, secondType), - getKeyValueType(keyValueType, key) - ); - } - - function getDuplexKeyType( - KeyType firstType, - KeyType secondType - ) internal pure returns (uint256 keyType) { - keyType = keyType.setBit(uint8(firstType)); - keyType = keyType.setBit(uint8(secondType)); - } - function getKeyType(KeyType keyType) internal view returns (uint256) { return keyTypes[keyType]; } diff --git a/tools/layer-zero-example/hardhat.config.js b/tools/layer-zero-example/hardhat.config.js index b21e74f123..8fb78198ab 100644 --- a/tools/layer-zero-example/hardhat.config.js +++ b/tools/layer-zero-example/hardhat.config.js @@ -19,7 +19,7 @@ */ require('dotenv').config(); -require("@nomicfoundation/hardhat-toolbox"); +require('@nomicfoundation/hardhat-toolbox'); module.exports = { solidity: { @@ -29,25 +29,25 @@ module.exports = { settings: { optimizer: { enabled: true, - runs: 200, - }, - }, - }, - ], + runs: 200 + } + } + } + ] }, defaultNetwork: 'hedera_testnet', networks: { hedera_testnet: { url: 'https://testnet.hashio.io/api', accounts: [process.env.HEDERA_PK], - chainId: 296, + chainId: 296 }, bsc_testnet: { - url: "https://data-seed-prebsc-1-s1.binance.org:8545", + url: 'https://data-seed-prebsc-1-s1.binance.org:8545', chainId: 97, gasPrice: 20000000000, accounts: [process.env.BSC_PK] - }, + } } }; @@ -63,18 +63,18 @@ const getEndpointAddress = (network) => { } return ENDPOINT_V2; -} +}; -task('deploy-whbar', "Deploy WHBAR") +task('deploy-whbar', 'Deploy WHBAR') .setAction(async (taskArgs, hre) => { const contractFactory = await ethers.getContractFactory('WHBAR'); const contract = await contractFactory.deploy(); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) WHBAR to: ` + contract.address); + console.log(`(${hre.network.name}) WHBAR to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task('deploy-erc20', "Deploy ERC20 token") +task('deploy-erc20', 'Deploy ERC20 token') .addParam('mint', 'Initial mint') .addParam('decimals', 'Decimals') .setAction(async (taskArgs, hre) => { @@ -82,19 +82,19 @@ task('deploy-erc20', "Deploy ERC20 token") const contract = await contractFactory.deploy(taskArgs.mint, taskArgs.decimals); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ERC20 deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ERC20 deployed to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task('deploy-erc721', "Deploy ERC721 token") +task('deploy-erc721', 'Deploy ERC721 token') .setAction(async (taskArgs, hre) => { const contractFactory = await ethers.getContractFactory('ERC721Mock'); const contract = await contractFactory.deploy(); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ERC721 deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ERC721 deployed to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task("deploy-oapp", "Deploy OApp contract") +task('deploy-oapp', 'Deploy OApp contract') .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); @@ -104,10 +104,10 @@ task("deploy-oapp", "Deploy OApp contract") const contract = await contractFactory.deploy(ENDPOINT_V2, signers[0].address); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ExampleOApp deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ExampleOApp deployed to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task("deploy-oft", "Deploy OFT contract") +task('deploy-oft', 'Deploy OFT contract') .addParam('mint', 'Initial mint') .addParam('decimals', 'Decimals') .setAction(async (taskArgs, hre) => { @@ -119,10 +119,10 @@ task("deploy-oft", "Deploy OFT contract") const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address, taskArgs.mint, taskArgs.decimals); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ExampleOFT deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ExampleOFT deployed to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task("deploy-hts-connector", "Deploy HTS connector contract") +task('deploy-hts-connector', 'Deploy HTS connector contract') .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); @@ -135,10 +135,10 @@ task("deploy-hts-connector", "Deploy HTS connector contract") }); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ExampleHTSConnector deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ExampleHTSConnector deployed to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task("create-hts-token", "Create a HTS token") +task('create-hts-token', 'Create a HTS token') .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); @@ -150,10 +150,10 @@ task("create-hts-token", "Create a HTS token") }); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) Token address: ` + await contract.htsTokenAddress()); + console.log(`(${hre.network.name}) Token address ${await contract.htsTokenAddress()}, txHash ${contract.deployTransaction.hash}`); }); -task("deploy-oft-adapter", "Deploy OFT adapter contract") +task('deploy-oft-adapter', 'Deploy OFT adapter contract') .addParam('token', 'Token address') .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; @@ -164,10 +164,10 @@ task("deploy-oft-adapter", "Deploy OFT adapter contract") const contract = await contractFactory.deploy(taskArgs.token, ENDPOINT_V2, signers[0].address); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ExampleOFTAdapter for token ${taskArgs.token} deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ExampleOFTAdapter for token ${taskArgs.token} deployed to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task("deploy-onft", "Deploy OFT contract") +task('deploy-onft', 'Deploy OFT contract') .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; const signers = await ethers.getSigners(); @@ -184,10 +184,10 @@ task("deploy-onft", "Deploy OFT contract") const contract = await contractFactory.deploy('T_NAME', 'T_SYMBOL', ENDPOINT_V2, signers[0].address, tokenId); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ExampleONFT deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ExampleONFT deployed to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task("deploy-onft-adapter", "Deploy OFT contract") +task('deploy-onft-adapter', 'Deploy OFT contract') .addParam('token', 'Token address') .setAction(async (taskArgs, hre) => { const ethers = hre.ethers; @@ -198,10 +198,10 @@ task("deploy-onft-adapter", "Deploy OFT contract") const contract = await contractFactory.deploy(taskArgs.token, ENDPOINT_V2, signers[0].address); await contract.deployTransaction.wait(); - console.log(`(${hre.network.name}) ExampleONFTAdapter deployed to: ` + contract.address); + console.log(`(${hre.network.name}) ExampleONFTAdapter deployed to ${contract.address}, txHash ${contract.deployTransaction.hash}`); }); -task("set-peer", "Set peer") +task('set-peer', 'Set peer') .addParam('source', 'Source contract address') .addParam('target', 'Target contract address') .setAction(async (taskArgs, hre) => { @@ -222,5 +222,5 @@ task("set-peer", "Set peer") process.exit('Execution of setPeer failed. Tx hash: ' + tx.hash); } - console.log(`(${hre.network.name}) Peer for network with EID ${EID} was successfully set`); + console.log(`(${hre.network.name}) Peer for network with EID ${EID} was successfully set, txHash ${tx.hash}`); }); diff --git a/tools/layer-zero-example/test/htsAdapterTests.js b/tools/layer-zero-example/test/htsAdapterTests.js index f2f9d8ac9d..2381a580a8 100644 --- a/tools/layer-zero-example/test/htsAdapterTests.js +++ b/tools/layer-zero-example/test/htsAdapterTests.js @@ -33,6 +33,7 @@ describe('HTSAdapterTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_HTS_HEDERA_CONTRACT); const transferTx = await contractERC20.transfer(process.env.HTS_ADAPTER_HEDERA_CONTRACT, amount); const receipt = await transferTx.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${transferTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -40,6 +41,7 @@ describe('HTSAdapterTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_ERC20_BSC_CONTRACT); const transferTx = await contractERC20.transfer(process.env.HTS_ADAPTER_BSC_CONTRACT, amount); const receipt = await transferTx.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${transferTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -47,6 +49,7 @@ describe('HTSAdapterTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_HTS_HEDERA_CONTRACT); const approveTx = await contractERC20.approve(process.env.HTS_ADAPTER_HEDERA_CONTRACT, amount); const receipt = await approveTx.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${approveTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -54,6 +57,7 @@ describe('HTSAdapterTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.HTS_ADAPTER_ERC20_BSC_CONTRACT); const approveTx = await contractERC20.approve(process.env.HTS_ADAPTER_BSC_CONTRACT, amount); const receipt = await approveTx.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${approveTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -81,7 +85,7 @@ describe('HTSAdapterTests', function() { process.exit(`Execution failed. Tx hash: ${tx.hash}`); } - console.log(`(${hre.network.name}) successfully sent to Bsc via tx: ${tx.hash}`); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); }); it('@bsc @send to hedera', async () => { diff --git a/tools/layer-zero-example/test/htsConnectorTests.js b/tools/layer-zero-example/test/htsConnectorTests.js index 81a6cf2b59..22f03bf6c2 100644 --- a/tools/layer-zero-example/test/htsConnectorTests.js +++ b/tools/layer-zero-example/test/htsConnectorTests.js @@ -34,8 +34,9 @@ describe('HTSConnectorTests', function() { const tokenAddress = await oftHts.htsTokenAddress(); const contract = await ethers.getContractAt('ERC20', tokenAddress); - const txApprove = await contract.approve(process.env.HTS_CONNECTOR_HEDERA_CONTRACT, amount) + const txApprove = await contract.approve(process.env.HTS_CONNECTOR_HEDERA_CONTRACT, amount); const receipt = await txApprove.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${txApprove.hash}`); expect(receipt.status).to.equal(1); }); diff --git a/tools/layer-zero-example/test/oftAdapterTests.js b/tools/layer-zero-example/test/oftAdapterTests.js index 9f3743b277..0020bd8a44 100644 --- a/tools/layer-zero-example/test/oftAdapterTests.js +++ b/tools/layer-zero-example/test/oftAdapterTests.js @@ -33,6 +33,7 @@ describe('OFTAdapterTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_HEDERA_CONTRACT); const transferTx = await contractERC20.transfer(process.env.OFT_ADAPTER_HEDERA_CONTRACT, amount); const receipt = await transferTx.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${transferTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -40,6 +41,7 @@ describe('OFTAdapterTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_BSC_CONTRACT); const transferTx = await contractERC20.transfer(process.env.OFT_ADAPTER_BSC_CONTRACT, amount); const receipt = await transferTx.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${transferTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -47,6 +49,7 @@ describe('OFTAdapterTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_HEDERA_CONTRACT); const approveTx = await contractERC20.approve(process.env.OFT_ADAPTER_HEDERA_CONTRACT, amount); const receipt = await approveTx.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${approveTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -54,6 +57,7 @@ describe('OFTAdapterTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.ERC20_BSC_CONTRACT); const approveTx = await contractERC20.approve(process.env.OFT_ADAPTER_BSC_CONTRACT, amount); const receipt = await approveTx.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${approveTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -81,7 +85,7 @@ describe('OFTAdapterTests', function() { process.exit(`Execution failed. Tx hash: ${tx.hash}`); } - console.log(`(${hre.network.name}) successfully sent to Bsc via tx: ${tx.hash}`); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); }); it('@bsc @send to hedera', async () => { diff --git a/tools/layer-zero-example/test/onftAdapterTests.js b/tools/layer-zero-example/test/onftAdapterTests.js index e184e68f69..1268e8303e 100644 --- a/tools/layer-zero-example/test/onftAdapterTests.js +++ b/tools/layer-zero-example/test/onftAdapterTests.js @@ -34,10 +34,12 @@ describe('ONFTAdapterTests', function() { const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); const txSigner = await contract.mint(signers[0].address, 1); const receiptSigner = await txSigner.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${txSigner.hash}`); expect(!!receiptSigner.status).to.be.true; const txAdapter = await contract.mint(process.env.ONFT_ADAPTER_HEDERA_CONTRACT, 2); const receiptAdapter = await txAdapter.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${txAdapter.hash}`); expect(!!receiptAdapter.status).to.be.true; }); @@ -47,10 +49,12 @@ describe('ONFTAdapterTests', function() { const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); const txAdapter = await contract.mint(process.env.ONFT_ADAPTER_BSC_CONTRACT, 1); const receiptAdapter = await txAdapter.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${txAdapter.hash}`); expect(!!receiptAdapter.status).to.be.true; const txSigner = await contract.mint(signers[0].address, 2); const receiptSigner = await txSigner.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${txSigner.hash}`); expect(!!receiptSigner.status).to.be.true; }); @@ -58,6 +62,7 @@ describe('ONFTAdapterTests', function() { const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_HEDERA_CONTRACT); const approveTx = await contract.approve(process.env.ONFT_ADAPTER_HEDERA_CONTRACT, 1); const receipt = await approveTx.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${approveTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -65,6 +70,7 @@ describe('ONFTAdapterTests', function() { const contract = await ethers.getContractAt('ERC721Mock', process.env.ERC721_BSC_CONTRACT); const approveTx = await contract.approve(process.env.ONFT_ADAPTER_BSC_CONTRACT, 2); const receipt = await approveTx.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${approveTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -91,7 +97,7 @@ describe('ONFTAdapterTests', function() { process.exit(`Execution failed. Tx hash: ${tx.hash}`); } - console.log(`(${hre.network.name}) successfully sent to Bsc via tx: ${tx.hash}`); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); }); it('@bsc @send to hedera', async () => { diff --git a/tools/layer-zero-example/test/whbarTests.js b/tools/layer-zero-example/test/whbarTests.js index d816cda38a..50adf90e37 100644 --- a/tools/layer-zero-example/test/whbarTests.js +++ b/tools/layer-zero-example/test/whbarTests.js @@ -28,7 +28,7 @@ const BSC_EID = 40102; const receiverAddress = '0xF51c7a9407217911d74e91642dbC58F18E51Deac'; const amount = '50000000'; -describe.only('WHBARTests', function() { +describe('WHBARTests', function() { it('@hedera @deposit 1 hbar', async () => { const signers = await ethers.getSigners(); const contract = await ethers.getContractAt('WHBAR', process.env.WHBAR_HEDERA_CONTRACT); @@ -37,6 +37,7 @@ describe.only('WHBARTests', function() { value: '1000000000000000000' // 1 hbar }); await tx.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${tx.hash}`); expect(await contract.balanceOf(signers[0].address)).to.equal(100_000_000); }); @@ -45,6 +46,7 @@ describe.only('WHBARTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_HEDERA_CONTRACT); const transferTx = await contractERC20.transfer(process.env.WHBAR_HEDERA_ADAPTER_CONTRACT, amount); const receipt = await transferTx.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${transferTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -52,6 +54,7 @@ describe.only('WHBARTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_BSC_CONTRACT); const transferTx = await contractERC20.transfer(process.env.WHBAR_BSC_ADAPTER_CONTRACT, amount); const receipt = await transferTx.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${transferTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -59,6 +62,7 @@ describe.only('WHBARTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_HEDERA_CONTRACT); const approveTx = await contractERC20.approve(process.env.WHBAR_HEDERA_ADAPTER_CONTRACT, amount); const receipt = await approveTx.wait(); + console.log(`(${hre.network.name}) successfully sent to Hedera via tx: ${approveTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -66,6 +70,7 @@ describe.only('WHBARTests', function() { const contractERC20 = await ethers.getContractAt('ERC20Mock', process.env.WHBAR_BSC_CONTRACT); const approveTx = await contractERC20.approve(process.env.WHBAR_BSC_ADAPTER_CONTRACT, amount); const receipt = await approveTx.wait(); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${approveTx.hash}`); expect(!!receipt.status).to.be.true; }); @@ -93,7 +98,7 @@ describe.only('WHBARTests', function() { process.exit(`Execution failed. Tx hash: ${tx.hash}`); } - console.log(`(${hre.network.name}) successfully sent to Bsc via tx: ${tx.hash}`); + console.log(`(${hre.network.name}) successfully sent to BSC via tx: ${tx.hash}`); }); it('@bsc @send to hedera', async () => { From 7be6b32fb376eddcdb48fe7571992db2c1ba562b Mon Sep 17 00:00:00 2001 From: nikolay Date: Mon, 6 Jan 2025 13:47:43 +0200 Subject: [PATCH 14/14] chore: edit readme Signed-off-by: nikolay --- tools/layer-zero-example/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/layer-zero-example/README.md b/tools/layer-zero-example/README.md index d0ae03a5ea..02814e7e51 100644 --- a/tools/layer-zero-example/README.md +++ b/tools/layer-zero-example/README.md @@ -273,16 +273,21 @@ npx hardhat test --grep "HTSAdapterTests @bsc @test" --network bsc_testnet ### WHBAR flow +Wrap and transfer HBARs across different chains. + +- Deploying WHBAR and ERC20 ```typescript npx hardhat deploy-whbar --network hedera_testnet npx hardhat deploy-erc20 --decimals 8 --mint 100000000 --network bsc_testnet ``` +- Deploying an OFT Adapters which will be used as a lockbox of WHBAR and ERC20 deployed the step above ```typescript npx hardhat deploy-oft-adapter --token --network hedera_testnet npx hardhat deploy-oft-adapter --token --network bsc_testnet ``` +- In order to connect OFT Adapters together, we need to set the peer of the target OFT Adapter, more info can be found here https://docs.layerzero.network/v2/developers/evm/getting-started#connecting-your-contracts ```typescript npx hardhat set-peer --source --target --network hedera_testnet npx hardhat set-peer --source --target --network bsc_testnet @@ -290,20 +295,24 @@ npx hardhat set-peer --source --target