Skip to content

Commit ac7480b

Browse files
committed
fix: llms
1 parent 1128d57 commit ac7480b

25 files changed

+481
-3480
lines changed

.ai/categories/basics.md

Lines changed: 7 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -287,63 +287,13 @@ Update your root parachain template's `Cargo.toml` file to include your custom p
287287
Make sure the `custom-pallet` is a member of the workspace:
288288

289289
```toml hl_lines="4" title="Cargo.toml"
290-
[workspace]
291-
default-members = ["pallets/template", "runtime"]
292-
members = [
293-
"node", "pallets/custom-pallet",
294-
"pallets/template",
295-
"runtime",
296-
]
290+
297291
```
298292

299293
???- code "./Cargo.toml"
300294

301295
```rust title="./Cargo.toml"
302-
[workspace.package]
303-
license = "MIT-0"
304-
authors = ["Parity Technologies <[email protected]>"]
305-
homepage = "https://paritytech.github.io/polkadot-sdk/"
306-
repository = "https://github.com/paritytech/polkadot-sdk-parachain-template.git"
307-
edition = "2021"
308-
309-
[workspace]
310-
default-members = ["pallets/template", "runtime"]
311-
members = [
312-
"node", "pallets/custom-pallet",
313-
"pallets/template",
314-
"runtime",
315-
]
316-
resolver = "2"
317-
318-
[workspace.dependencies]
319-
parachain-template-runtime = { path = "./runtime", default-features = false }
320-
pallet-parachain-template = { path = "./pallets/template", default-features = false }
321-
clap = { version = "4.5.13" }
322-
color-print = { version = "0.3.4" }
323-
docify = { version = "0.2.9" }
324-
futures = { version = "0.3.31" }
325-
jsonrpsee = { version = "0.24.3" }
326-
log = { version = "0.4.22", default-features = false }
327-
polkadot-sdk = { version = "2503.0.1", default-features = false }
328-
prometheus-endpoint = { version = "0.17.2", default-features = false, package = "substrate-prometheus-endpoint" }
329-
serde = { version = "1.0.214", default-features = false }
330-
codec = { version = "3.7.4", default-features = false, package = "parity-scale-codec" }
331-
cumulus-pallet-parachain-system = { version = "0.20.0", default-features = false }
332-
hex-literal = { version = "0.4.1", default-features = false }
333-
scale-info = { version = "2.11.6", default-features = false }
334-
serde_json = { version = "1.0.132", default-features = false }
335-
smallvec = { version = "1.11.0", default-features = false }
336-
substrate-wasm-builder = { version = "26.0.1", default-features = false }
337-
frame = { version = "0.9.1", default-features = false, package = "polkadot-sdk-frame" }
338-
339-
[profile.release]
340-
opt-level = 3
341-
panic = "unwind"
342-
343-
[profile.production]
344-
codegen-units = 1
345-
inherits = "release"
346-
lto = true
296+
347297
```
348298

349299

