How to Decode Solana Smart Contract Calls on Solscan: A Guide for Auditors

A security auditor reviewing a Solana transaction has a straightforward challenge: the blockchain records the function call, but understanding what actually happened requires reading past the instruction data. A wallet address initiated an action, a program received the call, and the transaction succeeded or failed—but the encoded parameters, account roles, and state changes are not visible at first glance. The official blockchain explorer for Solana, solscan, displays this information, yet interpreting it accurately demands familiarity with Solana’s transaction structure, instruction layout, and how smart contracts parse their inputs.

An auditor’s job is to trace function execution, verify that the correct accounts were accessed, confirm that lamports or tokens moved as intended, and identify whether unexpected state changes occurred. Solscan provides the raw data and increasingly sophisticated decoding tools, but the platform cannot replace understanding the contract’s design. This guide covers how to navigate Solscan’s smart contract verification features, interpret instruction calls, map accounts to their roles, read program-derived addresses, and spot the patterns that indicate normal behavior versus potential vulnerabilities.

Solscan transaction detail view showing decoded instruction data with account references and program interaction flow

Understanding Solana transaction structure and Solscan’s role

A Solana transaction is fundamentally a list of instructions, each pointing to a program and specifying accounts and data. Unlike Ethereum, where contract execution is sequential and linear, Solana’s model allows parallel instruction execution within the same transaction. Each instruction contains the program’s public key, the accounts it will access, and the encoded data passed to that program. The transaction signature proves that a fee payer authorized the transaction, but it does not prove that every instruction was intended—only that the overall transaction was.

Solscan’s role in this structure is to fetch the transaction from the blockchain, decode the instruction data using available contract metadata, and present it in human-readable form. When a contract is verified on Solscan, the platform stores the contract’s IDL (Interface Description Language) or ABI equivalent. This metadata describes what functions the program has, what parameters each function accepts, and how the data should be interpreted. Without verification, Solscan can show the raw instruction data as base64 or hexadecimal, but it cannot tell an auditor what the bytes mean.

The decoding process is therefore conditional on two things: first, that the contract has been verified and its metadata is available; second, that Solscan’s decoder correctly interprets that metadata against the actual instruction data. Neither is guaranteed. A verified contract may have been deployed incorrectly, updated after verification, or verified with incomplete or incorrect IDL. An auditor should never assume that Solscan’s decoded view is authoritative. Instead, treat it as a starting point and cross-reference with the actual contract code, the account state before and after the transaction, and any on-chain logs or program output.

The Solana blockchain data itself is immutable and cryptographically bound. Solscan queries this data accurately, but the interpretation layer depends on external metadata. Understanding this distinction is critical: the raw transaction bytes are truth; the decoded view is a convenience that can be wrong.

How to locate and verify smart contract information on Solscan

To begin auditing a transaction, start by identifying the program being called. Open the transaction on Solscan, scroll to the “Instructions” section, and note the program address for the instruction in question. Click on that program address to view its detail page. This page displays the program’s deployment history, verification status, and any available metadata. If the contract is verified, you will see a “Contract” tab or section showing the IDL, function signatures, and available documentation.

Verification on Solscan requires uploading the source code or IDL. The platform compares the uploaded code against the deployed bytecode to confirm they match. A green checkmark indicates verification succeeded; a warning or absence indicates the contract is unverified or the verification failed. Unverified contracts are not necessarily malicious, but they require manual inspection. An auditor may need to decompile the bytecode, review the source code from GitHub, or contact the developer to confirm what the program actually does.

The smart contract verification process also provides a trust signal: if a widely-used program like Marinade Finance or Magic Eden has a verified contract on Solscan, you can view its functions directly. If a smaller or newer program lacks verification, you have three options: search for the source code externally, assume the contract is high-risk and avoid it, or use tools like Anchor Framework’s IDL extraction to reverse-engineer the interface. None of these options is seamless, which is why verification status matters for due diligence.

Once verification is confirmed, examine the function list. Each function should have a name, parameter types, and account requirements. For example, a “transfer” function might require the token account, the destination token account, the token owner, and the system program. Solscan’s smart contract verification tools often display this information in a structured format. Cross-reference this list against the actual transaction you are auditing to ensure that all required accounts are present and in the correct order.

Decoding instruction data and identifying account roles

When you view a transaction’s instructions on Solscan, each instruction is broken down into three components: the program being called, the accounts being accessed, and the instruction data (the function call parameters). The instruction data is typically shown as base64 or hex; Solscan will decode it if the contract is verified. The decoded output shows the function name and the parsed parameters.

The accounts section is where auditors must be most careful. Solana’s accounts carry roles: some are signers, some are writable, some are read-only, and some are system accounts. The order of accounts matters. If a contract expects the owner account first and the delegate account second, but the transaction provides them in reverse order, the program will either reject the instruction or execute it incorrectly. Solscan displays account order and writable status, but decoding that into intent requires reading the contract code or understanding common patterns.

A common pattern in SPL token operations is: token account, mint, owner/authority, optional additional accounts. If you see an instruction with accounts labeled “account”, “account”, “signer”, “program”, cross-referencing with a known token program address tells you what each account represents. Solscan’s explorer often labels accounts with their type (e.g., “Token Program”, “Associated Token Account”), but this labeling depends on the account’s state and the explorer’s heuristics. Always verify by examining the account’s data directly.

For auditing purposes, create a checklist: Does the instruction call the expected program? Are all required accounts present? Are they in the correct order? Are write permissions set correctly (writeable accounts should be those that are actually modified, not read-only accounts)? Are the instruction parameters reasonable given the contract’s documented function? If any answer is “no” or “unclear”, investigate further before assuming the transaction is valid.

Reading program logs and state changes

Solana programs emit logs during execution, and Solscan displays these in the transaction details. Logs serve multiple purposes: they signal successful execution steps, they record state changes, and they can reveal errors. A program written in Anchor Framework (the most common Solana development framework) typically logs the function name and key state transitions. For example, a swap program might log “Swapping 1000000 token A for 500000 token B” or “Insufficient liquidity for this trade”.

Reading logs requires understanding what the program intended to output. Some programs are verbose; others are minimal. If a transaction shows “Program success” but no logs, the program may not emit logs, or logging may have been disabled in production. A “Program failed” message, conversely, indicates the instruction reverted. Solscan typically shows the error code or reason; common reasons include “Instruction failed due to invalid account” or “Custom program error: 0x001”.

To map error codes to their meaning, you need the contract’s source code or its error documentation. Anchor Framework programs document their error enums in the code; if the contract is open-source, searching the repository for the error code often reveals the underlying issue. If not, the error code is often a hint: custom errors in Anchor are typically 6000 + an offset, so error 6001 might correspond to the first custom error defined.

Beyond logs, examine the account state before and after the transaction. Solscan’s account view shows balances and other on-chain data. If a transfer instruction executed successfully, the sender’s token account balance should decrease and the receiver’s should increase. If they do not, the transfer did not happen as expected—a major red flag. Check the token account’s frozen status, the authority relationships, and whether the instruction modified the account you thought it would modify.

Navigating complex multi-instruction transactions

A single Solana transaction can contain dozens of instructions, each calling a different program. A complex DeFi transaction might flash-loan tokens, swap them, stake them, and repay the loan, all in one atomic operation. Auditing this requires tracing each instruction in order, understanding how the output of one instruction feeds into the next, and verifying that the transaction’s net effect is what the user intended.

Solscan displays instructions sequentially. Start from the first instruction and verify its preconditions: do the input accounts exist? Is their state what you expect? Then move to the second instruction, checking whether it uses outputs from the first. For example, if instruction 1 mints new tokens into account A, instruction 2 should use account A as a source. If instruction 2 instead uses a different account, the two instructions are not linked in the way the transaction author intended.

A useful technique is to maintain a state table as you step through the instructions. For each significant account, note its balance or state before the transaction, after each instruction, and at the end. If a balance changes unexpectedly, mark the instruction that caused the change. If an instruction fails, Solana rolls back all its state changes but continues executing subsequent instructions—so a failed instruction may leave a transaction partially executed. Solscan shows the status of each instruction; check whether later instructions depend on an earlier instruction that failed.

For highly complex transactions, consider using Solscan’s API to retrieve the full transaction data programmatically. The developer tools and API access allow auditors to write scripts that parse instructions, fetch account data, and generate audit reports. This approach scales better than manual inspection and reduces the chance of missing an instruction or misinterpreting account roles.

Identifying red flags and anomalies in contract interactions

Certain patterns on Solscan warrant immediate suspicion. First, unexpected program calls: if a swap should only call a DEX program, why is a token mint program being invoked? Second, account permissions inconsistency: an instruction modifies an account marked as read-only, or vice versa. Third, missing required accounts: the contract should need a system program or clock sysvar, but the instruction list omits it. Fourth, reversed account order: if you have audited similar transactions and account order changes without explanation.

Another red flag is an instruction that changes an account authority or ownership without clear justification. If a transfer instruction also changes the account’s owner, the contract is doing more than a simple transfer—a potentially dangerous operation. Similarly, if an instruction mints or burns tokens, verify that the mint authority is the contract itself or an expected trusted party, not an arbitrary external program.

