LogoLogo
  • Entangle
    • Overview
    • Security Audits
  • Universal Interoperability Protocol
    • Overview
    • Architecture
      • Scalability and Network Stability
        • L2 Utility Blockchains
        • Transmitter Groups
      • Security and Consensus Mechanism
      • Finality
      • Execution Latency
      • Compatibility and Interoperability
    • Developer Guides
      • Getting Started
      • Solidity
        • Simple Abstract Messenger Example
        • Deploying Your Custom EVM Protocol
        • Bridging Tokens with UIP
        • Become an EVM Transmitter
      • Solana
        • Simple Abstract Messenger Example
        • Deploying Your Custom Solana Protocol
        • Become a Solana Transmitter
      • Calculate Cross-Chain Transaction Cost
      • Customizable Message Transmission Options
      • How to Debug Sent Messages
      • SDK Setup
      • Revenue Sharing for Transmitters
      • How to Become a Super Transmitter
    • Endpoints
  • Universal Data Feeds
    • Overview
    • Architecture
      • Data Delivery Methods
        • Pull Model
        • Push Model
      • Oracle Contract & User Interaction
    • Developer Guides
      • Custom Data Feeds
      • Fetch Data via Pull Model (PAYG)
        • EVM Smart Contracts
        • Solana Smart Contracts
      • Fetch Data via Pull Model (Subscriptions)
        • EVM Smart Contracts
        • Solana Smart Contracts
      • Fetch Data via Push Model
        • EVM Smart Contracts
        • Solana Smart Contracts
    • User Guides
      • Accessing Feeds
      • Subscribe to a Data Feed
      • Check Subscription
      • Manage Subscription
      • Renew Subscription
    • Data Endpoints
  • Universal Token Standard
    • Overview
    • Architecture
      • Fee Components
    • Developer Guides
      • Manual Deploy
        • Token Deployment Types
        • Create a Custom Token
        • Factory Blueprint Deployment
        • Examples
          • Initial Setup
          • UTS Connector
            • Mint & Burn Connector Scheme
            • Lock & Unlock Connector Scheme
            • Connector Over Native Currency
          • UTS Token
            • Simple Token
            • Token with Messages
      • Bridge SDK
      • Token Verification
      • Fees Calculation & Gas Estimation Logic
      • Estimations
    • User Guides
      • Launch Universal Token
      • Create a Liquidity Pool
      • Expand Existing Token
      • Transfer Liquidity to Connector
      • Bridging
    • Contract Addresses
  • Entangle Interoperable Blockchain
    • Overview
    • Architecture
    • Developer Guides
      • Set up a Validator Node
      • Delegating to Validators
      • Undelegating from Validators
      • Supported Accounts
  • More
    • Media Kit
    • FAQ
    • Report an Issue
    • Become a Partner
Powered by GitBook
On this page
  • Retrieving Account Balance
  • Fetching Block Data
  • Extracting Transaction Details
  • Printing Proposal Data
  • Retrieving Proposal and TEIB Message Hash
  • Retrieve Source & Destination Chain ID
  • Retrieve Initial msg.value
  • Retrieve Entire Message
  • Check Message Status by Hash
  • Checking Message Execution on Destination Endpoint
  • Retrieving the Last Received Message by Sender
  • Get Estimate Fee

Was this helpful?

Export as PDF
  1. Universal Interoperability Protocol
  2. Developer Guides

How to Debug Sent Messages

PreviousCustomizable Message Transmission OptionsNextSDK Setup

Last updated 2 months ago

Was this helpful?

This guide provides instructions on debugging sent messages using command-line tools and hardhat. It covers retrieving message status, inspecting arguments of emitted events by the Endpoint, and more. If you have not deployed your custom protocol yet, refer to the guide before proceeding.

Retrieving Account Balance

To get the balance of any account on an EVM-compatible network, execute the command below. It will print the specified account balance.

npx hardhat balance --acc <address> --network <network_name>
Output
Using network: teib

199.999999999953525184 native

Fetching Block Data

To retrieve block details from an EVM-compatible network, execute the command below. It will output the block number, block hash, and creation timestamp.

npx hardhat getBlock --num <block_number> --network <network_name>
Output
Reading block: 7892216

Number:  7892216
Hash:    0x69ad02f4b65f73043cb2d228d43c4ad1cd89b51c84410330ca4d6b301e1f0291
Time:    1741849068

Extracting Transaction Details

To obtain details of a specific transaction, execute the command below. It will output the sender address, the receiver address, msg.value, payload, and block number.

npx hardhat getTxData --hash <tx_hash> --network <network_name>
Output

In this example, some values have been shortened (indicated by "...") for visibility.

Reading data from tx: 0x872f7acf59f32...7e3c694826c7

From: 0xB8F2952882622Bee2fD495148a35109dc108858d
To: 0xC1a4aD3AaC062d875A9395B041ef5E4885BB8F9c
Value: 0
Data: 0x095ea7...28dde4d10ee5c56f
Block: 7892221

Printing Proposal Data

If a proposal was sent to the Endpoint, parse the emitted event by executing the below command. It will output the destination chain ID, msg.value, selector slot, agent parameters, sender address, destination address, encoded payload.

npx hardhat proposal --hash <tx_hash> --network <network_name>
Output

In this example, some values have been shortened (indicated by "...") for visibility.

Reading proposal event from tx: 0x85...e9750
Chain id:  5003n
Msg.value:  1000000n
Selector slot:  0...00af859a79
Agent parameters:  0x0...000042748
Sender address:  0x0...1c3f92c305a
Destination address:  0x0...f744a2d2
Encoded payload:  0x0...0d5bde9af
Reserved:  0x

Retrieving Proposal and TEIB Message Hash

