Skip to main content

Subscan

Introduction

A Substrate ecological explorer that not only allows ordinary users to view WASM smart contract and transaction detail but also provides developers with WASM smart contract verification and read/call capabilities.

Prerequisites

Getting started

View WASM Transactions and Detail

Visit Transactions under the WASM category in Subscan navbar.

transactions

Click on the link in list item to view transaction Detail.

transaction_detail

View WASM Smart Contracts and Detail

Visit Transactions under WASM category in Subscan navbar.

contracts

Click on the link in the list item to view contract detail.

contract_detail

Verify WASM Smart Contract

Visit WASM Contract Verification Tool under Tools category in Subscan navbar or Contract tab in contract detail to verify WASM smart contract

contract_verify

As the tip section says, we provide docker images for developers to compile contract. This ensures that Subscan is consistent with the contract deployer compilation environment.

After compiling contract in docker, you need to fill in the Contract Verification form and submit Code and Cargo file from docker. The contract verification process will run in the background and may take 5 to 10 minutes. Once it's done, you'll see contract abi and source code in contract detail, and you can read/call the contract as you like now.

verified_contract

Read/Call WASM Smart Contract

Visit Contract tab in contract detail. Please note that read/call features only apply to verified WASM smart contract, and you need to connect to Polkadot{.js} extension before calling contract.

read_call

Troubleshooting

I've submitted the contract verification form, but the contract is still not verified

It happens mainly in two situations:

  1. The verifying process is still undergoing. Just wait for 5 to 10 minutes and check again
  2. Verification failed. In this case, you'll see Last Compiled Code Hash as follows. Please check the parameters and confirm using the above docker image for compilation.

failed

Learn more

Contracts API Docs by Subscan