Skip to content

Commit

Permalink
fix #844 checksum address from parameters before handling lookup request
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocastignoli committed Mar 30, 2023
1 parent d94d141 commit 7692ef3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/src/pages/Lookup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { checkAllByAddresses } from "../../utils/api";
import Field from "./Field";
import Result from "./Result";
import { useParams, useNavigate } from "react-router-dom";
import { isAddress, getAddress } from "@ethersproject/address";

const Lookup = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -51,7 +52,12 @@ const Lookup = () => {

useEffect(() => {
if (address && address !== response?.address) {
handleRequest(address);
if (!isAddress(address)) {
return;
}
// Get checksummed format
const checksummedAddress = getAddress(address);
handleRequest(checksummedAddress);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [sourcifyChains, address]);
Expand Down

0 comments on commit 7692ef3

Please sign in to comment.