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

fix: handle EIP-1967 proxy contracts in useGetABI for WalletConnect to dApps #5368

Merged
merged 7 commits into from
Sep 28, 2023

Conversation

0xMillz
Copy link
Contributor

@0xMillz 0xMillz commented Sep 27, 2023

Description

There was a TODO in the code comments: TODO: add additional proxy methods. I happened to need support for this popular proxy method when trying to mint domains using the UnstoppableDomains dApp + web + KeepKey. I tested this out with KeepKey and it works as intended; the only blockers are what other users have reported with invalid hash value errors thrown from the dApp side when it receives our final, signed eth_sendTransaction payload. You can tell from the screenshots below that the data we are sending them might need some tweaking, but that is an existing bug that I'm sure you all are aware of.

Hope this helps! I mostly did this just for fun and KeepKey Desktop will eventually need this functionality too!

Pull Request Type

  • 🐛 Bug fix (Non-breaking Change: Fixes an issue)
  • 🛠️ Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
  • 💅 New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

closes #5054

Risk

Zero immediate user impact, because the full user flow is still blocked by bug(s) that prevent the final tx being broadcasted. I have fully user-tested my changes with a KeepKey and it all works as expected.

Testing

Connect your wallet to the Unstoppable Domains dApp using WalletConnect. It is a proxy contract, and when you go through a flow like bridging a Polygon domain to Ethereum, it will be able to fetch the API from the logic contract and display the relevant ABI methods and data for you to confirm in the web3modal.

Engineering

See the testing notes above; the code changes are pretty self-explanatory and I left relevant comments too.

Operations

For example you could, mint a Polygon domain like .crypto using the UnstoppableDomains WalletConnect feature in web and then use the UnstoppableDomains UI to bridge that domain to Ethereum. Or just interacting with any dApp that has a EIP-1967 proxy as its root contract address.

Screenshots (if applicable)

Screenshot 2023-09-27 at 11 44 03 Screenshot 2023-09-27 at 11 44 50 Screenshot 2023-09-27 at 11 45 12 Screenshot 2023-09-27 at 12 50 14

@0xMillz 0xMillz requested a review from a team as a code owner September 27, 2023 19:05
@0xApotheosis 0xApotheosis self-assigned this Sep 28, 2023
Copy link
Contributor

@0xApotheosis 0xApotheosis left a comment

Choose a reason for hiding this comment

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

Code-wise this looks solid, thanks for the PR.

I'll leave the Unstoppable flow for operations to test.

@0xApotheosis 0xApotheosis merged commit 4a105fe into shapeshift:develop Sep 28, 2023
3 checks passed
@0xMillz
Copy link
Contributor Author

0xMillz commented Sep 28, 2023

Code-wise this looks solid, thanks for the PR.

I'll leave the Unstoppable flow for operations to test.

NP. Btw, here's how the modal currently looks in prod for the same tx. You can see in the dev console it's trying to call a root method that doesn't exist
Screenshot 2023-09-27 at 20 14 20

useGetAbi should be solid now, so I think the next dev effort in this flow is correctly building and displaying the WC EthSendTransactionCallRequest in ContractInteractionBreakdown. I'll be traveling the rest of the week, but I'll have some time to communicate with ops if they have any testing questions for the current PR.

@0xMillz 0xMillz deleted the add-eip1967-proxy-support branch September 28, 2023 02:33
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.

useGetABI doesn't support ERC-1967-compliant proxy contracts
3 participants