instantiate_with_code_old_weight
Call v334 → current #1Legacy instantiate_with_code using old weight format (deprecated).
View calls on chainCall Workflow
This diagram shows the call execution flow: starting with instantiate_with_code_old_weight, passing through validation
(signature, nonce, mortality, fee payment), then pre-dispatch checks, followed by dispatch which emits events: Instantiated, CodeStored and modifies storage: PristineCode, CodeInfoOf, ContractInfoOf, Nonce, and finally post-dispatch where ExtrinsicSuccess is emitted and fees are settled.
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Click items to navigate. Pan and zoom to explore.
Used by: developers
The Big Picture
Legacy version of instantiate_with_code for backward compatibility. Use the current version for new development.
Use Cases
- Support old tools/libraries not updated to new weight format
- Backward compatibility during transition periods
From Chain Metadata
Deprecated version if [`Self::instantiate_with_code`] for use in an in-storage `Call`.
Input Parameters
| # | Name | Type | Description |
|---|---|---|---|
| 0 | value | Compact<u64> Cpt | Value in RAO (÷10⁹ for TAO) (RAO -> TAO (/ 10^9)) |
| 1 | gas_limit | Compact<u64> Cpt | gas_limit (Compact<u64>) (SCALE compact -> integer) |
| 2 | storage_deposit_limit | Option | storage_deposit_limit (Option) |
| 3 | code | Vec<u8> Vec | code (Vec<u8>) |
| 4 | data | Vec<u8> Vec | data (Vec<u8>) |
| 5 | salt | Vec<u8> Vec | salt (Vec<u8>) |
Permissions
Origin
Unknown
Required Role
Permission data inferred from metadata. May be incomplete.
Requirements
- Same as Contracts.instantiate_with_code
Effects
Events Emitted
Storage Modified
Postconditions
- Same as Contracts.instantiate_with_code
Side Effects
- Same as Contracts.instantiate_with_code
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 });
// Build instantiate_with_code_old_weight call
const value = 0;
const gas_limit = 0;
const storage_deposit_limit = 0 as any /* Option */;
const code = 0;
const data = 0;
const salt = 0;
const call = api.tx[stringCamelCase("Contracts")][stringCamelCase("instantiate_with_code_old_weight")](
value,
gas_limit,
storage_deposit_limit,
code,
data,
salt
);Runtime Info
- Pallet Index
- 29
- Call Index
- 1
- First Version
- v334
- Current Version
- v393