docs: update README

This commit is contained in:
Ting-Jun Wang 2023-02-26 03:13:12 +08:00
parent bce3825c48
commit 8ad46e2a38
Signed by: snsd0805
GPG Key ID: 8DB0D22BC1217D33
2 changed files with 26 additions and 6 deletions

View File

@ -1,14 +1,13 @@
# web
# Faucet Webpage
This template should help get you started developing with Vue 3 in Vite.
A simple webpage for Goerli Testnet's faucet.
## Recommended IDE Setup
It's HW1 for 1112 NCNU CSIE "Principles and Practice of Blockchains"
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
link to Metamask and create a transaction to the smart contract to get GoerliETH.
## Customize configuration
![](docs/Screenshot_20230226_025506.png)
See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup
@ -16,6 +15,19 @@ See [Vite Configuration Reference](https://vitejs.dev/config/).
npm install
```
### fill in your smart contract's address
```javascript
// /src/views/FaucetView.vue line 46
const transactionParameters = {
from: ethereum.selectedAddress,
to: '', // smart contract's address
data: encodeFunctionCall,
value: '0x00',
}
```
### Compile and Hot-Reload for Development
```sh
@ -27,3 +39,11 @@ npm run dev
```sh
npm run build
```
## Notice
Now, I am not sure of difference between `window.ethereum` & `web3`
I use `window.ethereum` to send transaction, check accounts, check network and use `web3` to encode ABI.
I am not sure whether it's a suitable implementation

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB