Web3Raider
← Back to Blockchain

Guides

Smart contracts

What smart contracts are, how to read them on block explorers, and how they connect to game assets and collections on Web3Raider.

Introduction

A smart contract is a program stored on a blockchain. It has an address, holds state (balances, owners, settings), and runs functions when someone sends a transaction. In Web3 games, smart contracts usually govern who owns which assets, how minting works, and sometimes reward or marketplace rules—not the full game loop (matchmaking, combat, graphics).

You do not need to read contract code to enjoy a blockchain game. But knowing what a contract is, which chain it lives on, and how to spot official addresses helps you avoid scams and understand what you actually control in your wallet.

For token standards (ERC-721, ERC-1155) and metadata, see our companion guide: NFTs.

Smart contracts in Web3 gaming — program on blockchain powering game assets

What a smart contract actually is

On Ethereum-compatible chains, a smart contract is a special kind of account:

  • It has an address (starts with 0x…) like your wallet.
  • It is not controlled by a private key in the usual sense—it runs deterministic code when conditions are met.
  • Anyone can read public data; only authorized callers can change state (transfer tokens, mint, pause, etc.).

A useful analogy from Ethereum.org: a vending machine. You put in the right input (payment + selection); the machine’s programmed logic releases the output (snack). No cashier needed—the rules are in the machine.

In gaming:

Contract role

Typical functions

Player-facing effect

NFT collection

mint, transfer, ownerOf, tokenURI

Own cards, avatars, land
Fungible token (ERC-20)

transfer, balanceOf, approve

Earn or trade in-game currency on-chain

Marketplacelist, buy, royaltiesTrade assets with other players
Staking / rewardsstake, claim, distribute

Claim seasonal or tournament payouts

Note: Deploying or upgrading contracts costs gas. Game studios often use Layer 2 networks (Base, Immutable zkEVM, Polygon) so everyday mints and transfers stay affordable.

On-chain vs off-chain in Web3 games

Almost no popular blockchain game runs 100% on-chain. Real-time combat, matchmaking, and anti-cheat need fast off-chain servers. The chain records ownership and economic rules; the studio’s servers run gameplay.

On-chain

Smart contract state + transaction history

Who owns token #42, mint events, approvals

Off-chain

Game servers, APIs, metadata hosting, match results

Ladder rank, deck validation in a match, card art JSON on IPFS or CDN

Bridge

Wallet signatures, oracles, studio mint APIs

“Claim reward” sends a transaction; server credits your account after confirmation

Why it matters: Losing access to a game server can lock gameplay, but NFT ownership on the correct contract usually remains in your wallet. Conversely, a free in-game skin with no on-chain token is not a blockchain asset—you cannot send it to another wallet.

Hybrid Web3 game: off-chain gameplay servers and on-chain smart contracts for assets

Contract address and chain

Every deployed contract has a unique address on one network. The same project on Ethereum mainnet and on Base uses different addresses—always confirm chain + address together.

FieldWhat to check
Address

42-character hex string, e.g. 0x3b60…9395

Chain

Ethereum, Base, Immutable zkEVM, Polygon, etc.—must match your wallet network

Source

Official game site, docs, or Web3Raider collection page—not random Discord DMs

Browse supported networks on /blockchain. Many titles in our catalog use Immutable for gas-efficient NFT minting and trading, while legacy collections may sit on Ethereum L1.

In our catalog: Gods Unchained Cards on Immutable include a documented contractAddress for indexer-backed asset views. Parallel Alpha Cards are documented as ERC-1155 on Ethereum—always open the collection page for the current chain and links.

Reading a contract on a block explorer

Explorers (Etherscan, Immutable Explorer, Basescan, Polygonscan) let you inspect contracts without trusting a screenshot.

Step by step

  1. Copy the official contract address from the game or Web3Raider collection page.
  2. Open the explorer for the correct chain and paste the address.
  3. Check Contract tab:
    • Verified source code → public, auditable logic (preferred).
    • Unverified → you see bytecode only; extra caution.
  4. Use Read Contract to query public state (no wallet needed): name, symbol, totalSupply, ownerOf, balanceOf, tokenURI.
  5. Write Contract sends transactions—requires a connected wallet and gas.
