Skip to content

Commit 50bde4e

Browse files
authored
refactor: streamline documentation and improve CLI-first workflow (#49)
Update CONTRIBUTING.md to simplify setup instructions and adopt a CLI-first approach. Refactor documentation and messaging across templates, recipes, and codebase for consistency and clarity.
1 parent 45e4565 commit 50bde4e

File tree

12 files changed

+28
-86
lines changed

12 files changed

+28
-86
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ cargo build --release --bin dot
4646
### 2. Setup Your Environment
4747

4848
```bash
49-
# Fork the repository on GitHub first, then:
50-
git clone https://github.com/YOUR_USERNAME/polkadot-cookbook.git
51-
cd polkadot-cookbook
52-
git remote add upstream https://github.com/polkadot-developers/polkadot-cookbook.git
53-
5449
# Verify your setup
5550
dot setup
5651
```

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ Build custom FRAME pallets and runtime logic with Rust.
4444

4545
### <img src=".media/icons/contracts-dark.svg#gh-dark-mode-only" width="20" height="20" alt="" /> <img src=".media/icons/contracts-light.svg#gh-light-mode-only" width="20" height="20" alt="" /> Smart Contracts (Solidity)
4646

47-
Deploy and interact with Solidity contracts using pallet-revive.
47+
Deploy and interact with Solidity contracts.
4848

4949
| Recipe | Description | Difficulty |
5050
|----------|-------------|------------|
51-
| [**Simple Counter**](recipes/simple-counter) | A simple counter smart contract using pallet-revive | <img src=".media/icons/beginner-dark.svg#gh-dark-mode-only" width="14" height="14" alt="" /> <img src=".media/icons/beginner-light.svg#gh-light-mode-only" width="14" height="14" alt="" /> Beginner |
51+
| [**Simple Counter**](recipes/simple-counter) | A simple counter smart contract in Solidity | <img src=".media/icons/beginner-dark.svg#gh-dark-mode-only" width="14" height="14" alt="" /> <img src=".media/icons/beginner-light.svg#gh-light-mode-only" width="14" height="14" alt="" /> Beginner |
5252

5353
### <img src=".media/icons/interactions-dark.svg#gh-dark-mode-only" width="20" height="20" alt="" /> <img src=".media/icons/interactions-light.svg#gh-light-mode-only" width="20" height="20" alt="" /> Basic Interactions
5454

@@ -148,7 +148,7 @@ dot recipe submit my-pallet
148148

149149
The CLI supports five recipe pathways:
150150
- **Runtime Development** - Build custom FRAME pallets with Rust
151-
- **Smart Contracts** - Deploy Solidity contracts with pallet-revive
151+
- **Smart Contracts** - Deploy Solidity contracts
152152
- **Basic Interactions** - Single-chain transactions with PAPI (TypeScript)
153153
- **XCM** - Cross-chain messaging with Chopsticks (TypeScript)
154154
- **Testing Infrastructure** - Zombienet and Chopsticks configurations

cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ async fn handle_create(
264264
.item(
265265
RecipePathway::Contracts,
266266
"Smart Contracts (Solidity)",
267-
"Deploy contracts using pallet-revive",
267+
"Deploy Solidity contracts",
268268
)
269269
.item(
270270
RecipePathway::BasicInteraction,

core/src/config/recipe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub enum RecipeType {
99
/// Polkadot SDK recipe (Runtime pallets with Rust)
1010
#[serde(rename = "polkadot-sdk")]
1111
PolkadotSdk,
12-
/// Solidity smart contracts (pallet-revive)
12+
/// Solidity smart contracts
1313
Solidity,
1414
/// XCM cross-chain interactions (Chopsticks)
1515
Xcm,

core/src/scaffold/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl Scaffold {
167167
vec![project_path.to_path_buf()]
168168
}
169169
RecipeType::Solidity => {
170-
// For Solidity recipes with pallet-revive
170+
// For Solidity recipes
171171
vec![
172172
project_path.to_path_buf(),
173173
project_path.join("tests"),
@@ -265,7 +265,7 @@ impl Scaffold {
265265
Ok(())
266266
}
267267

268-
/// Create files for Solidity recipes (TypeScript with pallet-revive)
268+
/// Create files for Solidity recipes (TypeScript)
269269
async fn create_solidity_files(
270270
&self,
271271
project_path: &Path,

recipes/simple-counter/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Simple Counter
22

3-
A simple counter smart contract using pallet-revive
3+
A simple counter smart contract in Solidity
44

55
## Overview
66

77
This recipe demonstrates Solidity smart contract development using:
8-
- **pallet-revive** - EVM-compatible smart contracts on Polkadot
9-
- **Hardhat** - Development environment for Solidity
108
- **Ethers.js** - Library for interacting with contracts
119

1210
## Prerequisites
@@ -61,7 +59,7 @@ The recipe includes:
6159

6260
## What You'll Learn
6361

64-
- How to write Solidity contracts for pallet-revive
62+
- How to write Solidity contracts
6563
- How to compile and deploy contracts
6664
- How to write tests for your contracts
6765
- How to interact with deployed contracts
@@ -75,7 +73,6 @@ The recipe includes:
7573

7674
## Resources
7775

78-
- [pallet-revive Documentation](https://paritytech.github.io/polkadot-sdk/master/pallet_revive/index.html)
7976
- [Solidity Documentation](https://docs.soliditylang.org/)
80-
- [Hardhat Documentation](https://hardhat.org/docs)
77+
- [Polkadot SDK Documentation](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/index.html)
8178
- [Ethers.js Documentation](https://docs.ethers.org/)

recipes/simple-counter/contracts/Counter.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.24;
33

44
/**
55
* @title Counter
6-
* @dev Simple counter contract demonstrating pallet-revive Solidity support
6+
* @dev Simple counter contract
77
*/
88
contract Counter {
99
uint256 private count;

recipes/simple-counter/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "simple-counter",
33
"version": "1.0.0",
4-
"description": "A simple counter smart contract using pallet-revive",
4+
"description": "A simple counter smart contract in Solidity",
55
"scripts": {
66
"compile": "hardhat compile",
77
"test": "hardhat test",
@@ -13,7 +13,6 @@
1313
"keywords": [
1414
"polkadot",
1515
"solidity",
16-
"pallet-revive",
1716
"smart-contracts"
1817
],
1918
"license": "MIT OR Apache-2.0",

templates/recipe-templates/solidity-template/README.guide.md.template

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
## Overview
66

7-
A focused guide for implementing Solidity smart contracts on Polkadot using pallet-revive. This guide shows you how to quickly set up, develop, test, and deploy EVM-compatible contracts.
7+
A focused guide for implementing Solidity smart contracts. This guide shows you how to quickly set up, develop, test, and deploy EVM-compatible contracts.
88

99
**Prerequisites:**
1010
- Node.js 20+
1111
- Solidity knowledge
12-
- Hardhat experience
1312

1413
## Quick Start
1514

@@ -92,27 +91,12 @@ npm test
9291
### Local Node
9392

9493
```bash
95-
# Terminal 1: Start node
96-
npx hardhat node
97-
98-
# Terminal 2: Deploy
9994
npm run deploy:local
10095
```
10196

10297
### Testnet
10398

104-
Configure network in `hardhat.config.ts`:
105-
106-
```typescript
107-
networks: {
108-
testnet: {
109-
url: "https://rpc.testnet.example",
110-
accounts: [process.env.PRIVATE_KEY]
111-
}
112-
}
113-
```
114-
115-
Deploy:
99+
Deploy to testnet:
116100
```bash
117101
npm run deploy:testnet
118102
```
@@ -318,33 +302,12 @@ function batchUpdate(uint256[] calldata values) external {
318302
**Transaction reverts:**
319303
- Check require/revert messages
320304
- Verify function parameters
321-
- Test with hardhat console
322-
323-
## Integration with Polkadot
324-
325-
### Using pallet-revive
326-
327-
pallet-revive provides EVM compatibility on Polkadot:
328-
329-
- Deploy Solidity contracts as on Ethereum
330-
- Use standard tools (Hardhat, Ethers.js)
331-
- Interact via JSON-RPC
332-
- Access Polkadot-specific features (optional)
333-
334-
### Cross-Chain Features
335-
336-
```solidity
337-
// Example: Interact with Polkadot runtime
338-
interface IPolkadot {
339-
function callPallet(bytes calldata data) external;
340-
}
341-
```
305+
- Review transaction logs
342306

343307
## Resources
344308

345-
- [pallet-revive Docs](https://paritytech.github.io/polkadot-sdk/master/pallet_revive/index.html)
309+
- [Polkadot SDK Documentation](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/index.html)
346310
- [Solidity Docs](https://docs.soliditylang.org/)
347-
- [Hardhat Docs](https://hardhat.org/docs)
348311
- [Ethers.js Docs](https://docs.ethers.org/)
349312
- [OpenZeppelin Contracts](https://docs.openzeppelin.com/contracts/)
350313

templates/recipe-templates/solidity-template/README.tutorial.md.template

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Overview
66

7-
This tutorial teaches you Solidity smart contract development on Polkadot using **pallet-revive** - an EVM-compatible smart contract execution environment. You'll learn to write, test, deploy, and interact with Solidity contracts in the Polkadot ecosystem.
7+
This tutorial teaches you Solidity smart contract development. You'll learn to write, test, deploy, and interact with Solidity contracts.
88

99
## Prerequisites
1010

@@ -19,10 +19,10 @@ Before starting, ensure you have:
1919

2020
By completing this tutorial, you will understand:
2121

22-
- How to set up a Solidity development environment for Polkadot
23-
- How to write EVM-compatible contracts for pallet-revive
22+
- How to set up a Solidity development environment
23+
- How to write EVM-compatible contracts
2424
- How to compile contracts and generate TypeScript types
25-
- How to write comprehensive tests using Hardhat
25+
- How to write comprehensive tests for your contracts
2626
- How to deploy contracts to local and remote networks
2727
- How to interact with deployed contracts using Ethers.js
2828

@@ -38,10 +38,9 @@ npm install
3838
```
3939

4040
**What's installed:**
41-
- **Hardhat** - Development environment and test runner
4241
- **Ethers.js** - Library for blockchain interactions
4342
- **TypeScript** - Type-safe contract interactions
44-
- **Testing libraries** - Chai assertions and Hardhat plugins
43+
- **Testing libraries** - Chai assertions and testing utilities
4544

4645
### Step 2: Understanding the Contract Structure
4746

@@ -54,7 +53,6 @@ scripts/ # Deployment scripts
5453
├── deploy.ts # Automated deployment
5554
test/ # Contract tests
5655
├── Contract.test.ts # Test suite
57-
hardhat.config.ts # Hardhat configuration
5856
```
5957

6058
### Step 3: Writing Your Contract
@@ -101,7 +99,7 @@ npm run compile
10199

102100
### Step 5: Writing Tests
103101

104-
Tests use Hardhat's testing framework:
102+
Write tests for your contracts:
105103

106104
```typescript
107105
import { expect } from "chai";
@@ -144,10 +142,6 @@ npm test
144142
Deploy to a local development node:
145143

146144
```bash
147-
# Start local node (in another terminal)
148-
npx hardhat node
149-
150-
# Deploy
151145
npm run deploy:local
152146
```
153147

@@ -222,19 +216,14 @@ it("should emit ValueUpdated event", async () => {
222216
### Local Development
223217

224218
```bash
225-
# Terminal 1: Start node
226-
npx hardhat node
227-
228-
# Terminal 2: Deploy
229219
npm run deploy:local
230220
```
231221

232222
### Testnet Deployment
233223

234-
1. Configure network in `hardhat.config.ts`
235-
2. Fund your account with test tokens
236-
3. Deploy: `npm run deploy:testnet`
237-
4. Verify deployment on block explorer
224+
1. Fund your account with test tokens
225+
2. Deploy: `npm run deploy:testnet`
226+
3. Verify deployment on block explorer
238227

239228
### Production Deployment
240229

@@ -354,9 +343,9 @@ Extend your knowledge:
354343

355344
## Resources
356345

357-
- [pallet-revive Documentation](https://paritytech.github.io/polkadot-sdk/master/pallet_revive/index.html)
346+
- [Polkadot SDK Documentation](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/index.html)
358347
- [Solidity Documentation](https://docs.soliditylang.org/)
359-
- [Hardhat Guides](https://hardhat.org/tutorial)
348+
- [Ethers.js Documentation](https://docs.ethers.org/)
360349
- [OpenZeppelin Contracts](https://docs.openzeppelin.com/contracts/)
361350
- [Ethereum Security Best Practices](https://consensys.github.io/smart-contract-best-practices/)
362351

0 commit comments

Comments
 (0)