Skip to content

Commit a8633b1

Browse files
committed
llms
1 parent c62182e commit a8633b1

File tree

7 files changed

+361
-394
lines changed

7 files changed

+361
-394
lines changed

.ai/categories/smart-contracts.md

Lines changed: 166 additions & 169 deletions
Large diffs are not rendered by default.

.ai/categories/tooling.md

Lines changed: 166 additions & 169 deletions
Large diffs are not rendered by default.

.ai/pages/smart-contracts-libraries-wagmi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ npm install wagmi viem @tanstack/react-query
3232

3333
## Configure Wagmi for Polkadot Hub
3434

35-
Create a configuration file to initialize Wagmi with Polkadot Hub. In your project, create a file named `src/lib/wagmi.ts` and add the code below. Be sure to replace `INSERT_RPC_URL`, `INSERT_CHAIN_ID`, `INSERT_CHAIN_NAME`, `INSERT_NETWORK_NAME`, `INSERT_CHAIN_DECIMALS`, `INSERT_CURRENCY_NAME`, and `INSERT_CURRENCY_SYMBOL` with your specific values.
35+
Create a configuration file to initialize Wagmi with Polkadot Hub. In your project, create a file named `app/lib/wagmi.ts` and add the code below. Be sure to replace `INSERT_RPC_URL`, `INSERT_CHAIN_ID`, `INSERT_CHAIN_NAME`, `INSERT_NETWORK_NAME`, `INSERT_CHAIN_DECIMALS`, `INSERT_CURRENCY_NAME`, and `INSERT_CURRENCY_SYMBOL` with your specific values.
3636

3737
```typescript title="app/lib/wagmi.ts"
3838
import { http, createConfig } from 'wagmi'
@@ -248,7 +248,7 @@ This guide uses a simple Storage contract already deployed to the Polkadot Hub T
248248
}
249249
```
250250

251-
Create a component to interact with your deployed contract. Create a file named `components/StorageContract.tsx`:
251+
Create a component to interact with your deployed contract. Create a file named `app/components/StorageContract.tsx`:
252252

253253
```typescript title="app/components/StorageContract.tsx"
254254
"use client";

.ai/pages/smart-contracts-libraries-web3-js.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ Add the Solidity compiler so you can generate standard EVM bytecode:
7373
npm install --save-dev solc
7474
```
7575

76-
!!! tip
77-
The sample scripts use ECMAScript modules. Add `"type": "module"` to your `package.json` (or rename the files to `.mjs`) so that `node` can run the `import` statements.
78-
7976
## Set Up the Web3 Provider
8077

8178
The provider configuration is the foundation of any Web3.js application. It serves as a bridge between your application and the blockchain, allowing you to query blockchain data and interact with smart contracts.
@@ -132,7 +129,7 @@ With the provider set up, you can start querying the blockchain. For instance, t
132129
const PROVIDER_RPC = {
133130
rpc: 'https://testnet-passet-hub-eth-rpc.polkadot.io',
134131
chainId: 420420422,
135-
name: 'polkadot-hub-testnet',
132+
name: 'polkadotTestNet',
136133
};
137134

138135
const main = async () => {
@@ -395,7 +392,7 @@ You can create a `deploy.js` script in the `scripts` directory of your project t
395392
const providerConfig = {
396393
rpc: 'https://testnet-passet-hub-eth-rpc.polkadot.io', // TODO: replace to `https://services.polkadothub-rpc.com/testnet` when ready
397394
chainId: 420420422,
398-
name: 'polkadot-hub-testnet',
395+
name: 'polkadotTestNet',
399396
};
400397

401398
const privateKey = 'INSERT_PRIVATE_KEY';
@@ -503,7 +500,7 @@ You can create a `deploy.js` script in the `scripts` directory of your project t
503500
const providerConfig = {
504501
rpc: 'https://testnet-passet-hub-eth-rpc.polkadot.io', // TODO: replace to `https://services.polkadothub-rpc.com/testnet` when ready
505502
chainId: 420420422,
506-
name: 'polkadot-hub-testnet',
503+
name: 'polkadotTestNet',
507504
};
508505

509506
const privateKey = 'INSERT_PRIVATE_KEY';
@@ -523,7 +520,7 @@ After running this script, your contract will be deployed to Polkadot Hub, and i
523520

524521
## Interact with the Contract
525522

526-
Once the contract is deployed, you can interact with it by calling its functions. For example, to set a number, read it and then modify that number by its double, you can create a file named `updateStorage.js` in the `scripts` directory of your project and add the following code:
523+
Once the contract is deployed, you can interact with it by calling its functions. For example, to read the current stored value and then update it to a new value, you can create a file named `updateStorage.js` in the `scripts` directory of your project and add the following code:
527524

528525
```js title="scripts/updateStorage.js"
529526
const { readFileSync } = require('fs');
@@ -593,7 +590,7 @@ updateStorage(config)
593590
.catch((error) => console.error('Update error'));
594591
```
595592

596-
Ensure you replace the `INSERT_MNEMONIC`, `INSERT_CONTRACT_ADDRESS`, and `INSERT_ADDRESS_TO_CHECK` placeholders with actual values. Also, ensure the contract ABI file (`Storage.json`) is correctly referenced. The script prints the balance for `ADDRESS_TO_CHECK` before it writes and doubles the stored value, so pick any account you want to monitor.
593+
Ensure you replace the `INSERT_PRIVATE_KEY` and `INSERT_CONTRACT_ADDRESS` placeholders with actual values. Also, ensure the contract ABI file (`Storage.json`) is correctly referenced. The script reads the current stored value, sets it to 1, and then displays the updated value.
597594

598595
To interact with the contract, run:
599596

.ai/site-index.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5319,12 +5319,12 @@
53195319
}
53205320
],
53215321
"stats": {
5322-
"chars": 13336,
5323-
"words": 1487,
5322+
"chars": 13340,
5323+
"words": 1488,
53245324
"headings": 10,
5325-
"estimated_token_count_total": 3238
5325+
"estimated_token_count_total": 3240
53265326
},
5327-
"hash": "sha256:79acad3dd784fbf0f6704b74a3d2df2b7ede33f4a157cc28683c0f710a5236b2",
5327+
"hash": "sha256:031259a4d4f3755c9f5c04ed78126abd90831a5fe9fae3a45913e2560a91db6e",
53285328
"token_estimator": "heuristic-v1"
53295329
},
53305330
{
@@ -5401,12 +5401,12 @@
54015401
}
54025402
],
54035403
"stats": {
5404-
"chars": 20325,
5405-
"words": 2290,
5404+
"chars": 20056,
5405+
"words": 2249,
54065406
"headings": 12,
5407-
"estimated_token_count_total": 4600
5407+
"estimated_token_count_total": 4523
54085408
},
5409-
"hash": "sha256:7cf1e07d1b8ef4e7b893398976907159a932f23f708d4e1d7ac1d09b80881787",
5409+
"hash": "sha256:ac33422a87258d65a70e63f388279cc2afa4a1e3eec9c1b1aff52ac1ebf9e1a8",
54105410
"token_estimator": "heuristic-v1"
54115411
},
54125412
{

0 commit comments

Comments
 (0)