Skip to content

Commit

Permalink
👌 Applied suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
nagdahimanshu committed Jun 19, 2024
1 parent 37b41c4 commit e3ef2d4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions internal/chain/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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),
},
Expand Down
6 changes: 2 additions & 4 deletions web/src/Faucet.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -189,7 +187,7 @@
<style>
.hero.is-info {
background:
linear-gradient(rgba(0, 0, 0.5, 0), rgba(0, 0, 0.5, 0)),
linear-gradient(180deg, rgba(14, 14, 40, 0.00) 0%, rgba(12, 21, 46, 0.25) 0%, rgba(35, 61, 135, 0.00) 49%, rgba(18, 27, 52, 0.40) 70.71%, rgba(16, 23, 43, 0.55) 79.18%, rgba(13, 22, 47, 0.70) 87.02%, #0C152E 93.58%, #0C152E 100%),
url('/background.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
Expand Down

0 comments on commit e3ef2d4

Please sign in to comment.