Token account freezes are another pattern to watch. SPL token accounts can be frozen by their mint authority, preventing transfers. If a transaction attempts to transfer from a frozen account, it will fail. Solscan shows account state; check the “frozen” field. If a prior instruction froze the account and a subsequent instruction tries to transfer, the transaction will revert or the later instruction will fail.

Finally, pay attention to the fee structure. Solana transactions have a base fee and additional costs for accounts accessed or rent-exempt data created. If a transaction’s fee is unusually high, something beyond the usual operations is occurring—possibly excessive account allocation or repeated failed instruction attempts. Solscan displays the total transaction fee; if it seems disproportionate to the operation’s complexity, investigate further.

Using Solscan’s developer tools and API for deeper auditing

Beyond the visual explorer, Solscan offers developer tools including API endpoints for fetching transaction details, account data, and parsed instruction logs. An auditor with programming experience can build custom queries to filter transactions by program, analyze patterns, or detect suspicious activity at scale. The API documentation is available on Solscan’s developer portal and includes endpoints for transactions, accounts, tokens, and blocks.

For contract verification, developers can submit source code or IDL files directly through Solscan’s interface. An auditor who has obtained updated or corrected contract code can re-verify a program to ensure Solscan displays the latest version. This is particularly useful if a contract was upgraded and you need to verify that the new version’s behavior matches the on-chain instructions.

The block and epoch monitoring features also provide context for transaction timing. If you are investigating a front-running attack or a MEV sandwich attack, knowing the exact slot (Solana’s equivalent to Ethereum’s block) and the transaction’s position within it can reveal whether the transaction was deliberately placed. Solscan shows this information, though additional tools like Helius or Magic Eden’s data endpoints may provide richer MEV analysis.

For long-term audits or compliance investigations, Solscan’s data export and integration capabilities can be valuable. Some auditors download transaction history in bulk and analyze it offline using Python or similar tools. Solscan’s data is public and can be queried repeatedly; this makes historical auditing feasible for protocols that have been running for years.

Best practices for auditors using Solscan

First, always cross-reference Solscan’s decoded data with the actual contract source code. The platform is accurate, but it is not authoritative—human error in verification, incomplete metadata, or a mismatch between verified code and deployed code can introduce inconsistencies. Second, maintain a checklist for every transaction you audit: program address, required accounts, parameter values, expected state changes, actual state changes, and any anomalies. This prevents oversights and creates an auditable trail.

Third, test your understanding on known-good transactions before auditing suspicious ones. If you understand how a Marinade Finance staking transaction looks on Solscan, you have a reference point for comparing against a similar transaction from an unknown protocol. Fourth, use Solscan’s block explorer to examine the accounts themselves. Viewing the source code on GitHub, confirming the program’s authority, and understanding its upgrade policy all inform your interpretation of individual transactions.

Fifth, document edge cases and unexpected patterns. If a transaction fails with an error code you have not seen before, research it and record the finding. If an instruction takes an unusual number of accounts or uses account roles in an unexpected way, note it and check whether it matches the contract’s documentation. Over time, you will develop intuition for what normal Solana activity looks like, making anomalies easier to spot.

Finally, stay current with Solana ecosystem developments. New programs, upgraded standards, and evolving best practices change what “normal” means. Following Solana development forums, reading contract audits from reputable firms, and periodically reviewing updated contracts on Solscan all contribute to maintaining your audit skills and knowledge.

Frequently asked questions

What does it mean if a contract is unverified on Solscan?

An unverified contract is one whose source code or IDL has not been submitted to Solscan for verification against the deployed bytecode. Unverified contracts are not inherently malicious, but they require additional research. You may need to obtain the source code from GitHub, contact the developer, or use decompilation tools. Solscan will still show the transaction data, but it will not decode instruction parameters without the contract metadata.

How do I determine what each account in an instruction represents?

Start by checking the verified contract’s IDL or documentation on Solscan—it should list account requirements in order. If the contract is unverified, examine the contract source code or similar transactions from the same program. Cross-reference account addresses against known token mints, system programs, or program authorities. Solscan often labels common accounts by type; use this as a starting point but verify by examining account data directly.

How can I audit a transaction across multiple smart contract calls?

Step through each instruction in order on Solscan, verifying that the program called is expected, the accounts provided match the contract’s requirements, and the instruction data parameters are reasonable. Track account balances or state before and after each instruction. If one instruction fails, check whether subsequent instructions depend on it. Use Solscan’s API if you need to automate this analysis across many transactions.