Verify Transaction Status
After gaining an understanding of how smart contracts work and how to use blockchain explorers, verifying the status of transactions from these contracts becomes a straightforward process. In this section, we will
focus on using the SimpleStorage.sol
smart contract, which was created in the section: Deploy Your First Smart Contract.
We will use the Subscan Explorer, introduced in the section Block Explorers to track and verify the transactions associated with deploying and interacting with the smart contract. This will include confirming the deployment, verifying function calls, and ensuring data was successfully stored and retrieved on-chain.
Get Deployed Transaction hash
From the contract you deployed at Deploy Smart Contract obtain the contract address that was deployed. We will use this to see if the operations that executed on the smart contract level have been correctly recorded on the online ledger.
Using Subscan to Verify Smart Contract Transactions
1. Access Subscan
Access the Subscan endpoint for the network you deployed your smart contract:
Network | Subscan Link |
---|---|
peaq | https://peaq.subscan.io/ |
agung | https://agung-testnet.subscan.io/ |
2. Confirming Deployment
Paste your deployed smart contract in the search bar. If deployed correctly it will route you to the contract address page.
3. Verifying function calls
Use Remix, the deployment script you created, or Hardhat console to interact with your smart contract. Verify the operations that you performed were recorded in Subscan. The following case is shown below:
- User executes a deployment script which performs a write transaction on the network.
- Wait for Subscan to be updated to show the smart contract transaction.
- Transaction appears in the EVM Transactions table. Click the arrow to ensure the data was stored.
4. Ensure data was successfully stored
After clicking the arrow on the above transaction it will redirect you to information about the transaction. Similar to the following:
Transaction Overview
- Status: ✅ Confirmed
- The transaction has been successfully processed and included in a block on the blockchain.
- EVM Txhash:
0xa540d982649de379fa083867a96ab4eb85fc90718dfb92af3beb29c5a26597c2
- Unique identifier (hash) for the transaction. Can be used to locate and reference this transaction across blockchain explorers.
- From:
0x9Eeab1aCcb1A701aEfAB00F3b8a275a39646641C
- Sender’s Ethereum-compatible account address that initiated the transaction.
- To:
0x12e27eabb913acf6c0D109a062ba1e266bFd8CcF
- Smart contract address that executed the function call.
- Value:
0 PEAQ
- No PEAQ tokens were transferred as part of this transaction.
- Result: ✅ Success
- The transaction was successfully executed without errors.
- Nonce:
851
- Number of transactions sent from the sender’s address (
From
).
- Number of transactions sent from the sender’s address (
- Txn Fee:
0.000000000044744704 PEAQ
- The transaction fee paid for processing this transaction on the blockchain.
- Input Data:
set
_data
10
- Information about the function call executed.
Summary
Verifying the status of transactions from deployed smart contracts is an essential step in ensuring that your operations are successfully recorded on the blockchain. By using Subscan Explorer, you can confirm the deployment of your smart contract, track its interactions, and validate the success of each transaction. The detailed transaction overview, including the status, transaction hash, gas fees, and input data, provides transparency and accountability for your on-chain activities.