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

Enable ABI types and fix erros #104

Merged
merged 7 commits into from
Apr 16, 2024
Merged

Enable ABI types and fix erros #104

merged 7 commits into from
Apr 16, 2024

Conversation

xavikh
Copy link
Contributor

@xavikh xavikh commented Apr 9, 2024

This PR tries to fix some Wagmi hooks that are not detecting the ABIs types.

@xavikh xavikh marked this pull request as ready for review April 10, 2024 07:52
@xavikh xavikh requested a review from brickpop April 10, 2024 11:32
const address = getAddress(e.target.value);
setTargetContract(address);
} catch (e) {
setTargetContract(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work if you copy the address. But if for some reason you entered it manually, it would always reset the value to undefined.

We could show an error alert instead and simply assume that you will always copy addresses. But I would never change the user's value without proper feedback about what happened

Copy link
Contributor Author

@xavikh xavikh Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I rolled back the targetContract type to string and now I use as Address where is needed.

Maybe for another ticket: I noticed that we are using our own isAddress function instead of the provided by Viem. Is there any reason for this? I found out the Viem checker also checks for checksums.

Copy link
Contributor

@brickpop brickpop Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware of viem's version, so it would be ideal if we switch into using it.
However, there's a great chance that people copy an address without the checksum, so I would be cautious with how strict we are with the checksum errors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Np, I'll open a ticket for it 🎫

plugins/dualGovernance/hooks/useCanCreateProposal.tsx Outdated Show resolved Hide resolved
plugins/lockToVote/hooks/useProposalVeto.tsx Outdated Show resolved Hide resolved
plugins/lockToVote/hooks/useProposalVeto.tsx Outdated Show resolved Hide resolved
@xavikh xavikh requested a review from brickpop April 16, 2024 08:35
@xavikh xavikh merged commit 94a3ec8 into main Apr 16, 2024
2 checks passed
@xavikh xavikh deleted the fix/abi-types branch April 16, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants