Ensures some deposit remains while instances exist.
Current Value
0x00a3e111Relevant for: developers
The Big Picture
When a contract instance exists, part of the code deposit is locked. This prevents removing code while instances still need it. The percentage determines how much stays locked.
From Chain Metadata
The percentage of the storage deposit that should be held for using a code hash. Instantiating a contract, or calling [`chain_extension::Ext::lock_delegate_dependency`] protects the code from being removed. In order to prevent abuse these actions are protected with a percentage of the code deposit.
Use Cases
- Understand deposit lockup mechanics
- Plan code removal strategies
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 CodeHashLockupDepositPercent constant
const value = await api.constants.Contracts.CodeHashLockupDepositPercent();
console.log("CodeHashLockupDepositPercent:", value);Type Information
- Type
- Perbill
- Byte Size
- 4 bytes
- Encoding
- fixed
- Raw Hex
- 0x00a3e111
Runtime Info
- Pallet
- Contracts
- First Version
- v334
- Latest Version
- v334
- Current Runtime
- v411