Skip to content

Commit

Permalink
Checksum address before comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
solimander committed Mar 12, 2024
1 parent 1767c25 commit 6e2e3f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Proposal, Round, Timed } from '@prophouse/sdk-react';
import { useAppSelector } from '../../hooks';
import ProposalCardClaimAwardBar from '../ProposalCardClaimAwardBar';
import { getBlockExplorerURL } from '../../utils/getBlockExplorerUrl';
import { getChecksumAddress } from '../../utils/getChecksumAddress';
import { useAccount, useChainId } from 'wagmi';
import Button, { ButtonColor } from '../Button';
import { cmdPlusClicked } from '../../utils/cmdPlusClicked';
Expand Down Expand Up @@ -162,7 +163,7 @@ const TimedRoundProposalCard: React.FC<{
</div>
</Card>
{roundEndedAndNotCancelled &&
account.address === proposal.proposer &&
account.address === getChecksumAddress(proposal.proposer) &&
proposal.isWinner && <ProposalCardClaimAwardBar round={round} proposal={proposal} />}
</div>
</>
Expand Down
3 changes: 3 additions & 0 deletions packages/prop-house-webapp/src/utils/getChecksumAddress.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { utils } from 'ethers';

export const getChecksumAddress = (address: string) => utils.getAddress(address.replace('0x', '').padStart(40, '0'))

0 comments on commit 6e2e3f6

Please sign in to comment.