Web3 Forms

Web3 Forms turn web3:// links into interactive contract forms. They support read-only calls, state-changing transactions, and typed inputs with validation. Embed a web3 form in Markdown by using a web3:// URI as an image source. The text after the image becomes the form title. Use labels=(...) to name each field.

![Title](web3://...)

Examples

Read Contract State

Read-only calls are the default (mode=call). No wallet signature is required.

Markdown:

![USDC Balance](web3://0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48:1/balanceOf/address!0x?returns=(uint256)&labels=(Account)&decimals=(,6))

Result:


Send Transactions

Set mode=tx to create a transaction.

Markdown:

![Send USDC](web3://0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48:1/transfer/address!0x/uint256!1000000?labels=(Recipient,Amount)&mode=tx&decimals=(,6))

Result:

Payable Transactions

Add a value and mark the call as payable. Use this only with payable methods.

Markdown:

![Wrap ETH](web3://0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2:1/deposit?value=0.01eth&payable=true&mode=tx)

Result:


URI Format

web3://<contract>[:chainId]/<method>[/<type>!<value>...]?[query]

Fields

  • contract: Ethereum address or ENS-style domain name of the target contract.
  • chainId (optional): Require a specific network (for example, :11155111 for Sepolia).
  • method: Contract function name.
  • type!value arguments: Each argument declares its Solidity type and a value or placeholder. Use type!0x for an empty field.

Query Parameters

  • returns=(uint256)
    • The Solidity return type for read-only calls. Use returns=() for void. Only used when mode=call.
  • value=0.01eth
    • Adds an ETH value input field. Use value=<amount> for a default. Accepts eth or raw wei.
  • payable=true
    • Marks the call as payable and shows the value input field (value defaults to 0 if omitted).
  • mode=tx
    • Forces a state-changing transaction. Default is mode=call (read-only).
  • labels=(Account,Amount)
    • Names each input field. The label count must match the number of arguments.
  • decimals=(,6)
    • Scales numeric inputs and the return value. The list is positional.
    • Use empty slots for arguments that are not scaled.
    • If a return value exists, add one extra slot at the end for the return.
    • Example (two args + one return): decimals=(,6,18)

< Prev (Using the Editor)Next (Advanced Navigation) >