From 0e6bec42afab372e509d6ff241b6fb8dac6565b3 Mon Sep 17 00:00:00 2001 From: rajranjan0608 Date: Thu, 29 Sep 2022 21:04:36 +0530 Subject: [PATCH] amount fallback value --- client/src/components/FaucetForm.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/FaucetForm.tsx b/client/src/components/FaucetForm.tsx index 828602e..6ef6fd0 100644 --- a/client/src/components/FaucetForm.tsx +++ b/client/src/components/FaucetForm.tsx @@ -230,14 +230,14 @@ const FaucetForm = (props: any) => { } } - function calculateBaseUnit(amount: string, decimals: number = 18): BigInt { + function calculateBaseUnit(amount: string = "0", decimals: number = 18): BigInt { for(let i = 0; i < decimals; i++) { amount += "0" } return BigInt(amount) } - function calculateLargestUnit(amount: string, decimals: number = 18): string { + function calculateLargestUnit(amount: string = "0", decimals: number = 18): string { let base = "1" for(let i = 0; i < decimals; i++) { base += "0"