Skip to content

Commit c720d6d

Browse files
react-solidity improvements
* added default contract, so frontend app could work without deploying the contract * improved instructions
1 parent 49ad98e commit c720d6d

File tree

3 files changed

+54
-3
lines changed

3 files changed

+54
-3
lines changed

src/templateConfigs/react-solidity.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ const config: TemplateConfig = {
1515
/^package\.json/,
1616
],
1717
instructions: `
18-
${c.secondary("Start remixd environment:")}
18+
${c.primary("Step 1: ")}${c.secondary("start remixd environment")}
1919
${c.code("pnpm remixd")}
2020
21-
${c.secondary("Start frontend app:")}
21+
${c.primary("Step 2: ")}\
22+
${c.secondary("after deploying and pinning smart contracts in remix, build the contracts")}
23+
${c.code("pnpm contracts:build")}
24+
25+
${c.primary("Step 3: ")}${c.secondary("start frontend app")}
2226
${c.code("pnpm frontend:dev")}`,
2327
};
2428

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "Storage",
3+
"address": "0x12d7b1015d6888edbeb19610cfe518310405c685",
4+
"abi": [
5+
{
6+
"inputs": [
7+
{
8+
"internalType": "uint256",
9+
"name": "num",
10+
"type": "uint256"
11+
}
12+
],
13+
"name": "addMoney",
14+
"outputs": [],
15+
"stateMutability": "payable",
16+
"type": "function"
17+
},
18+
{
19+
"inputs": [
20+
{
21+
"internalType": "uint256",
22+
"name": "num",
23+
"type": "uint256"
24+
}
25+
],
26+
"name": "store",
27+
"outputs": [],
28+
"stateMutability": "nonpayable",
29+
"type": "function"
30+
},
31+
{
32+
"inputs": [],
33+
"name": "retrieve",
34+
"outputs": [
35+
{
36+
"internalType": "uint256",
37+
"name": "",
38+
"type": "uint256"
39+
}
40+
],
41+
"stateMutability": "view",
42+
"type": "function"
43+
}
44+
],
45+
"filePath": " - connect to localhost - /Storage.sol",
46+
"pinnedAt": 1733225540743
47+
}

templates/react-solidity/frontend/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import polkadotLogo from "./assets/polkadot-logo.svg";
88
import { useNetworkData } from "./hooks/useNetworkData";
99

1010
function App() {
11-
const contractData = contracts["1b5b93a223026219f4f75e5b90c20970ab976451"];
11+
const contractData = contracts["12d7b1015d6888edbeb19610cfe518310405c685"];
1212
const { storedValue, balance, chainId } = useNetworkData(contractData);
1313

1414
return (

0 commit comments

Comments
 (0)