Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3a7dfa5
Update navigation and documentation for basic contract deployment
nhussein11 Oct 20, 2025
8ca8842
fix: llms
nhussein11 Oct 20, 2025
0eef625
Fix navigation entry for deploying a basic contract (PVM) in .nav.yml
nhussein11 Oct 21, 2025
c20f681
Update deployment guides for basic EVM and PVM contracts, specifying …
nhussein11 Oct 21, 2025
16aef31
Update smart-contracts/cookbook/smart-contracts/deploy-basic-pvm.md
nhussein11 Oct 21, 2025
37d8abe
Update smart-contracts/cookbook/smart-contracts/deploy-basic-pvm.md
nhussein11 Oct 21, 2025
b3bc379
Fix: adding reference to polkadot hub
nhussein11 Oct 21, 2025
999e78c
fix: llms
nhussein11 Oct 21, 2025
ed1cdf2
fix evm
0xlukem Oct 23, 2025
0ee669e
fix pvm
0xlukem Oct 23, 2025
3824734
fix
0xlukem Oct 23, 2025
6d7b21e
fresh llms
0xlukem Oct 23, 2025
766c77f
Update bytecode writing method in EVM deployment guide and remove TOD…
nhussein11 Oct 23, 2025
3b6ff77
hiding pvm content
0xlukem Oct 23, 2025
3aeef4c
add tabbed content
0xlukem Oct 23, 2025
cf2a44a
llms
0xlukem Oct 23, 2025
1feeaf6
Merge branch 'staging/product-ia' into nhussein11/add-deploy-basic-pvm
0xlukem Oct 23, 2025
fc18dc3
merge issue
0xlukem Oct 23, 2025
b0015d8
llms
0xlukem Oct 23, 2025
7c155d6
break deploy-basic-evm in small sections
0xlukem Oct 24, 2025
3a50c0f
fix naming
0xlukem Oct 24, 2025
31646b4
feedback
0xlukem Oct 29, 2025
34abe1b
fix
0xlukem Oct 30, 2025
6494346
Merge branch 'staging/product-ia' into nhussein11/add-deploy-basic-pvm
0xlukem Oct 30, 2025
ee94462
feedback
0xlukem Oct 30, 2025
c97c843
Apply suggestions from code review
0xlukem Oct 31, 2025
a468128
feedback
0xlukem Oct 31, 2025
98537a6
Merge branch 'staging/product-ia' into nhussein11/add-deploy-basic-pvm
0xlukem Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 8 additions & 89 deletions .ai/categories/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ First, you'll update the runtime's `Cargo.toml` file to include the Utility pall
1. Open the `runtime/Cargo.toml` file and locate the `[dependencies]` section. Add pallet-utility as one of the features for the `polkadot-sdk` dependency with the following line:

```toml hl_lines="4" title="runtime/Cargo.toml"
[dependencies]

...
polkadot-sdk = { workspace = true, features = [
"pallet-utility",
Expand All @@ -267,7 +267,7 @@ First, you'll update the runtime's `Cargo.toml` file to include the Utility pall
2. In the same `[dependencies]` section, add the custom pallet that you built from scratch with the following line:

```toml hl_lines="3" title="Cargo.toml"
[dependencies]

...
custom-pallet = { path = "../pallets/custom-pallet", default-features = false }
```
Expand Down Expand Up @@ -3274,23 +3274,7 @@ To create the ERC-20 contract, you can follow the steps below:
3. Now, paste the following ERC-20 contract code into the editor:

```solidity title="MyToken.sol"
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.22;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC20, Ownable {
constructor(address initialOwner)
ERC20("MyToken", "MTK")
Ownable(initialOwner)
{}

function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}

```

The key components of the code above are:
Expand Down Expand Up @@ -3608,26 +3592,7 @@ To create the NFT contract, you can follow the steps below:
3. Now, paste the following NFT contract code into the editor.

```solidity title="MyNFT.sol"
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.22;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC721, Ownable {
uint256 private _nextTokenId;

constructor(address initialOwner)
ERC721("MyToken", "MTK")
Ownable(initialOwner)
{}

function safeMint(address to) public onlyOwner {
uint256 tokenId = _nextTokenId++;
_safeMint(to, tokenId);
}
}

```

The key components of the code above are:
Expand Down Expand Up @@ -9254,8 +9219,7 @@ The [`XcmRouter`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pa
For instance, the Kusama network employs the [`ChildParachainRouter`](https://paritytech.github.io/polkadot-sdk/master/polkadot_runtime_common/xcm_sender/struct.ChildParachainRouter.html){target=\_blank}, which restricts routing to [Downward Message Passing (DMP)](https://wiki.polkadot.com/learn/learn-xcm-transport/#dmp-downward-message-passing){target=\_blank} from the relay chain to parachains, ensuring secure and controlled communication.

```rust
pub type PriceForChildParachainDelivery =
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, Dmp>;

```

For more details about XCM transport protocols, see the [XCM Channels](/develop/interoperability/xcm-channels/){target=\_blank} page.
Expand Down Expand Up @@ -10381,27 +10345,7 @@ The `xcm-emulator` provides macros for defining a mocked testing environment. Ch
- **[`decl_test_relay_chains`](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable2506-2/cumulus/xcm/xcm-emulator/src/lib.rs#L361){target=\_blank}**: Defines runtime and configuration for the relay chains. Example:

```rust
decl_test_relay_chains! {
#[api_version(13)]
pub struct Westend {
genesis = genesis::genesis(),
on_init = (),
runtime = westend_runtime,
core = {
SovereignAccountOf: westend_runtime::xcm_config::LocationConverter,
},
pallets = {
XcmPallet: westend_runtime::XcmPallet,
Sudo: westend_runtime::Sudo,
Balances: westend_runtime::Balances,
Treasury: westend_runtime::Treasury,
AssetRate: westend_runtime::AssetRate,
Hrmp: westend_runtime::Hrmp,
Identity: westend_runtime::Identity,
IdentityMigrator: westend_runtime::IdentityMigrator,
}
},
}

```

- **[`decl_test_parachains`](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable2506-2/cumulus/xcm/xcm-emulator/src/lib.rs#L596){target=\_blank}**: Defines runtime and configuration for parachains. Example:
Expand Down Expand Up @@ -10438,38 +10382,13 @@ The `xcm-emulator` provides macros for defining a mocked testing environment. Ch
- **[`decl_test_bridges`](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable2506-2/cumulus/xcm/xcm-emulator/src/lib.rs#L1221){target=\_blank}**: Creates bridges between chains, specifying the source, target, and message handler. Example:

```rust
decl_test_bridges! {
pub struct RococoWestendMockBridge {
source = BridgeHubRococoPara,
target = BridgeHubWestendPara,
handler = RococoWestendMessageHandler
},
pub struct WestendRococoMockBridge {
source = BridgeHubWestendPara,
target = BridgeHubRococoPara,
handler = WestendRococoMessageHandler
}
}

```

- **[`decl_test_networks`](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable2506-2/cumulus/xcm/xcm-emulator/src/lib.rs#L958){target=\_blank}**: Defines a testing network with relay chains, parachains, and bridges, implementing message transport and processing logic. Example:

```rust
decl_test_networks! {
pub struct WestendMockNet {
relay_chain = Westend,
parachains = vec![
AssetHubWestend,
BridgeHubWestend,
CollectivesWestend,
CoretimeWestend,
PeopleWestend,
PenpalA,
PenpalB,
],
bridge = ()
},
}

