diff --git a/Makefile b/Makefile index 31c3e78..519ecdb 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,12 @@ build: build-frontend build-backend build-backend: # Builds the application and create a binary at ./bin/ @echo "$(BLUE)» Building $(APP_NAME) application binary... $(COLOR_END)" @go build -a -o bin/$(APP_NAME) . - @echo "$(GREEN) Binary successfully built$(COLOR_END)" + @echo "$(GREEN)Binary successfully built$(COLOR_END)" build-frontend: # Builds the frontned application @echo "$(BLUE)» Building frontend... $(COLOR_END)" @go generate - @echo "$(GREEN) Frontend successfully built$(COLOR_END)" + @echo "$(GREEN)Frontend successfully built$(COLOR_END)" run: # Runs the application, use `make run FLAGS="--help"` @./bin/${APP_NAME} ${FLAGS} diff --git a/README.md b/README.md index 0bd6b24..e2ea78d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ![GitHub issues](https://img.shields.io/github/issues-raw/liskhq/lsk-faucet) ![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/liskhq/lsk-faucet) -LSK faucet is a web application that can be configured and deployed to get custom ERC20 tokens on any network. The tokens can be used to test and troubleshoot your decentralized application or protocol before going live on the Mainnet. +LSK faucet is a web application that can be configured and deployed to get ETH and custom ERC20 tokens on any test network. The tokens can be used to test and troubleshoot your decentralized application or protocol before going live on the Mainnet. ## Features @@ -33,7 +33,7 @@ cd lsk-faucet 2. Bundle Frontend web with Vite -**NOTE**: Please make sure to replace token icon at `web/public/token.png` with the specific ERC20 token icon. +**NOTE**: Please make sure to update the token icon under `web/public/` with the specific ERC20 token icon. The file must be named `token.png`. We recommend the image dimensions to be 128px x 128px. ```bash make build-frontend @@ -61,12 +61,12 @@ make run FLAGS="-httpport 8080 -wallet.provider http://localhost:8545 -wallet.ke ### Configuration Below is a list of environment variables that can be configured. -- `WEB3_PROVIDER`: RPC Endpoint to connect with the network. +- `WEB3_PROVIDER`: RPC Endpoint to connect with the network node. - `PRIVATE_KEY`: Private key hex to fund user requests with. - `KEYSTORE`: Keystore file to fund user requests with. - `HCAPTCHA_SITEKEY`: hCaptcha sitekey. - `HCAPTCHA_SECRET`: hCaptcha secret. -- `ERC20_TOKEN_ADDRESS`: Contract address of ERC20 token on the above mentioned network, defaults to Lisk L2 token address. +- `ERC20_TOKEN_ADDRESS`: Contract address of the ERC20 token on the configured network, defaults to contract address for Lisk ERC20 tokens on Lisk Sepolia. You can configure the funder by setting any of the following environment variable instead of command-line flags: ```bash diff --git a/cmd/server.go b/cmd/server.go index 110f51f..89a1bd2 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -17,8 +17,9 @@ import ( ) var ( - appVersion = "v1.1.0" - chainIDMap = map[string]int{"sepolia": 4202} + appVersion = "v1.1.0" + chainIDMap = map[string]int{"lisk_sepolia": 4202} + tokenAddress = flag.String("token-address", os.Getenv("ERC20_TOKEN_ADDRESS"), "Contract address of ERC20 token") httpPortFlag = flag.Int("httpport", 8080, "Listener port to serve HTTP connection") @@ -27,7 +28,7 @@ var ( payoutFlag = flag.Int("faucet.amount", 1, "Number of ERC20 tokens to transfer per user request") intervalFlag = flag.Int("faucet.minutes", 10080, "Number of minutes to wait between funding rounds") - netnameFlag = flag.String("faucet.name", "sepolia", "Network name to display on the frontend") + netnameFlag = flag.String("faucet.name", "lisk_sepolia", "Network name to display on the frontend") symbolFlag = flag.String("faucet.symbol", "LSK", "Token symbol to display on the frontend") keyJSONFlag = flag.String("wallet.keyjson", os.Getenv("KEYSTORE"), "Keystore file to fund user requests with") diff --git a/internal/chain/util_test.go b/internal/chain/util_test.go index 792f469..29d18e3 100644 --- a/internal/chain/util_test.go +++ b/internal/chain/util_test.go @@ -57,7 +57,7 @@ func Test_LSKToWei(t *testing.T) { amount int64 want *big.Int }{ - {name: "Should convert 1 LSK to Wei", amount: 1, want: big.NewInt(1000000000000000000)}, + {name: "should convert 1 LSK to 10^18 Wei", amount: 1, want: big.NewInt(1000000000000000000)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -75,7 +75,7 @@ func Test_addLeftPadding(t *testing.T) { want []byte }{ { - name: "Should return padded input", + name: "should return padded input", input: common.HexToAddress("0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B").Bytes(), want: common.LeftPadBytes(common.HexToAddress("0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B").Bytes(), 32), }, diff --git a/web/src/Faucet.svelte b/web/src/Faucet.svelte index fe0c668..613e0a5 100644 --- a/web/src/Faucet.svelte +++ b/web/src/Faucet.svelte @@ -26,9 +26,7 @@ hcaptchaLoaded = true; }; - $: document.title = `${faucetInfo.symbol} ${capitalize( - faucetInfo.network, - )} Faucet`; + $: document.title = `${capitalize(faucetInfo.network)} Faucet`; let widgetID; $: if (mounted && hcaptchaLoaded) { @@ -189,7 +187,7 @@