Block explorer Read Contract tab showing public NFT contract functions

Proxy and upgradeable contracts

Studios sometimes deploy a proxy at a fixed address that delegates logic to an implementation contract they can upgrade later. Players still interact with the proxy address; the explorer may show Read as Proxy / Write as Proxy after verification (Etherscan proxy guide).

Implications for players:

  • The address you bookmark can stay the same while logic behind it changes.
  • Trust the team and audits, not just a green “verified” badge—verify implementation upgrades on official channels.

Token standards you will see

Smart contracts implement standards so wallets and marketplaces speak the same language:

Standard

What it represents

Gaming examples

ERC-721

One owner per token ID

Unique avatars, 1/1 items — see NFTs guide

ERC-1155

Many token IDs; balance per ID

TCG card sets, stackable items — see NFTs guide

ERC-20

Fungible tokens (divisible balances)

Reward tokens, governance, in-game currencies traded on DEXs

One game franchise often uses multiple contracts: e.g. ERC-1155 card collections plus ERC-721 avatars plus a separate ERC-20 reward token—each with its own address.

Transactions, gas, and approvals

Transactions

When you mint, transfer, or claim, your wallet signs a transaction. Miners or sequencers include it in a block; the contract updates state. Transactions are irversible once confirmed—there is no “undo” button on-chain.

Gas is the fee paid in the network’s native token (ETH on Ethereum, ETH on Base, IMX on Immutable where applicable, etc.). Failed transactions can still consume gas. Layer 2s and gaming-focused chains reduce cost for frequent actions.

Approvals (critical for safety)

Before a marketplace or third-party contract can move your tokens, you usually grant an approval:

Mechanism

Scope

Common use

approve(spender, tokenId)

One NFT (ERC-721)Single listing

setApprovalForAll(operator, true)

All your NFTs in that contract

Marketplace convenience

approve(spender, amount)

ERC-20 allowanceSwaps, staking

setApprovalForAll is powerful: if you approve a malicious operator, every NFT in that collection can be taken. Phishing sites often trick users into signing broad approvals or opaque permit messages.

Best practices:

  • Approve only known marketplaces linked from official game sites or Web3Raider.
  • Prefer per-token approvals when the UI allows it.
  • Revoke unused approvals periodically (wallet security tools or explorer token approval pages).
  • Read what your wallet shows before signing—especially EIP-712 typed data for listings and mints.

Note: Newer standards (e.g. EIP-6464 for finer-grained ERC-721 operators) aim to reduce reliance on blanket setApprovalForAll. Until widely adopted, treat broad approvals as high risk.

Oracles and off-chain data (brief)

Contracts cannot natively fetch arbitrary websites or API scores—they need oracles to bring off-chain data on-chain (Ethereum.org — oracles). In games, oracles or trusted studio servers may feed tournament results, randomness, or price feeds for reward calculations.

As a player, assume gameplay outcomes are validated off-chain unless the project publishes trustless on-chain logic. Ownership of the resulting minted token, however, is still enforced by the contract once issued.

How to use this guide on Web3Raider

  1. Open /nft or a game page and find Collections with chain and contract details.
  2. Use the official explorer link (when provided) to verify the address matches the studio’s docs.
  3. Read NFTs to interpret token IDs, supply, and metadata for that contract.
  4. Check /blockchain for which network your wallet must use before buying or transferring.

When contractAddress and indexer chain are configured, collection pages can load live asset grids (e.g. Immutable-indexed sets). Other collections still show catalog metadata and marketplace links while on-chain listing expands.

Web3Raider flow from game or NFT catalog to contract address and block explorer

Red flags and scams

Unverified contract + “mint now” link

No audit trail; drainer contracts are common in fake airdrops.

Address mismatch

Discord or X link points to a different contract than the official website.

Wrong chain

Wallet on Ethereum while the real collection is on Base or Immutable.

Unlimited approval to unknown spender

Revoke immediately if you signed by mistake; move remaining assets if compromised.

When in doubt, cross-check two official sources (game website + our collection page) before connecting a wallet.

Further reading


Last updated: May 2026. Contract addresses, chains, and explorer features change; verify critical details on official project documentation.