MaxDelegateDependencies

Constant v334 → current u32

Limits how many different codes a contract can delegate to.

Current Value

32
Relevant for: developers

The Big Picture

Contracts using delegate calls can depend on multiple code hashes. This limit prevents excessively complex dependency graphs that would be hard to manage.

From Chain Metadata

The maximum number of delegate_dependencies that a contract can lock with [`chain_extension::Ext::lock_delegate_dependency`].

Use Cases

  • Plan contract architecture with libraries
  • Understand delegate call limits

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query MaxDelegateDependencies constant
const value = api.consts[stringCamelCase("Contracts")][stringCamelCase("MaxDelegateDependencies")];
console.log("MaxDelegateDependencies:", value.toHuman());

Type Information

Type
u32
Byte Size
4 bytes
Encoding
fixed
Raw Hex
0x20000000

Runtime Info

Pallet
Contracts
First Version
v334
Latest Version
v334
Current Runtime
v393