```

By leveraging these macros, developers can customize their testing networks by defining relay chains and parachains tailored to their needs. For guidance on implementing a mock runtime for a Polkadot SDK-based chain, refer to the [Pallet Testing](/parachains/customize-runtime/pallet-development/pallet-testing/){target=\_blank} article.
Expand Down
109 changes: 14 additions & 95 deletions .ai/categories/dapps.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ First, you'll update the runtime's `Cargo.toml` file to include the Utility pall
1. Open the `runtime/Cargo.toml` file and locate the `[dependencies]` section. Add pallet-utility as one of the features for the `polkadot-sdk` dependency with the following line:

```toml hl_lines="4" title="runtime/Cargo.toml"
[dependencies]

...
polkadot-sdk = { workspace = true, features = [
"pallet-utility",
Expand All @@ -268,7 +268,7 @@ First, you'll update the runtime's `Cargo.toml` file to include the Utility pall
2. In the same `[dependencies]` section, add the custom pallet that you built from scratch with the following line:

```toml hl_lines="3" title="Cargo.toml"
[dependencies]

...
custom-pallet = { path = "../pallets/custom-pallet", default-features = false }
```
Expand Down Expand Up @@ -4497,23 +4497,7 @@ To create the ERC-20 contract, you can follow the steps below:
3. Now, paste the following ERC-20 contract code into the editor:

```solidity title="MyToken.sol"
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.22;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC20, Ownable {
constructor(address initialOwner)
ERC20("MyToken", "MTK")
Ownable(initialOwner)
{}

function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}

```

The key components of the code above are:
Expand Down Expand Up @@ -4831,26 +4815,7 @@ To create the NFT contract, you can follow the steps below:
3. Now, paste the following NFT contract code into the editor.

```solidity title="MyNFT.sol"
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.22;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC721, Ownable {
uint256 private _nextTokenId;

constructor(address initialOwner)
ERC721("MyToken", "MTK")
Ownable(initialOwner)
{}

function safeMint(address to) public onlyOwner {
uint256 tokenId = _nextTokenId++;
_safeMint(to, tokenId);
}
}

```

The key components of the code above are:
Expand Down Expand Up @@ -15313,8 +15278,7 @@ The [`XcmRouter`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pa
For instance, the Kusama network employs the [`ChildParachainRouter`](https://paritytech.github.io/polkadot-sdk/master/polkadot_runtime_common/xcm_sender/struct.ChildParachainRouter.html){target=\_blank}, which restricts routing to [Downward Message Passing (DMP)](https://wiki.polkadot.com/learn/learn-xcm-transport/#dmp-downward-message-passing){target=\_blank} from the relay chain to parachains, ensuring secure and controlled communication.

```rust
pub type PriceForChildParachainDelivery =
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, Dmp>;

```

For more details about XCM transport protocols, see the [XCM Channels](/develop/interoperability/xcm-channels/){target=\_blank} page.
Expand Down Expand Up @@ -17176,27 +17140,7 @@ The `xcm-emulator` provides macros for defining a mocked testing environment. Ch
- **[`decl_test_relay_chains`](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable2506-2/cumulus/xcm/xcm-emulator/src/lib.rs#L361){target=\_blank}**: Defines runtime and configuration for the relay chains. Example:

```rust
decl_test_relay_chains! {
#[api_version(13)]
pub struct Westend {
genesis = genesis::genesis(),
on_init = (),
runtime = westend_runtime,
core = {
SovereignAccountOf: westend_runtime::xcm_config::LocationConverter,
},
pallets = {
XcmPallet: westend_runtime::XcmPallet,
Sudo: westend_runtime::Sudo,
Balances: westend_runtime::Balances,
Treasury: westend_runtime::Treasury,
AssetRate: westend_runtime::AssetRate,
Hrmp: westend_runtime::Hrmp,
Identity: westend_runtime::Identity,
IdentityMigrator: westend_runtime::IdentityMigrator,
}
},
}

```

- **[`decl_test_parachains`](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable2506-2/cumulus/xcm/xcm-emulator/src/lib.rs#L596){target=\_blank}**: Defines runtime and configuration for parachains. Example:
Expand Down Expand Up @@ -17233,38 +17177,13 @@ The `xcm-emulator` provides macros for defining a mocked testing environment. Ch
- **[`decl_test_bridges`](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable2506-2/cumulus/xcm/xcm-emulator/src/lib.rs#L1221){target=\_blank}**: Creates bridges between chains, specifying the source, target, and message handler. Example:

```rust
decl_test_bridges! {
pub struct RococoWestendMockBridge {
source = BridgeHubRococoPara,
target = BridgeHubWestendPara,
handler = RococoWestendMessageHandler
},
pub struct WestendRococoMockBridge {
source = BridgeHubWestendPara,
target = BridgeHubRococoPara,
handler = WestendRococoMessageHandler
}
}

```

- **[`decl_test_networks`](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable2506-2/cumulus/xcm/xcm-emulator/src/lib.rs#L958){target=\_blank}**: Defines a testing network with relay chains, parachains, and bridges, implementing message transport and processing logic. Example:

```rust
decl_test_networks! {
pub struct WestendMockNet {
relay_chain = Westend,
parachains = vec![
AssetHubWestend,
BridgeHubWestend,
CollectivesWestend,
CoretimeWestend,
PeopleWestend,
PenpalA,
PenpalB,
],
bridge = ()
},
}

```

By leveraging these macros, developers can customize their testing networks by defining relay chains and parachains tailored to their needs. For guidance on implementing a mock runtime for a Polkadot SDK-based chain, refer to the [Pallet Testing](/parachains/customize-runtime/pallet-development/pallet-testing/){target=\_blank} article.
Expand Down Expand Up @@ -19312,7 +19231,7 @@ This API can be used independently for dry-running, double-checking, or testing.
This API allows a dry-run of any extrinsic and obtaining the outcome if it fails or succeeds, as well as the local xcm and remote xcm messages sent to other chains.

```rust
fn dry_run_call(origin: OriginCaller, call: Call, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<Event>, Error>;

```

??? interface "Input parameters"
Expand Down Expand Up @@ -19589,7 +19508,7 @@ fn dry_run_call(origin: OriginCaller, call: Call, result_xcms_version: XcmVersio
This API allows the direct dry-run of an xcm message instead of an extrinsic one, checks if it will execute successfully, and determines what other xcm messages will be forwarded to other chains.

```rust
fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<Call>) -> Result<XcmDryRunEffects<Event>, Error>;

```

??? interface "Input parameters"
Expand Down Expand Up @@ -19820,7 +19739,7 @@ To use the API effectively, the client must already know the XCM program to be e
Retrieves the list of assets that are acceptable for paying fees when using a specific XCM version

```rust
fn query_acceptable_payment_assets(xcm_version: Version) -> Result<Vec<VersionedAssetId>, Error>;

```

??? interface "Input parameters"
Expand Down Expand Up @@ -19908,7 +19827,7 @@ fn query_acceptable_payment_assets(xcm_version: Version) -> Result<Vec<Versioned
Calculates the weight required to execute a given XCM message. It is useful for estimating the execution cost of a cross-chain message in the destination chain before sending it.

```rust
fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, Error>;

```

??? interface "Input parameters"
Expand Down Expand Up @@ -20051,7 +19970,7 @@ fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, Error>;
Converts a given weight into the corresponding fee for a specified `AssetId`. It allows clients to determine the cost of execution in terms of the desired asset.

```rust
fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result<u128, Error>;

```

??? interface "Input parameters"
Expand Down Expand Up @@ -20156,7 +20075,7 @@ fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result<
Retrieves the delivery fees for sending a specific XCM message to a designated destination. The fees are always returned in a specific asset defined by the destination chain.

```rust
fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result<VersionedAssets, Error>;

```

??? interface "Input parameters"
Expand Down
Loading
Loading