Build on Valdium Testnet · v1.10 · all tests passing
Estimated read time: 10 minutes

Deploy Your First Contract

Prerequisites

You need a funded wallet and the Valdium CLI installed. See Quickstart for setup. Get test VLD from the faucet.

Write your contract

Valdium smart contracts are plain JavaScript files. Create a file called counter.js:

// counter.js — a simple on-chain counter ({ init(args) { storage.set('count', '0'); storage.set('owner', msg.sender); }, increment() { const current = BigInt(storage.get('count') || '0'); storage.set('count', String(current + 1n)); emit('Incremented', { count: String(current + 1n), by: msg.sender }); }, getCount() { return storage.get('count') || '0'; }, });

Deploy it

valdium deploy counter.js --from alice --args '{}'

You'll see output like:

✓ Deployed at 0x9f3a...b21c (block #14,127, gas: 42,000)

Call your contract

# Read the current count (free — no gas) valdium call 0x9f3a...b21c getCount # Increment (writes state — costs gas) valdium call 0x9f3a...b21c increment --from alice

Inspect on the explorer

Open testnet.valdium.xyz and paste your contract address. You'll see the deployed JavaScript source code, all transactions, and all emitted events.

Valdium contract source code is stored on-chain by default. Anyone can read what your contract does — verification-by-hash is the whole trust story. If you want logic obscured, this chain is not for you.

Contract lifecycle

Contracts on Valdium are immutable after deployment. There is no selfdestruct. If you need upgradeability, use a proxy pattern or deploy new versions and migrate state. The immutability is a feature — audited code stays audited.