diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100755 new mode 100644 diff --git a/lib/contracts b/lib/contracts index eb370b6..7319592 160000 --- a/lib/contracts +++ b/lib/contracts @@ -1 +1 @@ -Subproject commit eb370b655923162c442077246855affe56809263 +Subproject commit 731959279a77b0779f8a1eccdaea710e0babee19 diff --git a/lib/forge-std b/lib/forge-std index cd7d533..87a2a0a 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653 +Subproject commit 87a2a0afc5fafd6297538a45a52ac19e71a84562 diff --git a/lib/nitro b/lib/nitro index 48fda6c..27d9d44 160000 --- a/lib/nitro +++ b/lib/nitro @@ -1 +1 @@ -Subproject commit 48fda6c75955c73a95b8a6ac394768d8dacefa91 +Subproject commit 27d9d4482c4ada93d4da597373eb41be962348a7 diff --git a/lib/solidity-stringutils b/lib/solidity-stringutils index 46983c6..4b2fcc4 160000 --- a/lib/solidity-stringutils +++ b/lib/solidity-stringutils @@ -1 +1 @@ -Subproject commit 46983c6d9462a80229cf0d5bab8ea3b3ee31066c +Subproject commit 4b2fcc43fa0426e19ce88b1f1ec16f5903a2e461 diff --git a/package.json b/package.json index 76b77af..f31b3eb 100644 --- a/package.json +++ b/package.json @@ -107,5 +107,8 @@ "src/**", "types/**", "out/**" - ] + ], + "dependencies": { + "@hyperlane-xyz/core": "^3.6.0" + } } diff --git a/src/hyperlane-adapter/HyperlaneReceiverAdapterV3.sol b/src/hyperlane-adapter/HyperlaneReceiverAdapterV3.sol new file mode 100644 index 0000000..86a6e40 --- /dev/null +++ b/src/hyperlane-adapter/HyperlaneReceiverAdapterV3.sol @@ -0,0 +1,202 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +pragma solidity 0.8.16; +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; +import { IMailbox } from "./interfaces/IMailbox.sol"; +import { IMessageRecipient } from "./interfaces/IMessageRecipient.sol"; +import { IInterchainSecurityModule, ISpecifiesInterchainSecurityModule } from "./interfaces/IInterchainSecurityModule.sol"; +import { TypeCasts } from "./libraries/TypeCasts.sol"; +import { EncodeDecodeUtil } from "./libraries/EncodeDecodeUtil.sol"; +import { Errors } from "./libraries/Errors.sol"; +import { IMessageDispatcher } from "../interfaces/IMessageDispatcher.sol"; +import { IMessageExecutor } from "../interfaces/IMessageExecutor.sol"; +import "../libraries/MessageLib.sol"; + +/** + * @title HyperlaneReceiverAdapter implementation. + * @notice `IBridgeReceiverAdapter` implementation that uses Hyperlane as the bridge. + */ +contract HyperlaneReceiverAdapterV3 is + IMessageExecutor, + IMessageRecipient, + ISpecifiesInterchainSecurityModule, + Ownable +{ + /// @notice `Mailbox` contract reference. + IMailbox public immutable mailbox; + + /// @notice last message sender address + bytes32 public lastSender; + + /// @notice last message received + bytes public lastMessage; + + /// @notice `ISM` contract reference. + IInterchainSecurityModule public ism; + + /** + * @notice Sender adapter address for each source chain. + * @dev srcChainId => senderAdapter address. + */ + mapping(uint256 => IMessageDispatcher) public senderAdapters; + + /** + * @notice Ensure that messages cannot be replayed once they have been executed. + * @dev msgId => isExecuted. + */ + mapping(bytes32 => bool) public executedMessages; + + /** + * @notice Emitted when the ISM is set. + * @param module The new ISM for this adapter/recipient. + */ + event IsmSet(address indexed module); + + /** + * @notice Emitted when a messageId has already been executed. + * @param messageId ID uniquely identifying the message or message batch that were re-executed + */ + error MessageIdAlreadyExecuted(bytes32 messageId); + + /** + * @notice Emitted when a sender adapter for a source chain is updated. + * @param srcChainId Source chain identifier. + * @param senderAdapter Address of the sender adapter. + */ + event SenderAdapterUpdated(uint256 srcChainId, IMessageDispatcher senderAdapter); + + /* Constructor */ + /** + * @notice HyperlaneReceiverAdapter constructor. + * @param _mailbox Address of the Hyperlane `Mailbox` contract. + */ + constructor(address _mailbox) { + if (_mailbox == address(0)) { + revert Errors.InvalidMailboxZeroAddress(); + } + mailbox = IMailbox(_mailbox); + } + + /// @notice Restrict access to trusted `Mailbox` contract. + modifier onlyMailbox() { + if (msg.sender != address(mailbox)) { + revert Errors.UnauthorizedMailbox(msg.sender); + } + _; + } + + /// @inheritdoc ISpecifiesInterchainSecurityModule + function interchainSecurityModule() external view returns (IInterchainSecurityModule) { + return ism; + } + + /** + * @notice Sets the ISM for this adapter/recipient. + * @param _ism The ISM contract address. + */ + function setIsm(address _ism) external onlyOwner { + ism = IInterchainSecurityModule(_ism); + emit IsmSet(_ism); + } + + /** + * @notice Called by Hyperlane `Mailbox` contract on destination chain to receive cross-chain messages. + * @dev _origin Source chain domain identifier (not currently used). + * @param _sender Address of the sender on the source chain. + * @param _body Body of the message. + */ + function handle( + uint32 _origin, + bytes32 _sender, + bytes memory _body + ) external payable onlyMailbox { + address adapter = TypeCasts.bytes32ToAddress(_sender); + //bool _executedMessageId; + ( + MessageLib.Message[] memory _messages, + bytes32 msgId, + uint256 srcChainId, + address srcSender + ) = EncodeDecodeUtil.decode(_body); + + if (_origin != srcChainId) { + revert Errors.UnauthorizedOrigin(_origin); + } + + if (IMessageDispatcher(adapter) != senderAdapters[srcChainId]) { + revert Errors.UnauthorizedAdapter(srcChainId, adapter); + } + + if (_messages.length < 1) { + revert Errors.NoMessagesSent(srcChainId); + } + + if (executedMessages[msgId]) { + revert MessageIdAlreadyExecuted(msgId); + } + + if (_messages.length == 1) { + MessageLib.Message memory _message = _messages[0]; + executeMessage(_message.to, _message.data, msgId, srcChainId, srcSender); + } else { + executeMessageBatch( + _messages, + msgId, + srcChainId, + srcSender + // _executedMessageId + ); + } + + lastSender = _sender; + lastMessage = _body; + } + + function executeMessage( + address _to, + bytes memory _message, + bytes32 _messageId, + uint256 _fromChainId, + address _from + ) public override onlyMailbox { + bool _executedMessageId = executedMessages[_messageId]; + executedMessages[_messageId] = true; + + MessageLib.executeMessage(_to, _message, _messageId, _fromChainId, _from, _executedMessageId); + + emit MessageIdExecuted(_fromChainId, _messageId); + } + + function updateSenderAdapter( + uint256[] calldata _srcChainIds, + IMessageDispatcher[] calldata _senderAdapters + ) external onlyOwner { + if (_srcChainIds.length != _senderAdapters.length) { + revert Errors.MismatchChainsAdaptersLength(_srcChainIds.length, _senderAdapters.length); + } + for (uint256 i; i < _srcChainIds.length; ++i) { + senderAdapters[_srcChainIds[i]] = _senderAdapters[i]; + emit SenderAdapterUpdated(_srcChainIds[i], _senderAdapters[i]); + } + } + + function executeMessageBatch( + MessageLib.Message[] memory _messages, + bytes32 _messageId, + uint256 _fromChainId, + address _from // bool _executedMessageId + ) public override onlyMailbox { + + bool _executedMessageId = executedMessages[_messageId]; + executedMessages[_messageId] = true; + + MessageLib.executeMessageBatch(_messages, _messageId, _fromChainId, _from, _executedMessageId); + + emit MessageIdExecuted(_fromChainId, _messageId); + } + + function getSenderAdapter( + uint256 _srcChainId + ) public view returns (IMessageDispatcher _senderAdapter) { + _senderAdapter = senderAdapters[_srcChainId]; + } +} diff --git a/src/hyperlane-adapter/HyperlaneSenderAdapterV3.sol b/src/hyperlane-adapter/HyperlaneSenderAdapterV3.sol new file mode 100644 index 0000000..aae9c42 --- /dev/null +++ b/src/hyperlane-adapter/HyperlaneSenderAdapterV3.sol @@ -0,0 +1,298 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +pragma solidity 0.8.16; +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; +import { IMailbox } from "./interfaces/IMailbox.sol"; +import { IInterchainGasPaymaster } from "./interfaces/IInterchainGasPaymaster.sol"; +import { TypeCasts } from "./libraries/TypeCasts.sol"; +import { Errors } from "./libraries/Errors.sol"; +import { IMessageDispatcher, ISingleMessageDispatcher } from "./interfaces/ISingleMessageDispatcher.sol"; +import { EncodeDecodeUtil } from "./libraries/EncodeDecodeUtil.sol"; +import { IBatchedMessageDispatcher } from "./interfaces/IBatchedMessageDispatcher.sol"; +import { IMessageExecutor } from "../interfaces/IMessageExecutor.sol"; +import "../libraries/MessageLib.sol"; + +contract HyperlaneSenderAdapterV3 is ISingleMessageDispatcher, IBatchedMessageDispatcher, Ownable { + /// @notice `Mailbox` contract reference. + IMailbox public immutable mailbox; + + /// @notice `IGP` contract reference. + IInterchainGasPaymaster public igp; + + uint256 public nonce; + + uint256 public immutable gasAmount; + + uint256 private constant DEFAULT_GAS_AMOUNT = 500000; + + /** + * @notice Receiver adapter address for each destination chain. + * @dev dstChainId => receiverAdapter address. + */ + mapping(uint256 => IMessageExecutor) public receiverAdapters; + + mapping(uint256 => bool) public isValidChainId; + + /** + * @notice Domain identifier for each destination chain. + * @dev dstChainId => dstDomainId. + */ + mapping(uint256 => uint32) public destinationDomains; + + /** + * @notice Emitted when the IGP is set. + * @param paymaster The new IGP for this adapter. + */ + event IgpSet(address indexed paymaster); + + /** + * @notice Emitted when a receiver adapter for a destination chain is updated. + * @param dstChainId Destination chain identifier. + * @param receiverAdapter Address of the receiver adapter. + */ + event ReceiverAdapterUpdated(uint256 dstChainId, IMessageExecutor receiverAdapter); + + /** + * @notice Emitted when a domain identifier for a destination chain is updated. + * @param dstChainId Destination chain identifier. + * @param dstDomainId Destination domain identifier. + */ + event DestinationDomainUpdated(uint256 dstChainId, uint32 dstDomainId); + + /** + * @notice HyperlaneSenderAdapter constructor. + * @param _mailbox Address of the Hyperlane `Mailbox` contract. + */ + constructor( + address _mailbox, + address _igp, + uint256 _gasAmount + ) { + if (_mailbox == address(0)) { + revert Errors.InvalidMailboxZeroAddress(); + } + + // See https://docs.hyperlane.xyz/docs/build-with-hyperlane/guides/paying-for-interchain-gas + // Set gasAmount to the default (500,000) if _gasAmount is 0 + gasAmount = (_gasAmount == 0) ? 500000 : _gasAmount; + //gasAmount = _gasAmount ?? DEFAULT_GAS_AMOUNT; + mailbox = IMailbox(_mailbox); + _setIgp(_igp); + } + + /// @dev we narrow mutability (from view to pure) to remove compiler warnings. + /// @dev unused parameters are added as comments for legibility. + function getMessageFee( + uint256 toChainId, + address to, + /* to*/ + bytes calldata data + ) external view returns (uint256) { + uint32 dstDomainId = _getDestinationDomain(toChainId); + // See https://docs.hyperlane.xyz/docs/build-with-hyperlane/guides/paying-for-interchain-gas + try igp.quoteGasPayment(dstDomainId, gasAmount) returns (uint256 gasQuote) { + return gasQuote; + } catch { + return 0; + } + } + + /** + * @notice Sets the IGP for this adapter. + * @dev See _setIgp + */ + function setIgp(address _igp) external onlyOwner { + _setIgp(_igp); + } + + /** + * @notice Emitted when a domain identifier for a destination chain is updated. + * @param toChainId Destination chain identifier. + * @param _to recipient address. + * @param _data data to be sent to the recipient address. + */ + function dispatchMessage( + uint256 _toChainId, + address _to, + bytes calldata _data + ) external payable override returns (bytes32) { + IMessageExecutor adapter = _getMessageExecutorAddress(_toChainId); + _checkAdapter(_toChainId, adapter); + uint32 dstDomainId = _getDestinationDomain(_toChainId); + + if (dstDomainId == 0) { + revert Errors.UnknownDomainId(_toChainId); + } + + uint256 _nonce = _incrementNonce(); + bytes32 msgId = MessageLib.computeMessageId(_nonce, msg.sender, _to, _data); + + MessageLib.Message[] memory _messages = new MessageLib.Message[](1); + _messages[0] = MessageLib.Message({ to: _to, data: _data }); + + bytes memory payload = EncodeDecodeUtil.encode(_messages, msgId, block.chainid, msg.sender); + + bytes32 bytes32Address = TypeCasts.addressToBytes32(address(adapter)); + uint256 quote = mailbox.quoteDispatch(dstDomainId, bytes32Address, payload); + mailbox.dispatch{ value: quote }( + dstDomainId, + bytes32Address, //receiver adapter is the reciever + // Include the source chain id so that the receiver doesn't have to maintain a srcDomainId => srcChainId mapping + payload + ); + + // // try to make gas payment, ignore failures + // try + // igp.payForGas{ value: msg.value }(hyperlaneMsgId, dstDomainId, gasAmount, msg.sender) + // {} catch {} + + emit MessageDispatched(msgId, msg.sender, _toChainId, _to, _data); + return msgId; + } + + function dispatchMessageBatch( + uint256 _toChainId, + MessageLib.Message[] calldata _messages + ) external payable override returns (bytes32) { + IMessageExecutor adapter = _getMessageExecutorAddress(_toChainId); + _checkAdapter(_toChainId, adapter); + uint32 dstDomainId = _getDestinationDomain(_toChainId); + + if (dstDomainId == 0) { + revert Errors.UnknownDomainId(_toChainId); + } + + uint256 _nonce = _incrementNonce(); + bytes32 msgId = MessageLib.computeMessageBatchId(_nonce, msg.sender, _messages); + bytes memory payload = EncodeDecodeUtil.encode(_messages, msgId, block.chainid, msg.sender); + + bytes32 bytes32Address = TypeCasts.addressToBytes32(address(adapter)); + uint256 quote = mailbox.quoteDispatch(dstDomainId, bytes32Address, payload); + mailbox.dispatch{ value: quote }( + dstDomainId, + bytes32Address, //receiver adapter is the reciever + // Include the source chain id so that the receiver doesn't have to maintain a srcDomainId => srcChainId mapping + payload + ); + + // try to make gas payment, ignore failures + // try + // igp.payForGas{ value: msg.value }(hyperlaneMsgId, dstDomainId, gasAmount, msg.sender) + // {} catch {} + + emit MessageBatchDispatched(msgId, msg.sender, _toChainId, _messages); + return msgId; + } + + function updateReceiverAdapter( + uint256[] calldata _dstChainIds, + IMessageExecutor[] calldata _receiverAdapters + ) external onlyOwner { + if (_dstChainIds.length != _receiverAdapters.length) { + revert Errors.MismatchChainsAdaptersLength(_dstChainIds.length, _receiverAdapters.length); + } + for (uint256 i; i < _dstChainIds.length; ++i) { + receiverAdapters[_dstChainIds[i]] = _receiverAdapters[i]; + isValidChainId[_dstChainIds[i]] = true; + emit ReceiverAdapterUpdated(_dstChainIds[i], _receiverAdapters[i]); + } + } + + function _checkAdapter(uint256 _destChainId, IMessageExecutor _executor) internal view { + if (address(_executor) == address(0)) { + revert Errors.InvalidAdapterZeroAddress(); + } + + IMessageExecutor executor = receiverAdapters[_destChainId]; + require(_executor == executor, "Dispatcher/executor-mis-match"); + } + + function getMessageExecutorAddress( + uint256 _toChainId + ) external view returns (address _executorAddress) { + _executorAddress = address(_getMessageExecutorAddress(_toChainId)); + } + + /** + * @notice Updates destination domain identifiers. + * @param _dstChainIds Destination chain ids array. + * @param _dstDomainIds Destination domain ids array. + */ + function updateDestinationDomainIds( + uint256[] calldata _dstChainIds, + uint32[] calldata _dstDomainIds + ) external onlyOwner { + if (_dstChainIds.length != _dstDomainIds.length) { + revert Errors.MismatchChainsDomainsLength(_dstChainIds.length, _dstDomainIds.length); + } + for (uint256 i; i < _dstChainIds.length; ++i) { + destinationDomains[_dstChainIds[i]] = _dstDomainIds[i]; + emit DestinationDomainUpdated(_dstChainIds[i], _dstDomainIds[i]); + } + } + + /** + * @notice Returns destination domain identifier for given destination chain id. + * @dev dstDomainId is read from destinationDomains mapping + * @dev Returned dstDomainId can be zero, reverting should be handled by consumers if necessary. + * @param _dstChainId Destination chain id. + * @return destination domain identifier. + */ + function _getDestinationDomain(uint256 _dstChainId) internal view returns (uint32) { + return destinationDomains[_dstChainId]; + } + + /** + * @dev Sets the IGP for this adapter. + * @param _igp The IGP contract address. + */ + function _setIgp(address _igp) internal { + igp = IInterchainGasPaymaster(_igp); + emit IgpSet(_igp); + } + + /** + * @notice Check toChainId to ensure messages can be dispatched to this chain. + * @dev Will revert if `_toChainId` is not supported. + * @param _toChainId ID of the chain receiving the message + */ + function _checkToChainId(uint256 _toChainId) internal view { + bool status = isValidChainId[_toChainId]; + require(status, "Dispatcher/chainId-not-supported"); + } + + /** + * @notice Retrieves address of the MessageExecutor contract on the receiving chain. + * @dev Will revert if `_toChainId` is not supported. + * @param _toChainId ID of the chain with which MessageDispatcher is communicating + * @return receiverAdapter MessageExecutor contract address + */ + function _getMessageExecutorAddress( + uint256 _toChainId + ) internal view returns (IMessageExecutor receiverAdapter) { + _checkToChainId(_toChainId); + receiverAdapter = receiverAdapters[_toChainId]; + } + + /// @dev Get current chain id + function getChainId() public view virtual returns (uint256 cid) { + assembly { + cid := chainid() + } + } + + function getDestinationDomain(uint256 _dstChainId) public view returns (uint32 _destDomainId) { + _destDomainId = _getDestinationDomain(_dstChainId); + } + + /** + * @notice Helper to increment nonce. + * @return uint256 Incremented nonce + */ + function _incrementNonce() internal returns (uint256) { + unchecked { + nonce++; + } + + return nonce; + } +} diff --git a/src/hyperlane-adapter/interfaces/IBatchedMessageDispatcher.sol b/src/hyperlane-adapter/interfaces/IBatchedMessageDispatcher.sol new file mode 100644 index 0000000..bd23911 --- /dev/null +++ b/src/hyperlane-adapter/interfaces/IBatchedMessageDispatcher.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-3.0 + +pragma solidity 0.8.16; +import "../../interfaces/IMessageDispatcher.sol"; + +/** + * @title ERC-5164: Cross-Chain Execution Standard, optional BatchMessageDispatcher extension + * @dev See https://eips.ethereum.org/EIPS/eip-5164 + */ +interface IBatchedMessageDispatcher is IMessageDispatcher { + /** + * @notice Dispatch `messages` to the receiving chain. + * @dev Must compute and return an ID uniquely identifying the `messages`. + * @dev Must emit the `MessageBatchDispatched` event when successfully dispatched. + * @param toChainId ID of the receiving chain + * @param messages Array of Message dispatched + * @return bytes32 ID uniquely identifying the `messages` + */ + function dispatchMessageBatch(uint256 toChainId, MessageLib.Message[] calldata messages) + external + payable + returns (bytes32); +} diff --git a/src/hyperlane-adapter/interfaces/IInterchainGasPaymaster.sol b/src/hyperlane-adapter/interfaces/IInterchainGasPaymaster.sol new file mode 100644 index 0000000..c2df74e --- /dev/null +++ b/src/hyperlane-adapter/interfaces/IInterchainGasPaymaster.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// From https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/interfaces/IInterchainGasPaymaster.sol +pragma solidity 0.8.16; + +/** + * @title IInterchainGasPaymaster + * @notice Manages payments on a source chain to cover gas costs of relaying + * messages to destination chains. + */ +interface IInterchainGasPaymaster { + /** + * @notice Emitted when a payment is made for a message's gas costs. + * @param messageId The ID of the message to pay for. + * @param gasAmount The amount of destination gas paid for. + * @param payment The amount of native tokens paid. + */ + event GasPayment(bytes32 indexed messageId, uint256 gasAmount, uint256 payment); + + function payForGas( + bytes32 _messageId, + uint32 _destinationDomain, + uint256 _gasAmount, + address _refundAddress + ) external payable; + + function quoteGasPayment(uint32 _destinationDomain, uint256 _gasAmount) + external + view + returns (uint256); +} diff --git a/src/hyperlane-adapter/interfaces/IInterchainSecurityModule.sol b/src/hyperlane-adapter/interfaces/IInterchainSecurityModule.sol new file mode 100644 index 0000000..0d86c26 --- /dev/null +++ b/src/hyperlane-adapter/interfaces/IInterchainSecurityModule.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// From https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/interfaces/IInterchainSecurityModule.sol +pragma solidity 0.8.16; + +interface IInterchainSecurityModule { + enum Types { + UNUSED, + ROUTING, + AGGREGATION, + LEGACY_MULTISIG, + MERKLE_ROOT_MULTISIG, + MESSAGE_ID_MULTISIG, + NULL, // used with relayer carrying no metadata + CCIP_READ + } + + /** + * @notice Returns an enum that represents the type of security model + * encoded by this ISM. + * @dev Relayers infer how to fetch and format metadata. + */ + function moduleType() external view returns (uint8); + + /** + * @notice Defines a security model responsible for verifying interchain + * messages based on the provided metadata. + * @param _metadata Off-chain metadata provided by a relayer, specific to + * the security model encoded by the module (e.g. validator signatures) + * @param _message Hyperlane encoded interchain message + * @return True if the message was verified + */ + function verify(bytes calldata _metadata, bytes calldata _message) external returns (bool); +} + +interface ISpecifiesInterchainSecurityModule { + function interchainSecurityModule() external view returns (IInterchainSecurityModule); +} diff --git a/src/hyperlane-adapter/interfaces/IMailbox.sol b/src/hyperlane-adapter/interfaces/IMailbox.sol new file mode 100644 index 0000000..27c7682 --- /dev/null +++ b/src/hyperlane-adapter/interfaces/IMailbox.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// Extracted from https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/interfaces/IMailbox.sol +pragma solidity 0.8.16; + +interface IMailbox { + function quoteDispatch( + uint32 destination, + bytes32 recipient, + bytes calldata _messageBody + ) external view returns (uint256 fee); + + function dispatch( + uint32 _destinationDomain, + bytes32 _recipientAddress, + bytes calldata _messageBody + ) external payable; // will revert if msg.value < quoted fee +} + +// /// @dev imported from +// /// https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/v3/solidity/contracts/interfaces/hooks/IPostDispatchHook.sol +// interface IPostDispatchHook { +// enum Types { +// UNUSED, +// ROUTING, +// AGGREGATION, +// MERKLE_TREE, +// INTERCHAIN_GAS_PAYMASTER, +// FALLBACK_ROUTING, +// ID_AUTH_ISM, +// PAUSABLE, +// PROTOCOL_FEE +// } +// } diff --git a/src/hyperlane-adapter/interfaces/IMessageRecipient.sol b/src/hyperlane-adapter/interfaces/IMessageRecipient.sol new file mode 100644 index 0000000..a3499be --- /dev/null +++ b/src/hyperlane-adapter/interfaces/IMessageRecipient.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// From https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/interfaces/IMessageRecipient.sol +pragma solidity 0.8.16; + +interface IMessageRecipient { + function handle( + uint32 _origin, + bytes32 _sender, + bytes calldata _message + ) external payable; +} diff --git a/src/hyperlane-adapter/interfaces/ISingleMessageDispatcher.sol b/src/hyperlane-adapter/interfaces/ISingleMessageDispatcher.sol new file mode 100644 index 0000000..4e1c8fa --- /dev/null +++ b/src/hyperlane-adapter/interfaces/ISingleMessageDispatcher.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-3.0 + +pragma solidity 0.8.16; +import "../../interfaces/IMessageDispatcher.sol"; + +/** + * @title ERC-5164: Cross-Chain Execution Standard, optional SingleMessageDispatcher extension + * @dev See https://eips.ethereum.org/EIPS/eip-5164 + */ +interface ISingleMessageDispatcher is IMessageDispatcher { + /** + * @notice Dispatch a message to the receiving chain. + * @dev Must compute and return an ID uniquely identifying the message. + * @dev Must emit the `MessageDispatched` event when successfully dispatched. + * @param toChainId ID of the receiving chain + * @param to Address on the receiving chain that will receive `data` + * @param data Data dispatched to the receiving chain + * @return bytes32 ID uniquely identifying the message + */ + function dispatchMessage( + uint256 toChainId, + address to, + bytes calldata data + ) external payable returns (bytes32); +} diff --git a/src/hyperlane-adapter/libraries/EncodeDecodeUtil.sol b/src/hyperlane-adapter/libraries/EncodeDecodeUtil.sol new file mode 100644 index 0000000..6f5d082 --- /dev/null +++ b/src/hyperlane-adapter/libraries/EncodeDecodeUtil.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +import "../../libraries/MessageLib.sol"; +pragma solidity 0.8.16; + +/** + * @title EncodeDecodeUtil + * @notice Library to encode and decode payloads. + */ +library EncodeDecodeUtil { + /** + * @notice Helper to encode a batch of messages that will be dispatched + * @param messages Array of Message that will be dispatched + * @param messageId ID uniquely identifying the batch of messages being dispatched + * @param fromChainId ID of the chain that dispatched the batch of messages + * @param from Address that dispatched the batch of messages + */ + function encode( + MessageLib.Message[] memory messages, + bytes32 messageId, + uint256 fromChainId, + address from + ) internal pure returns (bytes memory) { + return abi.encode(messages, messageId, fromChainId, from); + } + + /** + * @notice Helper to decode a batch of messages for that will be executed + * @param _payload payload that is meant to be decoded + + */ + function decode(bytes memory _payload) + internal + pure + returns ( + MessageLib.Message[] memory, + bytes32, + uint256, + address + ) + { + ( + MessageLib.Message[] memory _messages, + bytes32 messageId, + uint256 fromChainId, + address from + ) = abi.decode(_payload, (MessageLib.Message[], bytes32, uint256, address)); + return (_messages, messageId, fromChainId, from); + } +} diff --git a/src/hyperlane-adapter/libraries/Errors.sol b/src/hyperlane-adapter/libraries/Errors.sol new file mode 100644 index 0000000..803504a --- /dev/null +++ b/src/hyperlane-adapter/libraries/Errors.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +pragma solidity 0.8.16; + +library Errors { + /** + * @notice Emitted when the zero address is passed as the mailbox. + * @dev mailbox == address(0) + */ + error InvalidMailboxZeroAddress(); + + /** + * @notice Emitted when the caller is not the trusted mailbox contract. + * @dev msg.sender != mailbox + */ + error UnauthorizedMailbox(address sender); + + /** + * @notice Emitted when the adapter is set to the zero address. + * @dev adapter == address(0) + */ + error InvalidAdapterZeroAddress(); + + /** + * @notice Emitted when the address is not a trusted adapter for the chain. + * @dev addr != adapters[chainId] + */ + error UnauthorizedAdapter(uint256 chainId, address addr); + + /** + * @notice Emitted when the domain identifier for the chain id is unknown (i.e zero). + * @dev chainId == 0 + */ + error UnknownDomainId(uint256 chainId); + + /** + * @notice Emitted when the length of the chain ids and adapter arrays doesn't match. + * @dev chainIds.length != adapters.length. + * @param chainIdsLength Length of chain ids array. + * @param adaptersLength Length of adapters array. + */ + error MismatchChainsAdaptersLength(uint256 chainIdsLength, uint256 adaptersLength); + + /** + * @notice Emitted when the origin chain is not the same chain that sent the message + * @dev chainId != origin + */ + error UnauthorizedOrigin(uint32 chainId); + + /** + * @notice Emitted when the length of the chain ids and domain ids arrays doesn't match. + * @dev chainIds.length != domainIds.length. + * @param chainIdsLength Length of chain ids array. + * @param domainsLength Length of domain ids array. + */ + error MismatchChainsDomainsLength(uint256 chainIdsLength, uint256 domainsLength); + + /** + * @notice Emitted when the messages length is zero + * @dev _messages.length < 1 + */ + error NoMessagesSent(uint256 chainId); +} diff --git a/src/hyperlane-adapter/libraries/TypeCasts.sol b/src/hyperlane-adapter/libraries/TypeCasts.sol new file mode 100644 index 0000000..8d4848a --- /dev/null +++ b/src/hyperlane-adapter/libraries/TypeCasts.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// From https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/TypeCasts.sol +pragma solidity 0.8.16; + +library TypeCasts { + // alignment preserving cast + function addressToBytes32(address _addr) internal pure returns (bytes32) { + return bytes32(uint256(uint160(_addr))); + } + + // alignment preserving cast + function bytes32ToAddress(bytes32 _buf) internal pure returns (address) { + return address(uint160(uint256(_buf))); + } +} diff --git a/test/fork/TestHyperlaneAdapter.t.sol b/test/fork/TestHyperlaneAdapter.t.sol new file mode 100644 index 0000000..15d09d0 --- /dev/null +++ b/test/fork/TestHyperlaneAdapter.t.sol @@ -0,0 +1,262 @@ +// SPDX-License-Identifier: UNLICENSED + +pragma solidity 0.8.16; +import "forge-std/Test.sol"; +import "forge-std/Vm.sol"; + +import { IMessageDispatcher } from "../../src/interfaces/IMessageDispatcher.sol"; +import { IMessageExecutor } from "../../src/interfaces/IMessageExecutor.sol"; +import "../../src/hyperlane-adapter/HyperlaneSenderAdapterV3.sol"; +import "../../src/hyperlane-adapter/HyperlaneReceiverAdapterV3.sol"; +import "../../src/libraries/MessageLib.sol"; +import { TypeCasts } from "../../src/hyperlane-adapter/libraries/TypeCasts.sol"; +//import {MockHyperlaneEnvironment} from "../node_modules/@hyperlane-xyz/core/contracts/mock/MockHyperlaneEnvironment.sol"; +//import {MockMailbox} from "../node_modules/@hyperlane-xyz/core/contracts/mock/MockMailbox.sol"; +import { Greeter } from "../../test/contracts/Greeter.sol"; +error Unauthorized(); + +//import {TestRecipient} from "./contracts/TestRecipient.sol"; + +contract TestHyperlaneAdapter is Test { + //origin and destination domains (recommended to be the chainId) + // uint32 origin = 1; + // uint32 destination = 2; + + // // both mailboxes will on the same chain but different addresses + // MockMailbox originMailbox; + // MockMailbox destinationMailbox; + + // // contract which can receive messages + // TestRecipient receiver; + + uint256 public nonce = 1; + uint256 public toChainId = 137; + uint256 public fromChainId = 1; + + uint32 public dstDomainId = 137; + uint32 public srcDomainId = 1; + + uint256 public mainnetFork; + uint256 public polygonFork; + + address public owner; + + HyperlaneSenderAdapterV3 public dispatcher; + HyperlaneReceiverAdapterV3 public executor; + Greeter public greeter; + IInterchainGasPaymaster public mainnetIgp; + + event ReceivedMessage(string message); + + address private constant MAINNET_MAILBOX = 0xc005dc82818d67AF737725bD4bf75435d065D239; + address private constant POLYGON_MAILBOX = 0x5d934f4e2f797775e53561bB72aca21ba36B96BB; + address private constant MAINNET_ISM = 0xec48E52D960E54a179f70907bF28b105813877ee; + address private constant IGP = 0x9e6B1022bE9BBF5aFd152483DAD9b88911bC8611; + + string public mainnetGreeting = "Hello from mainnet"; + string public polygonGreeting = "Hello from polygon"; + + IMailbox public constant mainnetMailbox = IMailbox(MAINNET_MAILBOX); + IMailbox public constant polygonMailbox = IMailbox(POLYGON_MAILBOX); + IInterchainSecurityModule public constant ism = IInterchainSecurityModule(MAINNET_ISM); + + event MessageDispatched( + bytes32 indexed messageId, + address indexed from, + uint256 indexed toChainId, + address to, + bytes data + ); + + event MessageBatchDispatched( + bytes32 indexed messageId, + address indexed from, + uint256 indexed toChainId, + MessageLib.Message[] messages + ); + + event MessageIdExecuted(uint256 indexed fromChainId, bytes32 indexed messageId); + + event SetGreeting( + string greeting, + bytes32 messageId, + uint256 fromChainId, + address from, + address recipient + ); + + /* ============ Errors to test ============ */ + + error MessageFailure(uint256 messageIndex, bytes errorData); + + function setUp() public { + // originMailbox = new MockMailbox(origin); + // destinationMailbox = new MockMailbox(destination); + // originMailbox.addRemoteMailbox(destination, destinationMailbox); + + // receiver = new TestRecipient(); + + mainnetFork = vm.createFork(vm.rpcUrl("mainnet")); + polygonFork = vm.createFork(vm.rpcUrl("polygon")); + owner = 0x5e869af2Af006B538f9c6D231C31DE7cDB4153be; + vm.label(owner, "Deployer"); + deployAll(); + setAll(); + } + + function deployDispatcher() public { + vm.selectFork(mainnetFork); + dispatcher = new HyperlaneSenderAdapterV3(MAINNET_MAILBOX, IGP, 0, owner); + //mainnetIgp = IInterchainGasPaymaster(IGP); + + vm.makePersistent(address(dispatcher)); + } + + function deployExecutor() public { + vm.selectFork(polygonFork); + executor = new HyperlaneReceiverAdapterV3(POLYGON_MAILBOX, owner); + + vm.makePersistent(address(executor)); + } + + function deployGreeter() public { + vm.selectFork(polygonFork); + greeter = new Greeter(address(executor), polygonGreeting); + + vm.makePersistent(address(greeter)); + } + + function deployAll() public { + deployDispatcher(); + deployExecutor(); + deployGreeter(); + } + + function updateDestinationDomains() public { + vm.selectFork(mainnetFork); + uint256[] memory _dstChainIds = new uint256[](1); + uint32[] memory _dstDomainIds = new uint32[](1); + _dstChainIds[0] = toChainId; + _dstDomainIds[0] = 137; + vm.prank(owner); + dispatcher.updateDestinationDomainIds(_dstChainIds, _dstDomainIds); + } + + function updateReceiverAdapter() public { + vm.selectFork(mainnetFork); + address executorAddr = address(executor); + IMessageExecutor receiverAdapter = IMessageExecutor(executorAddr); + uint256[] memory _dstChainIds = new uint256[](1); + IMessageExecutor[] memory receiverAdapters = new IMessageExecutor[](1); + _dstChainIds[0] = toChainId; + receiverAdapters[0] = receiverAdapter; + vm.prank(owner); + dispatcher.updateReceiverAdapter(_dstChainIds, receiverAdapters); + } + + function updateSenderAdapter() public { + vm.selectFork(polygonFork); + address dispatcherAddr = address(dispatcher); + IMessageDispatcher senderAdapter = IMessageDispatcher(dispatcherAddr); + uint256[] memory _srcChainIds = new uint256[](1); + IMessageDispatcher[] memory senderAdapters = new IMessageDispatcher[](1); + _srcChainIds[0] = fromChainId; + senderAdapters[0] = senderAdapter; + vm.prank(owner); + executor.updateSenderAdapter(_srcChainIds, senderAdapters); + } + + function setIsm() public {} + + function setAll() public { + updateDestinationDomains(); + updateReceiverAdapter(); + updateSenderAdapter(); + } + + /* ============ Tests ============ */ + + function testOwner() public { + //deployAll(); + address expectedAddr = address(dispatcher.owner()); + assertEq(owner, expectedAddr); + } + + function testUpdateDestinationDomainIds() public { + //deployAll(); + + //address expectedAddr = address(dispatcher.owner()); + //vm.prank(owner); + uint32 expectedDomainID = dispatcher.getDestinationDomain(toChainId); + assertEq(dstDomainId, expectedDomainID); + } + + function testDispatchMessage() public { + // deployAll(); + // setAll(); + + vm.selectFork(mainnetFork); + + address _to = address(greeter); + bytes memory _data = abi.encodeCall(Greeter.setGreeting, (mainnetGreeting)); + + bytes32 _expectedMessageId = MessageLib.computeMessageId(nonce, address(this), _to, _data); + + vm.expectEmit(true, true, true, true, address(dispatcher)); + emit MessageDispatched(_expectedMessageId, address(this), toChainId, _to, _data); + + uint256 fee = dispatcher.getMessageFee(toChainId, _to, _data); + console.log(fee); + + bytes32 _messageId = dispatcher.dispatchMessage{ value: fee }(toChainId, _to, _data); + assertEq(_messageId, _expectedMessageId); + } + + /* ============ executeMessage ============ */ + function testHandle() public { + vm.selectFork(polygonFork); + + assertEq(greeter.greet(), polygonGreeting); + + address _to = address(greeter); + bytes memory _data = abi.encodeCall(Greeter.setGreeting, (mainnetGreeting)); + + MessageLib.Message[] memory _messages = new MessageLib.Message[](1); + _messages[0] = MessageLib.Message({ to: _to, data: _data }); + + //vm.startPrank(address(polygonMailbox)); + + bytes32 _expectedMessageId = MessageLib.computeMessageId(nonce, address(this), _to, _data); + + vm.expectEmit(true, true, true, true, address(greeter)); + emit SetGreeting( + mainnetGreeting, + _expectedMessageId, + fromChainId, + address(this), + address(executor) + ); + + vm.expectEmit(true, true, true, true, address(executor)); + emit MessageIdExecuted(fromChainId, _expectedMessageId); + + bytes32 addressInBytes = TypeCasts.addressToBytes32(address(dispatcher)); + vm.prank(POLYGON_MAILBOX); + bytes memory _body = abi.encode(_messages, _expectedMessageId, fromChainId, address(this)); + executor.handle(1, addressInBytes, _body); + assertEq(executor.lastMessage(), _body); + assertEq(greeter.greet(), mainnetGreeting); + } + + // function testSendMessage() public { + // string memory _message = "Aloha!"; + // originMailbox.dispatch( + // destination, + // TypeCasts.addressToBytes32(address(receiver)), + // bytes(_message) + // ); + // // simulating message delivery to the destinationMailbox + // destinationMailbox.processNextInboundMessage(); + // assertEq(string(receiver.lastData()), _message); + // } +} diff --git a/yarn.lock b/yarn.lock index d8bf53c..a10fd33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44,6 +44,26 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.23.4": + version: 7.23.8 + resolution: "@babel/runtime@npm:7.23.8" + dependencies: + regenerator-runtime: ^0.14.0 + checksum: 0bd5543c26811153822a9f382fd39886f66825ff2a397a19008011376533747cd05c33a91f6248c0b8b0edf0448d7c167ebfba34786088f1b7eb11c65be7dfc3 + languageName: node + linkType: hard + +"@cosmjs/encoding@npm:^0.31.3": + version: 0.31.3 + resolution: "@cosmjs/encoding@npm:0.31.3" + dependencies: + base64-js: ^1.3.0 + bech32: ^1.1.4 + readonly-date: ^1.0.0 + checksum: dadef0579828299be20a64edf820ac8770c0cc47a842594bc9b494f160a347b745941d795360755ccbe385b9d0912aa54753479d1a70ff762d2d334693952ff9 + languageName: node + linkType: hard + "@cspotcode/source-map-support@npm:^0.8.0": version: 0.8.1 resolution: "@cspotcode/source-map-support@npm:0.8.1" @@ -53,6 +73,43 @@ __metadata: languageName: node linkType: hard +"@eth-optimism/contracts@npm:^0.6.0": + version: 0.6.0 + resolution: "@eth-optimism/contracts@npm:0.6.0" + dependencies: + "@eth-optimism/core-utils": 0.12.0 + "@ethersproject/abstract-provider": ^5.7.0 + "@ethersproject/abstract-signer": ^5.7.0 + peerDependencies: + ethers: ^5 + checksum: 52e9a6cc6ad9bf3ab085d3be501fa4c89e48865baa8aee01aff39c2b007b69600304c7e8f8f4e00d67396e48a0dbfe3a260437efd3a4d7216424cece52639870 + languageName: node + linkType: hard + +"@eth-optimism/core-utils@npm:0.12.0": + version: 0.12.0 + resolution: "@eth-optimism/core-utils@npm:0.12.0" + 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 + checksum: 1c820107c44bdbb46becb1b00fd0dabb44f3ac8f54e6da7872a5a134411fad26f53b193225da55e79d6a8d7f0d01cc16a123db5d41ebaf02ca78360249a4b52a + languageName: node + linkType: hard + "@ethersproject/abi@npm:5.7.0, @ethersproject/abi@npm:^5.0.0-beta.146, @ethersproject/abi@npm:^5.0.9, @ethersproject/abi@npm:^5.1.2, @ethersproject/abi@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/abi@npm:5.7.0" @@ -159,7 +216,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/contracts@npm:5.7.0": +"@ethersproject/contracts@npm:5.7.0, @ethersproject/contracts@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/contracts@npm:5.7.0" dependencies: @@ -319,7 +376,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/providers@npm:5.7.2": +"@ethersproject/providers@npm:5.7.2, @ethersproject/providers@npm:^5.7.0": version: 5.7.2 resolution: "@ethersproject/providers@npm:5.7.2" dependencies: @@ -517,6 +574,34 @@ __metadata: languageName: node linkType: hard +"@hyperlane-xyz/core@npm:^3.6.0": + version: 3.6.0 + resolution: "@hyperlane-xyz/core@npm:3.6.0" + dependencies: + "@eth-optimism/contracts": ^0.6.0 + "@hyperlane-xyz/utils": 3.6.0 + "@openzeppelin/contracts": ^4.9.3 + "@openzeppelin/contracts-upgradeable": ^v4.9.3 + peerDependencies: + "@ethersproject/abi": "*" + "@ethersproject/providers": "*" + "@types/sinon-chai": "*" + checksum: 63ab1e0cf1d4edcec4a1971b5695278ece6a631ca50a4cc96cb1ed1d5a20ed8f04d5cec4392ff2d2e648281da7738348eae323f557bdfcf4d6f6b15dc48ed4ef + languageName: node + linkType: hard + +"@hyperlane-xyz/utils@npm:3.6.0": + version: 3.6.0 + resolution: "@hyperlane-xyz/utils@npm:3.6.0" + dependencies: + "@cosmjs/encoding": ^0.31.3 + "@solana/web3.js": ^1.78.0 + bignumber.js: ^9.1.1 + ethers: ^5.7.2 + checksum: 777b8fa904c004b65605e4f74c0872520930d00449b33e0e5d016edd849effd6a4d7f4f3248ea9e4768fd42006d273beaf024e4dd2660e8f2d3d4f4a3a5777a6 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:^3.0.3": version: 3.1.0 resolution: "@jridgewell/resolve-uri@npm:3.1.0" @@ -554,6 +639,15 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:^1.2.0": + version: 1.3.0 + resolution: "@noble/curves@npm:1.3.0" + dependencies: + "@noble/hashes": 1.3.3 + checksum: b65342ee66c4a440eee2978524412eabba9a9efdd16d6370e15218c6a7d80bddf35e66bb57ed52c0dfd32cb9a717b439ab3a72db618f1a0066dfebe3fd12a421 + languageName: node + linkType: hard + "@noble/hashes@npm:1.1.2": version: 1.1.2 resolution: "@noble/hashes@npm:1.1.2" @@ -561,6 +655,13 @@ __metadata: languageName: node linkType: hard +"@noble/hashes@npm:1.3.3, @noble/hashes@npm:^1.3.2": + version: 1.3.3 + resolution: "@noble/hashes@npm:1.3.3" + checksum: 8a6496d1c0c64797339bc694ad06cdfaa0f9e56cd0c3f68ae3666cfb153a791a55deb0af9c653c7ed2db64d537aa3e3054629740d2f2338bb1dcb7ab60cd205b + languageName: node + linkType: hard + "@noble/hashes@npm:~1.1.1": version: 1.1.3 resolution: "@noble/hashes@npm:1.1.3" @@ -974,6 +1075,20 @@ __metadata: languageName: node linkType: hard +"@openzeppelin/contracts-upgradeable@npm:^v4.9.3": + version: 4.9.5 + resolution: "@openzeppelin/contracts-upgradeable@npm:4.9.5" + checksum: d5d9bad93fe2a88a8336060901d45f185ebfe1fed9844b1fe50e8641d946588c6e69a5a8f1694f0bd073c913b4b9a5c34316acfc17d8f75228adecbcb635ea62 + languageName: node + linkType: hard + +"@openzeppelin/contracts@npm:^4.9.3": + version: 4.9.5 + resolution: "@openzeppelin/contracts@npm:4.9.5" + checksum: 2cddeb08c006a8f99c5cc40cc80aecb449fd941cd1a92ebda315d77f48c4b4d487798a1254bffbc3ec811b390365d14665e92dbb2dd8f45aacef479d69d94574 + languageName: node + linkType: hard + "@pooltogether/erc5164@workspace:.": version: 0.0.0-use.local resolution: "@pooltogether/erc5164@workspace:." @@ -982,6 +1097,7 @@ __metadata: "@ethersproject/abi": 5.7.0 "@ethersproject/experimental": 5.7.0 "@ethersproject/providers": 5.7.2 + "@hyperlane-xyz/core": ^3.6.0 "@nomicfoundation/hardhat-chai-matchers": 1.0.4 "@nomicfoundation/hardhat-network-helpers": 1.0.6 "@nomicfoundation/hardhat-toolbox": 2.0.0 @@ -1148,6 +1264,38 @@ __metadata: languageName: node linkType: hard +"@solana/buffer-layout@npm:^4.0.1": + version: 4.0.1 + resolution: "@solana/buffer-layout@npm:4.0.1" + dependencies: + buffer: ~6.0.3 + checksum: bf846888e813187243d4008a7a9f58b49d16cbd995b9d7f1b72898aa510ed77b1ce5e8468e7b2fd26dd81e557a4e74a666e21fccb95f123c1f740d41138bbacd + languageName: node + linkType: hard + +"@solana/web3.js@npm:^1.78.0": + version: 1.89.1 + resolution: "@solana/web3.js@npm:1.89.1" + dependencies: + "@babel/runtime": ^7.23.4 + "@noble/curves": ^1.2.0 + "@noble/hashes": ^1.3.2 + "@solana/buffer-layout": ^4.0.1 + agentkeepalive: ^4.5.0 + bigint-buffer: ^1.1.5 + bn.js: ^5.2.1 + borsh: ^0.7.0 + bs58: ^4.0.1 + buffer: 6.0.3 + fast-stable-stringify: ^1.0.0 + jayson: ^4.1.0 + node-fetch: ^2.7.0 + rpc-websockets: ^7.5.1 + superstruct: ^0.14.2 + checksum: 4c87fdefa4f750cbb308e6d41e74d2f4bb42a31b2fc8df195daa46fc26cbde4f2e1ed46b8308481d9372371b192d6f81a7c69315248e080e4f7fffc87a0d3087 + languageName: node + linkType: hard + "@solidity-parser/parser@npm:^0.14.0, @solidity-parser/parser@npm:^0.14.1, @solidity-parser/parser@npm:^0.14.3": version: 0.14.3 resolution: "@solidity-parser/parser@npm:0.14.3" @@ -1275,6 +1423,15 @@ __metadata: languageName: node linkType: hard +"@types/connect@npm:^3.4.33": + version: 3.4.38 + resolution: "@types/connect@npm:3.4.38" + dependencies: + "@types/node": "*" + checksum: 7eb1bc5342a9604facd57598a6c62621e244822442976c443efb84ff745246b10d06e8b309b6e80130026a396f19bf6793b7cecd7380169f369dac3bfc46fb99 + languageName: node + linkType: hard + "@types/form-data@npm:0.0.33": version: 0.0.33 resolution: "@types/form-data@npm:0.0.33" @@ -1332,6 +1489,13 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^12.12.54": + version: 12.20.55 + resolution: "@types/node@npm:12.20.55" + checksum: e4f86785f4092706e0d3b0edff8dca5a13b45627e4b36700acd8dfe6ad53db71928c8dee914d4276c7fd3b6ccd829aa919811c9eb708a2c8e4c6eb3701178c37 + languageName: node + linkType: hard + "@types/node@npm:^8.0.0": version: 8.10.66 resolution: "@types/node@npm:8.10.66" @@ -1371,6 +1535,15 @@ __metadata: languageName: node linkType: hard +"@types/ws@npm:^7.4.4": + version: 7.4.7 + resolution: "@types/ws@npm:7.4.7" + dependencies: + "@types/node": "*" + checksum: b4c9b8ad209620c9b21e78314ce4ff07515c0cadab9af101c1651e7bfb992d7fd933bd8b9c99d110738fd6db523ed15f82f29f50b45510288da72e964dedb1a3 + languageName: node + linkType: hard + "@ungap/promise-all-settled@npm:1.1.2": version: 1.1.2 resolution: "@ungap/promise-all-settled@npm:1.1.2" @@ -1378,6 +1551,18 @@ __metadata: languageName: node linkType: hard +"JSONStream@npm:^1.3.5": + version: 1.3.5 + resolution: "JSONStream@npm:1.3.5" + dependencies: + jsonparse: ^1.2.0 + through: ">=2.2.7 <3" + bin: + JSONStream: ./bin.js + checksum: 2605fa124260c61bad38bb65eba30d2f72216a78e94d0ab19b11b4e0327d572b8d530c0c9cc3b0764f727ad26d39e00bf7ebad57781ca6368394d73169c59e46 + languageName: node + linkType: hard + "abbrev@npm:1": version: 1.1.1 resolution: "abbrev@npm:1.1.1" @@ -1491,6 +1676,15 @@ __metadata: languageName: node linkType: hard +"agentkeepalive@npm:^4.5.0": + version: 4.5.0 + resolution: "agentkeepalive@npm:4.5.0" + dependencies: + humanize-ms: ^1.2.1 + checksum: 13278cd5b125e51eddd5079f04d6fe0914ac1b8b91c1f3db2c1822f99ac1a7457869068997784342fe455d59daaff22e14fb7b8c3da4e741896e7e31faf92481 + languageName: node + linkType: hard + "aggregate-error@npm:^3.0.0": version: 3.1.0 resolution: "aggregate-error@npm:3.1.0" @@ -1867,7 +2061,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1": +"base64-js@npm:^1.3.0, base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 @@ -1883,13 +2077,23 @@ __metadata: languageName: node linkType: hard -"bech32@npm:1.1.4": +"bech32@npm:1.1.4, bech32@npm:^1.1.4": version: 1.1.4 resolution: "bech32@npm:1.1.4" checksum: 0e98db619191548390d6f09ff68b0253ba7ae6a55db93dfdbb070ba234c1fd3308c0606fbcc95fad50437227b10011e2698b89f0181f6e7f845c499bd14d0f4b languageName: node linkType: hard +"bigint-buffer@npm:^1.1.5": + version: 1.1.5 + resolution: "bigint-buffer@npm:1.1.5" + dependencies: + bindings: ^1.3.0 + node-gyp: latest + checksum: d010c9f57758bcdaccb435d88b483ffcc95fe8bbc6e7fb3a44fb5221f29c894ffaf4a3c5a4a530e0e7d6608203c2cde9b79ee4f2386cd6d4462d1070bc8c9f4e + languageName: node + linkType: hard + "bigint-crypto-utils@npm:^3.0.23": version: 3.1.7 resolution: "bigint-crypto-utils@npm:3.1.7" @@ -1913,6 +2117,13 @@ __metadata: languageName: node linkType: hard +"bignumber.js@npm:^9.1.1": + version: 9.1.2 + resolution: "bignumber.js@npm:9.1.2" + checksum: 582c03af77ec9cb0ebd682a373ee6c66475db94a4325f92299621d544aa4bd45cb45fd60001610e94aef8ae98a0905fa538241d9638d4422d57abbeeac6fadaf + languageName: node + linkType: hard + "binary-extensions@npm:^2.0.0": version: 2.2.0 resolution: "binary-extensions@npm:2.2.0" @@ -1920,6 +2131,15 @@ __metadata: languageName: node linkType: hard +"bindings@npm:^1.3.0": + version: 1.5.0 + resolution: "bindings@npm:1.5.0" + dependencies: + file-uri-to-path: 1.0.0 + checksum: 65b6b48095717c2e6105a021a7da4ea435aa8d3d3cd085cb9e85bcb6e5773cf318c4745c3f7c504412855940b585bdf9b918236612a1c7a7942491de176f1ae7 + languageName: node + linkType: hard + "blakejs@npm:^1.1.0": version: 1.2.1 resolution: "blakejs@npm:1.2.1" @@ -1948,6 +2168,17 @@ __metadata: languageName: node linkType: hard +"borsh@npm:^0.7.0": + version: 0.7.0 + resolution: "borsh@npm:0.7.0" + dependencies: + bn.js: ^5.2.0 + bs58: ^4.0.0 + text-encoding-utf-8: ^1.0.2 + checksum: e98bfb5f7cfb820819c2870b884dac58dd4b4ce6a86c286c8fbf5c9ca582e73a8c6094df67e81a28c418ff07a309c6b118b2e27fdfea83fd92b8100c741da0b5 + languageName: node + linkType: hard + "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -2016,7 +2247,7 @@ __metadata: languageName: node linkType: hard -"bs58@npm:^4.0.0": +"bs58@npm:^4.0.0, bs58@npm:^4.0.1": version: 4.0.1 resolution: "bs58@npm:4.0.1" dependencies: @@ -2050,7 +2281,7 @@ __metadata: languageName: node linkType: hard -"buffer@npm:^6.0.3": +"buffer@npm:6.0.3, buffer@npm:^6.0.3, buffer@npm:~6.0.3": version: 6.0.3 resolution: "buffer@npm:6.0.3" dependencies: @@ -2060,6 +2291,23 @@ __metadata: languageName: node linkType: hard +"bufferutil@npm:^4.0.1": + version: 4.0.8 + resolution: "bufferutil@npm:4.0.8" + dependencies: + node-gyp: latest + node-gyp-build: ^4.3.0 + checksum: 7e9a46f1867dca72fda350966eb468eca77f4d623407b0650913fadf73d5750d883147d6e5e21c56f9d3b0bdc35d5474e80a600b9f31ec781315b4d2469ef087 + languageName: node + linkType: hard + +"bufio@npm:^1.0.7": + version: 1.2.1 + resolution: "bufio@npm:1.2.1" + checksum: b6e1216f4a5877617a3580b83807d8b96c794c015bc2d5eb9e70e152dc79fe923517472bd96df3d5b8feb59a0e25e2aa3cd8a70b8f90905b92d86f2e5719ed68 + languageName: node + linkType: hard + "busboy@npm:^1.6.0": version: 1.6.0 resolution: "busboy@npm:1.6.0" @@ -2208,6 +2456,21 @@ __metadata: languageName: node linkType: hard +"chai@npm:^4.3.4": + version: 4.4.1 + resolution: "chai@npm:4.4.1" + dependencies: + assertion-error: ^1.1.0 + check-error: ^1.0.3 + deep-eql: ^4.1.3 + get-func-name: ^2.0.2 + loupe: ^2.3.6 + pathval: ^1.1.1 + type-detect: ^4.0.8 + checksum: 9ab84f36eb8e0b280c56c6c21ca4da5933132cd8a0c89c384f1497f77953640db0bc151edd47f81748240a9fab57b78f7d925edfeedc8e8fc98016d71f40c36e + languageName: node + linkType: hard + "chalk@npm:4.1.2, chalk@npm:^4.1.0, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" @@ -2250,6 +2513,15 @@ __metadata: languageName: node linkType: hard +"check-error@npm:^1.0.3": + version: 1.0.3 + resolution: "check-error@npm:1.0.3" + dependencies: + get-func-name: ^2.0.2 + checksum: e2131025cf059b21080f4813e55b3c480419256914601750b0fee3bd9b2b8315b531e551ef12560419b8b6d92a3636511322752b1ce905703239e7cc451b6399 + languageName: node + linkType: hard + "chokidar@npm:3.3.0": version: 3.3.0 resolution: "chokidar@npm:3.3.0" @@ -2523,6 +2795,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^2.20.3": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e + languageName: node + linkType: hard + "commander@npm:^9.3.0": version: 9.4.1 resolution: "commander@npm:9.4.1" @@ -2732,6 +3011,15 @@ __metadata: languageName: node linkType: hard +"deep-eql@npm:^4.1.3": + version: 4.1.3 + resolution: "deep-eql@npm:4.1.3" + dependencies: + type-detect: ^4.0.0 + checksum: 7f6d30cb41c713973dc07eaadded848b2ab0b835e518a88b91bea72f34e08c4c71d167a722a6f302d3a6108f05afd8e6d7650689a84d5d29ec7fe6220420397f + languageName: node + linkType: hard + "deep-extend@npm:~0.6.0": version: 0.6.0 resolution: "deep-extend@npm:0.6.0" @@ -2756,6 +3044,13 @@ __metadata: languageName: node linkType: hard +"delay@npm:^5.0.0": + version: 5.0.0 + resolution: "delay@npm:5.0.0" + checksum: 62f151151ecfde0d9afbb8a6be37a6d103c4cb24f35a20ef3fe56f920b0d0d0bb02bc9c0a3084d0179ef669ca332b91155f2ee4d9854622cd2cdba5fc95285f9 + languageName: node + linkType: hard + "delayed-stream@npm:~1.0.0": version: 1.0.0 resolution: "delayed-stream@npm:1.0.0" @@ -3003,6 +3298,22 @@ __metadata: languageName: node linkType: hard +"es6-promise@npm:^4.0.3": + version: 4.2.8 + resolution: "es6-promise@npm:4.2.8" + checksum: 95614a88873611cb9165a85d36afa7268af5c03a378b35ca7bda9508e1d4f1f6f19a788d4bc755b3fd37c8ebba40782018e02034564ff24c9d6fa37e959ad57d + languageName: node + linkType: hard + +"es6-promisify@npm:^5.0.0": + version: 5.0.0 + resolution: "es6-promisify@npm:5.0.0" + dependencies: + es6-promise: ^4.0.3 + checksum: fbed9d791598831413be84a5374eca8c24800ec71a16c1c528c43a98e2dadfb99331483d83ae6094ddb9b87e6f799a15d1553cebf756047e0865c753bc346b92 + languageName: node + linkType: hard + "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -3302,7 +3613,7 @@ __metadata: languageName: node linkType: hard -"ethers@npm:5.7.2, ethers@npm:^5.7.0": +"ethers@npm:5.7.2, ethers@npm:^5.7.0, ethers@npm:^5.7.2": version: 5.7.2 resolution: "ethers@npm:5.7.2" dependencies: @@ -3422,6 +3733,13 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^4.0.7": + version: 4.0.7 + resolution: "eventemitter3@npm:4.0.7" + checksum: 1875311c42fcfe9c707b2712c32664a245629b42bb0a5a84439762dd0fd637fc54d078155ea83c2af9e0323c9ac13687e03cfba79b03af9f40c89b4960099374 + languageName: node + linkType: hard + "evp_bytestokey@npm:^1.0.3": version: 1.0.3 resolution: "evp_bytestokey@npm:1.0.3" @@ -3482,6 +3800,13 @@ __metadata: languageName: node linkType: hard +"eyes@npm:^0.1.8": + version: 0.1.8 + resolution: "eyes@npm:0.1.8" + checksum: c31703a92bf36ba75ee8d379ee7985c24ee6149f3a6175f44cec7a05b178c38bce9836d3ca48c9acb0329a960ac2c4b2ead4e60cdd4fe6e8c92cad7cd6913687 + languageName: node + linkType: hard + "fast-deep-equal@npm:^3.1.1": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -3523,6 +3848,13 @@ __metadata: languageName: node linkType: hard +"fast-stable-stringify@npm:^1.0.0": + version: 1.0.0 + resolution: "fast-stable-stringify@npm:1.0.0" + checksum: ef1203d246a7e8ac15e2bfbda0a89fa375947bccf9f7910be0ea759856dbe8ea5024a0d8cc2cceabe18a9cb67e95927b78bb6173a3ae37ec55a518cf36e5244b + languageName: node + linkType: hard + "fastq@npm:^1.6.0": version: 1.13.0 resolution: "fastq@npm:1.13.0" @@ -3550,6 +3882,13 @@ __metadata: languageName: node linkType: hard +"file-uri-to-path@npm:1.0.0": + version: 1.0.0 + resolution: "file-uri-to-path@npm:1.0.0" + checksum: b648580bdd893a008c92c7ecc96c3ee57a5e7b6c4c18a9a09b44fb5d36d79146f8e442578bc0e173dc027adf3987e254ba1dfd6e3ec998b7c282873010502144 + languageName: node + linkType: hard + "fill-range@npm:^7.0.1": version: 7.0.1 resolution: "fill-range@npm:7.0.1" @@ -3889,6 +4228,13 @@ __metadata: languageName: node linkType: hard +"get-func-name@npm:^2.0.1, get-func-name@npm:^2.0.2": + version: 2.0.2 + resolution: "get-func-name@npm:2.0.2" + checksum: 3f62f4c23647de9d46e6f76d2b3eafe58933a9b3830c60669e4180d6c601ce1b4aa310ba8366143f55e52b139f992087a9f0647274e8745621fa2af7e0acf13b + languageName: node + linkType: hard + "get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.0, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3": version: 1.1.3 resolution: "get-intrinsic@npm:1.1.3" @@ -4889,6 +5235,15 @@ __metadata: languageName: node linkType: hard +"isomorphic-ws@npm:^4.0.1": + version: 4.0.1 + resolution: "isomorphic-ws@npm:4.0.1" + peerDependencies: + ws: "*" + checksum: d7190eadefdc28bdb93d67b5f0c603385aaf87724fa2974abb382ac1ec9756ed2cfb27065cbe76122879c2d452e2982bc4314317f3d6c737ddda6c047328771a + languageName: node + linkType: hard + "isstream@npm:~0.1.2": version: 0.1.2 resolution: "isstream@npm:0.1.2" @@ -4896,6 +5251,28 @@ __metadata: languageName: node linkType: hard +"jayson@npm:^4.1.0": + version: 4.1.0 + resolution: "jayson@npm:4.1.0" + dependencies: + "@types/connect": ^3.4.33 + "@types/node": ^12.12.54 + "@types/ws": ^7.4.4 + JSONStream: ^1.3.5 + commander: ^2.20.3 + delay: ^5.0.0 + es6-promisify: ^5.0.0 + eyes: ^0.1.8 + isomorphic-ws: ^4.0.1 + json-stringify-safe: ^5.0.1 + uuid: ^8.3.2 + ws: ^7.4.5 + bin: + jayson: bin/jayson.js + checksum: 86464322fbdc6db65d2bb4fc278cb6c86fad5c2a506065490d39459f09ba0d30f2b4fb740b33828a1424791419b6c8bd295dc54d361a4ad959bf70cc62b1ca7e + languageName: node + linkType: hard + "joi@npm:^17.6.0": version: 17.6.2 resolution: "joi@npm:17.6.2" @@ -5007,7 +5384,7 @@ __metadata: languageName: node linkType: hard -"json-stringify-safe@npm:~5.0.1": +"json-stringify-safe@npm:^5.0.1, json-stringify-safe@npm:~5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" checksum: 48ec0adad5280b8a96bb93f4563aa1667fd7a36334f79149abd42446d0989f2ddc58274b479f4819f1f00617957e6344c886c55d05a4e15ebb4ab931e4a6a8ee @@ -5051,6 +5428,13 @@ __metadata: languageName: node linkType: hard +"jsonparse@npm:^1.2.0": + version: 1.3.1 + resolution: "jsonparse@npm:1.3.1" + checksum: 6514a7be4674ebf407afca0eda3ba284b69b07f9958a8d3113ef1005f7ec610860c312be067e450c569aab8b89635e332cee3696789c750692bb60daba627f4d + languageName: node + linkType: hard + "jsonschema@npm:^1.2.4": version: 1.4.1 resolution: "jsonschema@npm:1.4.1" @@ -5303,6 +5687,15 @@ __metadata: languageName: node linkType: hard +"loupe@npm:^2.3.6": + version: 2.3.7 + resolution: "loupe@npm:2.3.7" + dependencies: + get-func-name: ^2.0.1 + checksum: 96c058ec7167598e238bb7fb9def2f9339215e97d6685d9c1e3e4bdb33d14600e11fe7a812cf0c003dfb73ca2df374f146280b2287cae9e8d989e9d7a69a203b + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -5865,6 +6258,20 @@ __metadata: languageName: node linkType: hard +"node-fetch@npm:^2.7.0": + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" + dependencies: + whatwg-url: ^5.0.0 + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: d76d2f5edb451a3f05b15115ec89fc6be39de37c6089f1b6368df03b91e1633fd379a7e01b7ab05089a25034b2023d959b47e59759cb38d88341b2459e89d6e5 + languageName: node + linkType: hard + "node-gyp-build@npm:^4.2.0, node-gyp-build@npm:^4.3.0": version: 4.5.0 resolution: "node-gyp-build@npm:4.5.0" @@ -6591,6 +6998,13 @@ __metadata: languageName: node linkType: hard +"readonly-date@npm:^1.0.0": + version: 1.0.0 + resolution: "readonly-date@npm:1.0.0" + checksum: 78481e2abf3c2f9bc526029458aee3e2b1c476ca1434c4cc9db5c9aba51bf8f1323c1995d764ff01f2055b01f13e05416b2e14b387f644b0a5a56554c3ee9d0a + languageName: node + linkType: hard + "rechoir@npm:^0.6.2": version: 0.6.2 resolution: "rechoir@npm:0.6.2" @@ -6616,6 +7030,13 @@ __metadata: languageName: node linkType: hard +"regenerator-runtime@npm:^0.14.0": + version: 0.14.1 + resolution: "regenerator-runtime@npm:0.14.1" + checksum: 9f57c93277b5585d3c83b0cf76be47b473ae8c6d9142a46ce8b0291a04bb2cf902059f0f8445dcabb3fb7378e5fe4bb4ea1e008876343d42e46d3b484534ce38 + languageName: node + linkType: hard + "regexp.prototype.flags@npm:^1.4.3": version: 1.4.3 resolution: "regexp.prototype.flags@npm:1.4.3" @@ -6892,6 +7313,25 @@ __metadata: languageName: node linkType: hard +"rpc-websockets@npm:^7.5.1": + version: 7.9.0 + resolution: "rpc-websockets@npm:7.9.0" + dependencies: + "@babel/runtime": ^7.17.2 + bufferutil: ^4.0.1 + eventemitter3: ^4.0.7 + utf-8-validate: ^5.0.2 + uuid: ^8.3.2 + ws: ^8.5.0 + dependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: c3ddd79ea7cf63b7a6a8d32356c7f9b363e41f26a6a8bbe889f9d2c5267811d492e194340fbad1a21ecfa457d5d1f253af3357a94d0118f66fcdea1fd9236adc + languageName: node + linkType: hard + "run-async@npm:^2.2.0": version: 2.4.1 resolution: "run-async@npm:2.4.1" @@ -7680,6 +8120,13 @@ __metadata: languageName: node linkType: hard +"superstruct@npm:^0.14.2": + version: 0.14.2 + resolution: "superstruct@npm:0.14.2" + checksum: c5c4840f432da82125b923ec45faca5113217e83ae416e314d80eae012b8bb603d2e745025d173450758d116348820bc7028157f8c9a72b6beae879f94b837c0 + languageName: node + linkType: hard + "supports-color@npm:6.0.0": version: 6.0.0 resolution: "supports-color@npm:6.0.0" @@ -7803,6 +8250,13 @@ __metadata: languageName: node linkType: hard +"text-encoding-utf-8@npm:^1.0.2": + version: 1.0.2 + resolution: "text-encoding-utf-8@npm:1.0.2" + checksum: ec4c15d50e738c5dba7327ad432ebf0725ec75d4d69c0bd55609254c5a3bc5341272d7003691084a0a73d60d981c8eb0e87603676fdb6f3fed60f4c9192309f9 + languageName: node + linkType: hard + "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -7829,7 +8283,7 @@ __metadata: languageName: node linkType: hard -"through@npm:^2.3.6, through@npm:^2.3.8": +"through@npm:>=2.2.7 <3, through@npm:^2.3.6, through@npm:^2.3.8": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd @@ -7871,6 +8325,13 @@ __metadata: languageName: node linkType: hard +"tr46@npm:~0.0.3": + version: 0.0.3 + resolution: "tr46@npm:0.0.3" + checksum: 726321c5eaf41b5002e17ffbd1fb7245999a073e8979085dacd47c4b4e8068ff5777142fc6726d6ca1fd2ff16921b48788b87225cbc57c72636f6efa8efbffe3 + languageName: node + linkType: hard + "ts-command-line-args@npm:^2.2.0": version: 2.3.1 resolution: "ts-command-line-args@npm:2.3.1" @@ -7992,7 +8453,7 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:^4.0.0, type-detect@npm:^4.0.5": +"type-detect@npm:^4.0.0, type-detect@npm:^4.0.5, type-detect@npm:^4.0.8": version: 4.0.8 resolution: "type-detect@npm:4.0.8" checksum: 62b5628bff67c0eb0b66afa371bd73e230399a8d2ad30d852716efcc4656a7516904570cd8631a49a3ce57c10225adf5d0cbdcb47f6b0255fe6557c453925a15 @@ -8154,6 +8615,16 @@ __metadata: languageName: node linkType: hard +"utf-8-validate@npm:^5.0.2": + version: 5.0.10 + resolution: "utf-8-validate@npm:5.0.10" + dependencies: + node-gyp: latest + node-gyp-build: ^4.3.0 + checksum: 5579350a023c66a2326752b6c8804cc7b39dcd251bb088241da38db994b8d78352e388dcc24ad398ab98385ba3c5ffcadb6b5b14b2637e43f767869055e46ba6 + languageName: node + linkType: hard + "utf8@npm:3.0.0": version: 3.0.0 resolution: "utf8@npm:3.0.0" @@ -8251,6 +8722,23 @@ __metadata: languageName: node linkType: hard +"webidl-conversions@npm:^3.0.0": + version: 3.0.1 + resolution: "webidl-conversions@npm:3.0.1" + checksum: c92a0a6ab95314bde9c32e1d0a6dfac83b578f8fa5f21e675bc2706ed6981bc26b7eb7e6a1fab158e5ce4adf9caa4a0aee49a52505d4d13c7be545f15021b17c + languageName: node + linkType: hard + +"whatwg-url@npm:^5.0.0": + version: 5.0.0 + resolution: "whatwg-url@npm:5.0.0" + dependencies: + tr46: ~0.0.3 + webidl-conversions: ^3.0.0 + checksum: b8daed4ad3356cc4899048a15b2c143a9aed0dfae1f611ebd55073310c7b910f522ad75d727346ad64203d7e6c79ef25eafd465f4d12775ca44b90fa82ed9e2c + languageName: node + linkType: hard + "which-boxed-primitive@npm:^1.0.2": version: 1.0.2 resolution: "which-boxed-primitive@npm:1.0.2" @@ -8406,7 +8894,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^7.4.6": +"ws@npm:^7.4.5, ws@npm:^7.4.6": version: 7.5.9 resolution: "ws@npm:7.5.9" peerDependencies: @@ -8421,6 +8909,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:^8.5.0": + version: 8.16.0 + resolution: "ws@npm:8.16.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: feb3eecd2bae82fa8a8beef800290ce437d8b8063bdc69712725f21aef77c49cb2ff45c6e5e7fce622248f9c7abaee506bae0a9064067ffd6935460c7357321b + languageName: node + linkType: hard + "xmlhttprequest@npm:1.8.0": version: 1.8.0 resolution: "xmlhttprequest@npm:1.8.0"