Skip to content

Commit 6c91eb2

Browse files
committed
docs(readme): updtated README.md
1 parent e005326 commit 6c91eb2

File tree

4 files changed

+42
-45
lines changed

4 files changed

+42
-45
lines changed

README.md

+30-38
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# hardhat-gui-baker
22

3-
_A simple plugin that automatically generate GUI for smartcontracts_
3+
_A simple plugin that automatically generates GUI for smartcontracts_
44

55
## What
66

7-
This plugin will help you quickly test smartcontracts by localy creating a website in next so you can interact with it. You will have access to all your functions and a toolkit to impersonate accounts on the go or receive ERC20.
7+
This plugin will help you quickly test smartcontracts by locally creating a website in [viteJs](https://vitejs.dev/) so you can interact with it. You will have access to all your functions and a toolkit to impersonate accounts on the go or receive ERC20.
88

99
## Installation
1010

1111
```sh
12+
pnpm i hardhat-gui-baker
13+
14+
yarn add hardhat-gui-baker
15+
1216
npm install hardhat-gui-baker
1317
```
1418

@@ -24,68 +28,56 @@ Or if you are using TypeScript, in your `hardhat.config.ts`:
2428
import "hardhat-gui-baker";
2529
```
2630

27-
<!-- ## Required plugins
28-
29-
- [wighawag/hardhat-deploy](https://github.com/wighawag/hardhat-deploy) -->
30-
3131
## Tasks
3232

3333
This plugin adds the gui-baker task to Hardhat:
3434

3535
```
36-
Usage: hardhat [GLOBAL OPTIONS] gui-baker [--opt-network <STRING>]
36+
Usage: hardhat [GLOBAL OPTIONS] gui-baker [--opt-port <STRING>] [--show-logs]
3737
3838
OPTIONS:
3939
40-
--opt-network Optional : Wich network will be used
41-
```
42-
43-
<!--
44-
## Environment extensions
45-
40+
--opt-port Optional : Wich port will be used to expose the GUI
41+
--show-logs Show logs
4642
47-
This plugin extends the Hardhat Runtime Environment by adding an `example` field
48-
whose type is `ExampleHardhatRuntimeEnvironmentField`. -->
49-
<!--
50-
## Configuration
51-
52-
<_A description of each extension to the HardhatConfig or to its fields_>
53-
54-
This plugin extends the `HardhatUserConfig`'s `ProjectPathsUserConfig` object with an optional
55-
`newPath` field.
56-
57-
This is an example of how to set it:
58-
59-
```js
60-
module.exports = {
61-
paths: {
62-
newPath: "new-path",
63-
},
64-
}; -->
43+
gui-baker: Create a simple Gui to test your smartcontracts
44+
```
6545

6646
## Usage
6747

6848
(Remember to log the deployed contract address in your deployment script, you will need to provide it in the GUI)
6949

7050
lanch your node :
7151

72-
```
73-
hardhat node
52+
```sh
53+
npm hardhat node
7454
```
7555

7656
deploy your smartcontract :
7757

78-
```
79-
hardhat run scripts/deploy.ts
58+
```sh
59+
npm hardhat run pathToYourDeployementScript.ts
8060
```
8161

8262
bake your GUI :
8363

64+
```sh
65+
npm hardhat gui-baker
8466
```
85-
hardhat gui-baker
86-
```
8767

88-
enjoy your bakery on defalut : _localhost:4157_
68+
enjoy your bakery on (defalut) : _https://localhost:4157_
69+
70+
You will need to connect your wallet and be able to interact with your contract, that's it!
71+
72+
## Whats next ?
73+
74+
- A configuration page will soon be added so that you will have to possibility to add all contract addresses only once.
75+
76+
- Switch from ethers to viem.sh.
77+
78+
- Basic rpc tools to change the BlockTime, BlockNumber...
79+
80+
- Integration of Hardhat network tools like impersonating accounts, resetting the node...
8981

9082
<br/><br/>
9183

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"@types/node": "^8.10.38",
3434
"chai": "^4.2.0",
3535
"cz-conventional-changelog": "^3.3.0",
36-
"hardhat": "^2.0.0",
3736
"mocha": "^7.1.2",
3837
"prettier": "2.0.5",
3938
"ts-node": "^8.1.0",
@@ -47,6 +46,7 @@
4746
"@nomiclabs/hardhat-ethers": "^2.2.2",
4847
"commitizen": "^4.3.0",
4948
"ethers": "^5.7.2",
49+
"hardhat": "^2.0.0",
5050
"replace-in-file": "^6.3.5"
5151
},
5252
"config": {

src/index.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { task } from "hardhat/config";
1+
import { findRootSync } from "@manypkg/find-root";
22
import { spawnSync } from "child_process";
33
import { existsSync } from "fs";
4+
import { task } from "hardhat/config";
5+
46
import { parseContracts } from "./utils";
5-
import { findRootSync } from "@manypkg/find-root";
67

78
const baseVitePath: string = "/node_modules/hardhat-gui-baker/gui-baker";
89

9-
task("gui-baker", "Create a simple front to test your smartcontract")
10+
task("gui-baker", "Create a simple Gui to test your smartcontracts")
1011
.addOptionalParam(
1112
"optPort",
1213
"Optional : Wich port will be used to expose the GUI"
@@ -22,8 +23,9 @@ task("gui-baker", "Create a simple front to test your smartcontract")
2223
const vitePath = root.rootDir + baseVitePath;
2324

2425
console.log("\nCreating your GUI recipe...");
25-
if (!existsSync(".gui-baker"))
26+
if (!existsSync(".gui-baker")) {
2627
spawnSync("cp", ["-r", vitePath, ".gui-baker"], { stdio: logs });
28+
}
2729

2830
spawnSync("npm", ["i"], { cwd: ".gui-baker", stdio: logs });
2931
await parseContracts(hre);

src/utils.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ export async function parseContracts(hre: HardhatRuntimeEnvironment) {
99
const artifatcsName = await hre.artifacts.getAllFullyQualifiedNames();
1010

1111
for (const name of artifatcsName) {
12-
if (name.includes("@openzeppelin")) continue;
12+
if (name.includes("@openzeppelin")) {
13+
continue;
14+
}
1315

1416
const contract = await hre.artifacts.readArtifact(name);
1517
exportAbi(contract);
@@ -21,8 +23,9 @@ export async function parseContracts(hre: HardhatRuntimeEnvironment) {
2123
}
2224

2325
export function deleteExistingContext() {
24-
if (existsSync(contextPath + `/ContractContext.ts`))
26+
if (existsSync(contextPath + `/ContractContext.ts`)) {
2527
unlinkSync(contextPath + `/ContractContext.ts`);
28+
}
2629
}
2730

2831
export function exportAbi(contract: Artifact) {

0 commit comments

Comments
 (0)