@@ -2094,23 +2044,7 @@ To create the ERC-20 contract, you can follow the steps below:
20942044
3. Now, paste the following ERC-20 contract code into the editor:
20952045
20962046
```solidity title="MyToken.sol"
2097-
// SPDX-License-Identifier: MIT
2098-
// Compatible with OpenZeppelin Contracts ^5.0.0
2099-
pragma solidity ^0.8.22;
2100-
2101-
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
2102-
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
2103-
2104-
contract MyToken is ERC20, Ownable {
2105-
constructor(address initialOwner)
2106-
ERC20("MyToken", "MTK")
2107-
Ownable(initialOwner)
2108-
{}
2109-
2110-
function mint(address to, uint256 amount) public onlyOwner {
2111-
_mint(to, amount);
2112-
}
2113-
}
2047+
21142048
```
21152049
21162050
The key components of the code above are:
@@ -2261,26 +2195,7 @@ To create the NFT contract, you can follow the steps below:
22612195
3. Now, paste the following NFT contract code into the editor.
22622196
22632197
```solidity title="MyNFT.sol"
2264-
// SPDX-License-Identifier: MIT
2265-
// Compatible with OpenZeppelin Contracts ^5.0.0
2266-
pragma solidity ^0.8.22;
2267-
2268-
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
2269-
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
2270-
2271-
contract MyToken is ERC721, Ownable {
2272-
uint256 private _nextTokenId;
2273-
2274-
constructor(address initialOwner)
2275-
ERC721("MyToken", "MTK")
2276-
Ownable(initialOwner)
2277-
{}
2278-
2279-
function safeMint(address to) public onlyOwner {
2280-
uint256 tokenId = _nextTokenId++;
2281-
_safeMint(to, tokenId);
2282-
}
2283-
}
2198+
22842199
```
22852200
22862201
The key components of the code above are:
@@ -5779,8 +5694,7 @@ The [`XcmRouter`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pa
57795694
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.
57805695
57815696
```rust
5782-
pub type PriceForChildParachainDelivery =
5783-
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, Dmp>;
5697+
57845698
```
57855699
57865700
For more details about XCM transport protocols, see the [XCM Channels](/develop/interoperability/xcm-channels/){target=\_blank} page.
@@ -6633,38 +6547,13 @@ The `xcm-emulator` provides macros for defining a mocked testing environment. Ch
66336547
- **[`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:
66346548
66356549
```rust
6636-
decl_test_bridges! {
6637-
pub struct RococoWestendMockBridge {
6638-
source = BridgeHubRococoPara,
6639-
target = BridgeHubWestendPara,
6640-
handler = RococoWestendMessageHandler
6641-
},
6642-
pub struct WestendRococoMockBridge {
6643-
source = BridgeHubWestendPara,
6644-
target = BridgeHubRococoPara,
6645-
handler = WestendRococoMessageHandler
6646-
}
6647-
}
6550+
66486551
```
66496552
66506553
- **[`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:
66516554
66526555
```rust
6653-
decl_test_networks! {
6654-
pub struct WestendMockNet {
6655-
relay_chain = Westend,
6656-
parachains = vec![
6657-
AssetHubWestend,
6658-
BridgeHubWestend,
6659-
CollectivesWestend,
6660-
CoretimeWestend,
6661-
PeopleWestend,
6662-
PenpalA,
6663-
PenpalB,
6664-
],
6665-
bridge = ()
6666-
},
6667-
}
6556+
66686557
```
66696558
66706559
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](/develop/parachains/testing/pallet-testing/){target=\_blank} article.

.ai/categories/dapps.md

Lines changed: 13 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -288,63 +288,13 @@ Update your root parachain template's `Cargo.toml` file to include your custom p
288288
Make sure the `custom-pallet` is a member of the workspace:
289289

290290
```toml hl_lines="4" title="Cargo.toml"
291-
[workspace]
292-
default-members = ["pallets/template", "runtime"]
293-
members = [
294-
"node", "pallets/custom-pallet",
295-
"pallets/template",
296-
"runtime",
297-
]
291+
298292
```
299293

300294
???- code "./Cargo.toml"
301295

302296
```rust title="./Cargo.toml"
303-
[workspace.package]
304-
license = "MIT-0"
305-
authors = ["Parity Technologies <[email protected]>"]
306-
homepage = "https://paritytech.github.io/polkadot-sdk/"
307-
repository = "https://github.com/paritytech/polkadot-sdk-parachain-template.git"
308-
edition = "2021"
309-
310-
[workspace]
311-
default-members = ["pallets/template", "runtime"]
312-
members = [
313-
"node", "pallets/custom-pallet",
314-
"pallets/template",
315-
"runtime",
316-
]
317-
resolver = "2"
318-
319-
[workspace.dependencies]
320-
parachain-template-runtime = { path = "./runtime", default-features = false }
321-
pallet-parachain-template = { path = "./pallets/template", default-features = false }
322-
clap = { version = "4.5.13" }
323-
color-print = { version = "0.3.4" }
324-
docify = { version = "0.2.9" }
325-
futures = { version = "0.3.31" }
326-
jsonrpsee = { version = "0.24.3" }
327-
log = { version = "0.4.22", default-features = false }
328-
polkadot-sdk = { version = "2503.0.1", default-features = false }
329-
prometheus-endpoint = { version = "0.17.2", default-features = false, package = "substrate-prometheus-endpoint" }
330-
serde = { version = "1.0.214", default-features = false }
331-
codec = { version = "3.7.4", default-features = false, package = "parity-scale-codec" }
332-
cumulus-pallet-parachain-system = { version = "0.20.0", default-features = false }
333-
hex-literal = { version = "0.4.1", default-features = false }
334-
scale-info = { version = "2.11.6", default-features = false }
335-
serde_json = { version = "1.0.132", default-features = false }
336-
smallvec = { version = "1.11.0", default-features = false }
337-
substrate-wasm-builder = { version = "26.0.1", default-features = false }
338-
frame = { version = "0.9.1", default-features = false, package = "polkadot-sdk-frame" }
339-
340-
[profile.release]
341-
opt-level = 3
342-
panic = "unwind"
343-
344-
[profile.production]
345-
codegen-units = 1
346-
inherits = "release"
347-
lto = true
297+
348298
```
349299

350300

@@ -2706,23 +2656,7 @@ To create the ERC-20 contract, you can follow the steps below:
27062656
3. Now, paste the following ERC-20 contract code into the editor:
27072657

27082658
```solidity title="MyToken.sol"
2709-
// SPDX-License-Identifier: MIT
2710-
// Compatible with OpenZeppelin Contracts ^5.0.0
2711-
pragma solidity ^0.8.22;
2712-
2713-
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
2714-
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
2715-
2716-
contract MyToken is ERC20, Ownable {
2717-
constructor(address initialOwner)
2718-
ERC20("MyToken", "MTK")
2719-
Ownable(initialOwner)
2720-
{}
2721-
2722-
function mint(address to, uint256 amount) public onlyOwner {
2723-
_mint(to, amount);
2724-
}
2725-
}
2659+
27262660
```
27272661

27282662
The key components of the code above are:
@@ -2873,26 +2807,7 @@ To create the NFT contract, you can follow the steps below:
28732807
3. Now, paste the following NFT contract code into the editor.
28742808

28752809
```solidity title="MyNFT.sol"
2876-
// SPDX-License-Identifier: MIT
2877-
// Compatible with OpenZeppelin Contracts ^5.0.0
2878-
pragma solidity ^0.8.22;
2879-
2880-
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
2881-
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
2882-
2883-
contract MyToken is ERC721, Ownable {
2884-
uint256 private _nextTokenId;
2885-
2886-
constructor(address initialOwner)
2887-
ERC721("MyToken", "MTK")
2888-
Ownable(initialOwner)
2889-
{}
2890-
2891-
function safeMint(address to) public onlyOwner {
2892-
uint256 tokenId = _nextTokenId++;
2893-
_safeMint(to, tokenId);
2894-
}
2895-
}
2810+
28962811
```
28972812

28982813
The key components of the code above are:
@@ -8809,8 +8724,7 @@ The [`XcmRouter`](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm/pa
88098724
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.
88108725

88118726
```rust
8812-
pub type PriceForChildParachainDelivery =
8813-
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, Dmp>;
8727+
88148728
```
88158729

88168730
For more details about XCM transport protocols, see the [XCM Channels](/develop/interoperability/xcm-channels/){target=\_blank} page.
@@ -10031,38 +9945,13 @@ The `xcm-emulator` provides macros for defining a mocked testing environment. Ch
100319945
- **[`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:
100329946

100339947
```rust
10034-
decl_test_bridges! {
10035-
pub struct RococoWestendMockBridge {
10036-
source = BridgeHubRococoPara,
10037-
target = BridgeHubWestendPara,
10038-
handler = RococoWestendMessageHandler
10039-
},
10040-
pub struct WestendRococoMockBridge {
10041-
source = BridgeHubWestendPara,
10042-
target = BridgeHubRococoPara,
10043-
handler = WestendRococoMessageHandler
10044-
}
10045-
}
9948+
100469949
```
100479950

100489951
- **[`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:
100499952

100509953
```rust
10051-
decl_test_networks! {
10052-
pub struct WestendMockNet {
10053-
relay_chain = Westend,
10054-
parachains = vec![
10055-
AssetHubWestend,
10056-
BridgeHubWestend,
10057-
CollectivesWestend,
10058-
CoretimeWestend,
10059-
PeopleWestend,
10060-
PenpalA,
10061-
PenpalB,
10062-
],
10063-
bridge = ()
10064-
},
10065-
}
9954+
100669955
```
100679956

100689957
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](/develop/parachains/testing/pallet-testing/){target=\_blank} article.
@@ -11319,7 +11208,7 @@ This API can be used independently for dry-running, double-checking, or testing.
1131911208
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.
1132011209

1132111210
```rust
11322-
fn dry_run_call(origin: OriginCaller, call: Call, result_xcms_version: XcmVersion) -> Result<CallDryRunEffects<Event>, Error>;
11211+
1132311212
```
1132411213

1132511214
??? interface "Input parameters"
@@ -11596,7 +11485,7 @@ fn dry_run_call(origin: OriginCaller, call: Call, result_xcms_version: XcmVersio
1159611485
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.
1159711486

1159811487
```rust
11599-
fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<Call>) -> Result<XcmDryRunEffects<Event>, Error>;
11488+
1160011489
```
1160111490

1160211491
??? interface "Input parameters"
@@ -11827,7 +11716,7 @@ To use the API effectively, the client must already know the XCM program to be e
1182711716
Retrieves the list of assets that are acceptable for paying fees when using a specific XCM version
1182811717

1182911718
```rust
11830-
fn query_acceptable_payment_assets(xcm_version: Version) -> Result<Vec<VersionedAssetId>, Error>;
11719+
1183111720
```
1183211721

1183311722
??? interface "Input parameters"
@@ -11915,7 +11804,7 @@ fn query_acceptable_payment_assets(xcm_version: Version) -> Result<Vec<Versioned
1191511804
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.
1191611805

1191711806
```rust
11918-
fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, Error>;
11807+
1191911808
```
1192011809

1192111810
??? interface "Input parameters"
@@ -12058,7 +11947,7 @@ fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, Error>;
1205811947
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.
1205911948

1206011949
```rust
12061-
fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result<u128, Error>;
11950+
1206211951
```
1206311952

1206411953
??? interface "Input parameters"
@@ -12163,7 +12052,7 @@ fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result<
1216312052
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.
1216412053

1216512054
```rust
12166-
fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result<VersionedAssets, Error>;
12055+
1216712056
```
1216812057

1216912058
??? interface "Input parameters"

0 commit comments

Comments
 (0)