add more checks on contract address

pull/3606/head
Aniket-Engg 2 years ago committed by Aniket
parent d9ea58a73e
commit f4062dd944
  1. 3
      apps/etherscan/src/app/views/VerifyView.tsx

@ -73,7 +73,8 @@ export const VerifyView: React.FC<Props> = ({
if (!values.contractAddress) { if (!values.contractAddress) {
errors.contractAddress = "Required" errors.contractAddress = "Required"
} }
if (values.contractAddress.trim() === "") { if (values.contractAddress.trim() === "" || !values.contractAddress.startsWith('0x')
|| values.contractAddress.length !== 42) {
errors.contractAddress = "Please enter a valid contract address" errors.contractAddress = "Please enter a valid contract address"
} }
return errors return errors

Loading…
Cancel
Save