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: approvals failing for non-eth EVM chains #5577

Merged
merged 4 commits into from
Nov 3, 2023
Merged

Conversation

woodenfurniture
Copy link
Member

@woodenfurniture woodenfurniture commented Nov 3, 2023

Description

Fixes broken ERC20 allowance approvals for non-eth EVM chains.

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 #5571
closes #5573
closes #5574

Risk

Risk of approvals still broken for EVM chains

Testing

Check approvals work for all EVM chains

Engineering

Note that this includes a fix to use the viem public client per chain, and I've hardcoded all other uses of the function to use ETH mainnet. Please double check this is correct for all cases where i've hardcoded it.

Operations

Screenshots (if applicable)

FOX/ETH LP appearing also
image

@woodenfurniture
Copy link
Member Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@woodenfurniture woodenfurniture marked this pull request as ready for review November 3, 2023 01:04
@woodenfurniture woodenfurniture requested a review from a team as a code owner November 3, 2023 01:04
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

Conceptually looks sane, will test at runtime and actually stamp

src/contracts/contractManager.ts Show resolved Hide resolved
src/lib/utils/evm.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

Tested against develop:

Non-Ethereum EVM chains trade approvals

  • This diff
image
  • Develop
image

THORChain savers deposit

  • Develop
image
  • This diff
image image image

Didn't test UNI-V2 because of insufficient funds for gas, though Ethereum Mainnet is the only supported chain there so LGTM also, will defer to ops for UNI-V2 testing

@woodenfurniture woodenfurniture enabled auto-merge (squash) November 3, 2023 02:14
@woodenfurniture woodenfurniture merged commit 7ab910d into develop Nov 3, 2023
3 checks passed
@woodenfurniture woodenfurniture deleted the fix-approvals branch November 3, 2023 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants