Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
}
}
);
const responseData = result.data;
if (responseData && !responseData.success) {
console.log('Invaild recaptcha token!');
const errorMessage = responseData['error-codes'].join(', ');
throw new Error(errorMessage);
}
console.log('Vaild recaptcha token ✓');
console.log(`Address: ${address}`);
if (!isValidChecksumAddress(address)) {
throw new Error('Invalid Checksum Address!');
}
console.log('Vaild address ✓');
} catch (error) {
console.error(error);
res.status(400).json({ errorCode: 400, errorMessage: error.message });
return;
}
try {
let claimInterval;
const userRef = firestore
.collection(`versions`)
.doc(`${VERSION}`)
.collection(`users`)
.doc(`${address}`);
toDs,
),
attempts,
interval,
true,
);
if (tx.isRejected()) {
this.status = ContractStatus.Rejected;
this.address = undefined;
return [tx, this];
}
this.status = ContractStatus.Deployed;
this.address =
this.address && isValidChecksumAddress(this.address)
? this.address
: Contracts.getAddressForContract(tx);
return [tx, this];
} catch (err) {
throw err;
}
}