Skip to content
ReferenceTestnet: see pageMainnet: Not availableSoftware: Core bad4a06ea · protocol pqwerai-v8-testnet/1Updated

WASM smart contracts

Build a fixed-supply ERC-20 with the complete C++ and C# token examples, alongside the five EVM versions.

PQWERAI supports WebAssembly contracts alongside EVM contracts. Contract Studio builds C++ and a defined C# subset into modules for WASM VM v1 (wasm-vm/v1). They use the same accounts, tPQAI balances, contract storage, transactions, receipts and Solidity ABI as EVM contracts.

WASM VM v1 is an official required Core feature. The public chain 20778 profile enables it from block 0. Use Check connected chain in Studio to confirm the connected node supports it before deploying. Connect through the public testnet RPC or your own compatible node. Feature support and local tests do not establish public release acceptance.

Start building

  1. Follow Your first WASM contract to compile, simulate, deploy and call a counter.
  2. Choose the C++ guide or C# guide for compiler setup and language limits.
  3. Use ABI, storage and host functions when adding arguments, events or contract calls.
  4. Follow Deployment and verification to understand artifacts, module identity and errors.

Which languages run where?

Source language Output Current authoring path
Solidity, Vyper, Yul, Huff, Fe EVM bytecode EVM language center; Fe remains tied to its pre-1.0 compiler pin
C++ WebAssembly Studio, clang from wasi-sdk 34, freestanding SDK header
C# WebAssembly Studio, Roslyn followed by the wallet's IL-to-WASM translator
C, Rust, Go, AssemblyScript and other WASM targets No supported Studio adapter in this source revision A generic .wasm file is not enough; a compatible adapter, ABI, imports and validation are required
JavaScript, TypeScript, Python Application code outside the node Application languages build and submit transactions

C# contracts do not load the .NET runtime on validators. Using wasi-sdk to compile C++ does not provide WASI services: the contract imports the pqwerai host interface, with no filesystem or network access.

Execution model

The node validates modules at deployment and meters execution. The supported profile uses integer operations, bounded memory and approved host imports; floating point, SIMD, threads and foreign imports are rejected. The VM memory cap is 16 MiB; Studio's C++ adapter currently chooses a smaller fixed 128 KiB memory.

Contract memory is fresh on each invocation. Store persistent values through the storage host functions. EVM and WASM contracts can call each other through the same ABI. Cross-contract calls still require access control, reentrancy protection, return-value checking and gas limits.

The guides describe the checked-in Studio implementation. Historical VM and language-conformance runs are separate from verification of these tutorial files; see the verification limits.


Sources at 83ff5b69f0 (project repository, not public yet): architecture/MULTILANGUAGE_CONTRACTS.md · testnet/release/network/network.json · apps/pqwerai-wallet-windows/docs/STUDIO_DEVELOPER_GUIDE.md · apps/pqwerai-wallet-windows/src/PqwerAI.Wallet.Core/Studio/Toolchains.cs

Found a problem? Report a documentation issue · Build testnet-20778+83ff5b69f0