To find the message hash associated with a transaction hash from the source network, execute the command below. If a proposal is found in the transaction receipt, it will be reconstructed, and the corresponding message hashes will be displayed.

npx hardhat getMsgHash --hash <source_tx_hash> --network <network_name>

Status Codes

0  = NOT_INITIALIZED
1  = INVALID
2  = SAVED
3  = TRANSMITTED
4  = QUEUED
5  = PENDING
6  = PROTOCOL_FAILED
7  = EXTENSION_NOT_REGISTERED
8  = EXTENSION_NOT_REACHABLE
9  = EXTENSION_PANICKED
10 = UNDERESTIMATED
11 = SUCCESS
12 = FAILED
13 = OUT_OF_GAS
Output

In this example, some values have been shortened (indicated by "...") for visibility.

Proposals found in receipt:  1

Source Chain Data: {
  srcChainId: 5003n,
  srcBlockNumber: 20076568,
  srcOpTxId: [
    '0xf545...d74f',
    '0x0000...0000'
  ]
}
LogDescription {
  fragment: EventFragment {
    type: 'event',
    inputs: [
      [ParamType],
      [ParamType],
      [ParamType],
      [ParamType],
      [ParamType],
      [ParamType],
      [ParamType],
      [ParamType]
    ],
    name: 'MessageProposed',
    anonymous: false
  },
  name: 'MessageProposed',
  signature: 'MessageProposed(uint256,uint256,bytes32,bytes,bytes,bytes,bytes,bytes)',
  topic: '0x87e6e...0390',
  args: Result(8) [
    80002n,
    1000000n,
    '0x0000...9a79',
    '0x0000...2748',
    '0x0000...a2d2',
    '0x0000...db46',
    '0x0000...e9af',
    '0x'
  ]
}

[Proposal created]:  {
  destChainId: 80002n,
  nativeAmount: 1000000n,
  selectorSlot: '0x0000...9a79',
  agentParams: '0x0000...2748',
  senderAddr: '0x0000...a2d2',
  destAddr: '0x0000...db46',
  payload: '0x0000...e9af',
  reserved: '0x'
}

Hashes found: [
  '0x14ed...0fa8'
]

Retrieve Source & Destination Chain ID

If you're working on the Mainnet environment, change "teib" to "eib".

The below command will output the status of the message with the specified hash, including the source and destination chain ID.

npx hardhat getChainIds --hash <teib_tx_hash> --network teib
Output
Current status of message with hash 0x93f013014a46f9dc8ba9efa60da3683700a73fae736770c7234f477898ebab3b

Source chain id: 5003

Destination chain id: 33133

Retrieve Initial msg.value

If you're working on the Mainnet environment, change "teib" to "eib".

The below command will output the reward value of the specified hash.

npx hardhat getReward --hash <teib_tx_hash> --network teib
Output
Current status of message with hash 0x6bf45198264adcb493e2c07864c71d324eec70d111552757f842186612c12bae

Reward: 1

Retrieve Entire Message

If you're working on the Mainnet environment, change "teib" to "eib".

The below command will retrieve the full message, including status, nonce, and initial proposal.

npx hardhat getMsg --hash <teib_tx_hash> --network teib
Output

In this example, some values have been shortened (indicated by "...") for visibility.

Message of hash:
0x6...186612c12bae

- GLOBAL -
Status: 11 | SUCCESS | delivery zone
Global nonce: 30539

- Proposal -
Destination chain:          5003
Native amount:              1
Selector slot:              0x0...0af859a79
Sender address:             0x0...03f5a530b
Destination address:        0x0...00cd4b974
Payload:                    0x0...01bdd243c
Reserved:                   0x
Block finalization option:  0
Custom gas limit:           300000

- Source chain -
Location:       1127457...683956
Source tx hash: 0xf...1b65841895

Retrieve Initial Proposal & Source Chain Data --  delete
Retrieve Source Chain ID -- delete
Retrieve Destination Chain ID --  delete

Check Message Status by Hash

If you're working on the Mainnet environment, change "teib" to "eib".

To determine the current status of a sent message, execute the below command. If the transaction is found, the output will display its current status along with information from the initial proposal.

npx hardhat getMsgStatusByHash --hash <teib_tx_hash> --network teib
Output
Current status of message with hash <teib_tx_hash>

Status: SUCCESS

Zone: delivery

Checking Message Execution on Destination Endpoint

The below command will retrieve the execution status of the provided hash on the specified network. There are 3 possible execution statuses, described below.

npx hardhat getMsgExecution --hash <teib_tx_hash> --network <dest_network_name>
Output
Current execution status of message with hash 0xdfc2c4b17f947abca4aa90697d3d82627e520c0644f9b56e6bace16d16d6b43c

Execution status: Executed

Status Codes

0 - Does not exist
1 - Executed
2 - Protocol failed

Retrieving the Last Received Message by Sender

To get the last received message using a sender address, execute the command below. If the message is found, it will output message length and the message itself in bytes, which is the decoded representation.

npx hardhat getLastMessage --sender <sender_address> --network <network_name>
Output

In this example, some values have been shortened (indicated by "...") for visibility.

===============================================
Bytes len of message: 194
Msg Bytes: 0x000866726f6d5f6574680000000...0000
===============================================

Last message from address 0xB3B029...5Bde9AF is: "from_eth"

Get Estimate Fee

To get estimated fee for message execution on destination chain + UIP commissions execute the below command.

npx hardhat estimateFee --srcchainid <source chain id> --destchainid <destination chain id> --gaslimit <custom gas limit>
Output
Cross-chain Fee Estimate:
- Network: Chain 11155111 → Chain 80002
- Estimated native value (ETH): 0.000005188940008676
- Estimated native value (Gwei): 5188.940008676
- Estimated native value (Wei): 5188940008676
Getting Started