WAXPBLOCKCHAIN WIKI
Deployment guide

Deploy smart contracts on WAX

Deployment changes the code or interface attached to an on-chain account. A safe release is a controlled authority operation with reproducible artifacts, test evidence and a verified target.

Updated 29 November 2026 · Independent guide

In plain English A smart contract is a program that runs on WAX. Builders can test it on the practice network first. Start collecting · Browse collections

WASM and ABI must describe the same contract

WAX contracts are commonly compiled from C++ with WAX-CDT into WebAssembly. The WASM contains executable logic. The ABI describes actions, tables and data structures so clients and command-line tools can serialise requests and interpret results.

A stale ABI can make a correct contract look broken, and a new ABI paired with old code can mislead applications. Clean builds should produce both artifacts from the reviewed source and pinned toolchain. Record cryptographic hashes for the release and retain the exact source revision.

Reproducibility matters

If another trusted builder cannot recreate the intended WASM from the tagged source and documented toolchain, reviewers cannot reliably know what is being deployed.

Verify the target account and environment

Every deployed contract belongs to a WAX account. Confirm the exact account, chain ID, RPC endpoint and existing code hash before signing. A successful deployment to the wrong test account is still the wrong deployment; a mainnet command pointed at testnet does not update production.

The account needs enough RAM for code, ABI and contract state. Future table growth can be much larger than the initial deployment. Define who pays RAM for each action and monitor it as part of operations.

Use a purpose-named contract account rather than a personal holding account. Publish the account so users can recognise it in signing requests, explorers and API queries.

Deployment authority is upgrade authority

The permission that can set contract code can change future behaviour. Protect it more strongly than a routine application signer. Separate owner recovery, deployment and automation where the account permission model allows it, and use threshold or multi-party approval for high-impact production systems.

Contracts that call actions inline may require code permission, often represented by the account’s code authority. Granting broad code authority is powerful: review why it is required and test it on a non-production account. External bots should receive custom permissions linked only to the actions they need, not a copied active private key.

Document whether the contract is upgradeable, who can upgrade it and how users will be notified. “Decentralised” branding is not a substitute for an inspectable permission structure.

A controlled release process

  1. Freeze and review the source revision.
  2. Build WASM and ABI in a clean, pinned environment.
  3. Run automated unit and integration tests.
  4. Deploy the exact artifacts to testnet.
  5. Exercise permissions, resources, boundary values and failure cases.
  6. Record target account, chain ID, current code hash and proposed hashes.
  7. Obtain required deployment approvals.
  8. Deploy, then read back the code hash and ABI.
  9. Run low-risk smoke tests and monitor errors, RAM and endpoints.

For upgrades, include state migration and backward-compatibility checks. Changing a table layout without a migration plan can strand existing rows even if compilation succeeds.

Typical failure modes

  • Wrong authority: the signer lacks the permission required to set code or ABI.
  • Artifact mismatch: WASM and ABI came from different builds.
  • Wrong target: account or environment configuration points elsewhere.
  • Insufficient RAM: the account cannot store code, ABI or new state.
  • Toolchain drift: local and CI builds use incompatible compiler versions.
  • Endpoint masking: a stale or misconfigured provider hides the actual chain result.
  • Unsafe upgrade: new code expects state that the existing tables do not contain.

Read the on-chain error and current target state before repeating a deployment. A retry with different artifacts makes diagnosis harder and can accidentally replace a known build with an unreviewed one.

Primary sources