DepositPerByte

Constant v334 → current u64

Economic mechanism to prevent unbounded state growth.

Current Value

0.00000003 TAO (30 raw)

Conversion: ÷ 10^9 (RAO → TAO)

Relevant for: developers

The Big Picture

Storage isn't free. Every byte of code or contract storage requires a deposit. This constant sets the rate: total_deposit = bytes * DepositPerByte. Larger contracts cost more to deploy.

From Chain Metadata

The amount of balance a caller has to pay for each byte of storage. # Note Changing this value for an existing chain might need a storage migration.

Use Cases

  • Calculate storage costs for contracts
  • Estimate deployment deposits
  • Plan contract economics

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query DepositPerByte constant
const value = await api.constants.Contracts.DepositPerByte();
console.log("DepositPerByte:", value);
// Balance: divide by 10^9 for TAO
const tao = value / 1_000_000_000n;

Type Information

Type
u64
Byte Size
8 bytes
Encoding
fixed
Raw Hex
0x1e00000000000000

Runtime Info

Pallet
Contracts
First Version
v334
Latest Version
v334
Current Runtime
v411