Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.71 KB

File metadata and controls

50 lines (34 loc) · 1.71 KB

Deploying

Compile and deploy the example QRC20 to the QVM.

1. Compile

The QVM is Solidity-compatible. Compile with Qdock.io or solc to produce QVM bytecode:

# example with solc — output a .bin artifact
solc --bin --optimize -o build contracts/ExampleQRC20.sol

Point COMPILED_BYTECODE_PATH in ../.env at the resulting .bin file (default ./build/ExampleQRC20.bin).

2. Fund a deployer

Set QUANTOVA_DEPLOYER_KEY in .env to a testnet key funded from the faucet. Never commit a real key — .env is gitignored.

3. Deploy

npm run deploy:testnet

../scripts/deploy.js will:

  1. Build a deployment transaction with to = null and your compiled bytecode (append ABI-encoded constructor args if your contract takes them).
  2. Estimate gas with q_estimateGas and read the chain id.
  3. Sign locally with the @quantova SDK keyring (post-quantum key).
  4. Broadcast with q_sendRawTransaction and wait for the receipt, which contains the new contract address.

For safety the template stops before broadcasting until you wire in the real signed payload, so a misconfigured key cannot accidentally spend. The script prints the prepared transaction and the next step.

4. Confirm

Treat the deployment as settled only after finality (~3s). Verify the deployed bytecode with q_getCode against your compiled artifact.

Mainnet

When mainnet launches, set QUANTOVA_NETWORK=mainnet and the published endpoints; nothing else in your code changes. Use keys held in secure custody for production deployments — see the dev-checklist repository's pre-deployment and mainnet-readiness gates.