-
Notifications
You must be signed in to change notification settings - Fork 74
FIX - Viem library refactor #1249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging/product-ia
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated style guide suggestions (1-2 of 2)
| ## Install Dependencies | ||
|
|
||
| Install viem along with other necessary dependencies, including [@parity/resolc](https://www.npmjs.com/package/@parity/resolc){target=\_blank}, which enables to compile smart contracts to [PolkaVM](/smart-contracts/for-eth-devs/#polkavm){target=\_blank} bytecode: | ||
| Install viem along with other necessary dependencies, including [`solc`](https://www.npmjs.com/package/solc){target=\_blank}, which enables to compile smart contracts EVM bytecode: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: Sentence ends with a colon; the phrase "enables to compile" is awkward. Use a period and correct the possessive.
| Install viem along with other necessary dependencies, including [`solc`](https://www.npmjs.com/package/solc){target=\_blank}, which enables to compile smart contracts EVM bytecode: | |
| Install viem along with other necessary dependencies, including [`solc`](https://www.npmjs.com/package/solc){target=\_blank}, which enables compiling smart contracts' EVM bytecode. |
| ``` | ||
|
|
||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.polkavm` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | ||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: The sentence is incomplete and references the wrong artifact file name.
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | |
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.bin` (containing the compiled bytecode). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the viem library documentation to use standard EVM compilation with solc instead of PolkaVM compilation with @parity/resolc. The changes align the documentation with standard Ethereum smart contract development practices.
Key Changes:
- Replaced
@parity/resolccompiler with standardsolcfor EVM bytecode compilation - Restructured project to separate ABIs and bytecode artifacts into distinct directories (
abis/andartifacts/) - Updated TypeScript imports to include
.tsfile extensions - Removed PolkaVM-specific warnings and references
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| smart-contracts/libraries/viem.md | Updated main documentation to reflect EVM compilation workflow with solc |
| .snippets/code/smart-contracts/libraries/viem/compile.ts | Replaced resolc compilation with standard solc compiler implementation |
| .snippets/code/smart-contracts/libraries/viem/deploy.ts | Updated to read bytecode from new file structure with proper path handling |
| .snippets/code/smart-contracts/libraries/viem/interact.ts | Updated imports and file paths to match new project structure |
| .snippets/code/smart-contracts/libraries/viem/fetchLastBlock.ts | Added TODO comments (should be removed) |
| llms-full.jsonl | Regenerated with updated documentation content |
| .ai/pages/smart-contracts-libraries-viem.md | Regenerated AI-formatted documentation |
| .ai/site-index.json | Updated metadata and content hashes |
| .ai/categories/tooling.md | Updated category file with new content |
| .ai/categories/smart-contracts.md | Updated category file with new content |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ``` | ||
|
|
||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.polkavm` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | ||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Storage.vin" should be "Storage.bin". The file extension for the compiled bytecode is ".bin" as shown in the project structure and throughout the code examples.
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | |
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.bin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
| import { createPublicClient, http } from 'viem'; | ||
|
|
||
| const transport = http('https://testnet-passet-hub-eth-rpc.polkadot.io'); | ||
| const transport = http('https://testnet-passet-hub-eth-rpc.polkadot.io'); // TODO: change to paseo asset hub once ready |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO comments should not be committed to production documentation. These comments reference changing to "paseo asset hub once ready" but appear in user-facing code examples. Either remove the TODO comments or use placeholder text.
| import { createPublicClient, http } from 'viem'; | ||
|
|
||
| const transport = http('https://testnet-passet-hub-eth-rpc.polkadot.io'); | ||
| const transport = http('https://testnet-passet-hub-eth-rpc.polkadot.io'); // TODO: change to paseo asset hub once ready |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO comments should not be committed to production documentation. These comments reference changing to "paseo asset hub once ready" but appear in user-facing code examples. Either remove the TODO comments or use placeholder text like INSERT_RPC_URL as done elsewhere in the documentation.
| ``` | ||
|
|
||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.polkavm` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | ||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Storage.vin" should be "Storage.bin". The file extension for the compiled bytecode is ".bin" as shown in the project structure and throughout the code examples.
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | |
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.bin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
| ``` | ||
|
|
||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.polkavm` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | ||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Storage.vin" should be "Storage.bin". The file extension for the compiled bytecode is ".bin" as shown in the project structure and throughout the code examples.
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | |
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.bin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
| rpcUrls: { | ||
| default: { | ||
| http: ['https://testnet-passet-hub-eth-rpc.polkadot.io'], | ||
| http: ['https://testnet-passet-hub-eth-rpc.polkadot.io'], // TODO: change to paseo asset hub once ready |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO comments should not be committed to production documentation. These comments reference changing to "paseo asset hub once ready" but appear in user-facing code examples. Either remove the TODO comments or use placeholder text like INSERT_RPC_URL as done elsewhere in the documentation.
| rpcUrls: { | ||
| default: { | ||
| http: ['https://testnet-passet-hub-eth-rpc.polkadot.io'], | ||
| http: ['https://testnet-passet-hub-eth-rpc.polkadot.io'], // TODO: change to paseo asset hub once ready |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO comments should not be committed to production documentation. These comments reference changing to "paseo asset hub once ready" but appear in user-facing code examples. Either remove the TODO comments or use placeholder text.
| import { createPublicClient, http } from 'viem'; | ||
|
|
||
| const transport = http('https://testnet-passet-hub-eth-rpc.polkadot.io'); | ||
| const transport = http('https://testnet-passet-hub-eth-rpc.polkadot.io'); // TODO: change to paseo asset hub once ready |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO comments should not be committed to production documentation. These comments reference changing to "paseo asset hub once ready" but appear in user-facing code examples. Either remove the TODO comments or use placeholder text.
| import { createPublicClient, http } from 'viem'; | ||
|
|
||
| const transport = http('https://testnet-passet-hub-eth-rpc.polkadot.io'); | ||
| const transport = http('https://testnet-passet-hub-eth-rpc.polkadot.io'); // TODO: change to paseo asset hub once ready |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO comments should not be committed to production documentation. These comments reference changing to "paseo asset hub once ready" but appear in user-facing code examples. Either remove the TODO comments or use placeholder text.
| ``` | ||
|
|
||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.polkavm` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | ||
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Storage.vin" should be "Storage.bin". The file extension for the compiled bytecode is ".bin" as shown in the project structure and throughout the code examples.
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.vin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. | |
| After executing this script, you will see the compilation results including the generated `Storage.json` (containing the contract's ABI) and `Storage.bin` (containing the compiled bytecode) files in the `artifacts` folder. These files contain all the necessary information for deploying and interacting with your smart contract on Polkadot Hub. |
π Description
Provide a clear and concise description of your changes.
π Review Preference
Choose one:
π€ AI-Ready Docs
If content changed, regenerate AI files:
python3 scripts/generate_llms.pyβ Checklist