Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Faucet.js #128

Merged
merged 1 commit into from
Apr 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,26 @@ function Faucet() {
setLoading(true);
const res = await networkService.verifyCAPTCHAImage(value, captchaInfo.uuid, key);
if (res.error) {
let error = res?.error?.data?.message;
let error = res?.error?.data?.message
console.log("error:", error)
if (error === "execution reverted: Invalid request") {
error = "You reached the request limit. Please come back again after 24 hours!";
error = "You reached the request limit. Please come back again after 24 hours!"
dispatch(openAlert(error))
} else if (error === "execution reverted: Invalid key and UUID"){
error = "You failed the CAPTCHA test. Are you human? Please try again"
dispatch(openError(error))
} else if (error === "execution reverted: TURING: Server error"){
error = "Servers are starting from cold boot. Please try again in 15 seconds"
dispatch(openAlert(error))
}
dispatch(openError(error));
dispatch(getCAPTCHAImage());
setKey("");
dispatch(getCAPTCHAImage())
setKey("")
} else {
dispatch(openAlert(`${value === 1 ? "10 test BOBA" : "0.1 test ETH"} was sent to your wallet`));
dispatch(getCAPTCHAImage());
setKey("");
dispatch(openAlert(`${value === 1 ? "10 test BOBA" : "0.1 test ETH"} was sent to your wallet`))
dispatch(getCAPTCHAImage())
setKey("")
}
setLoading(false);
setLoading(false)
};

const hasFunds = account ? accountBalance > 500000000000000 : false;
Expand All @@ -67,8 +74,7 @@ function Faucet() {
<div className="middleText">
You are limited to one BOBA request and one ETH request every 24 hours, and
you must have some Rinkeby ETH in your account to use this faucet.
If you do not
have any Rinkeby ETH, you can get some from{" "}
If you do not have any Rinkeby ETH, you can get some from{" "}
<a target="_blank" href="https://faucets.chain.link/rinkeby">Chainlink Faucet</a>,{" "}
<a target="_blank" href="https://faucet.rinkeby.io">Rinkeby Authenticated Faucet</a>,{" "}or
{" "}<a target="_blank" href="https://rinkebyfaucet.com">RINKEBY FAUCET</a>.
Expand Down Expand Up @@ -112,7 +118,7 @@ function Faucet() {
</Button>
<div className="smallText" style={{ marginTop: 20 }}>{account && !hasFunds
? <span style={{color: 'red'}}>
This faucet uses Turing, thus you need to have some ETH on your wallet. Bridge some funds from L1 Rinkeby to L2 Boba Rinkeby via our&nbsp;
Please bridge some funds from L1 Rinkeby to L2 Boba Rinkeby via our&nbsp;
<a href="https://gateway.rinkeby.boba.network/" title="Gateway - Bridge ETH" target="_blank">Gateway</a>.</span>
: 'Your result will be hashed and compared off-chain through Turing.'}
</div>
Expand Down