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

feat: Migrate GaugesTab to wagmi #258

Merged

Conversation

karelianpie
Copy link
Member

Last one; Migrate GaugesTab to wagmi, feature branch of #248

@karelianpie karelianpie self-assigned this Jun 27, 2023
@vercel
Copy link

vercel bot commented Jun 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yearnfi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 0:42am

@karelianpie karelianpie force-pushed the feat/veyfi-gauges-merged-gauges-tab branch from def1779 to 4b577f2 Compare June 27, 2023 12:32
Comment on lines +35 to 42
if(!(props.allowance >= props.amount)) {
await handleTxWagmi(props, {
address: props.vaultAddress,
abi: ['function approve(address _spender, uint256 _value) external'],
functionName: 'approve',
args: [props.contractAddress, props.amount]
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we first refetch allowance here instead of having it as prop?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe @xgambitox can opinate on this one

Copy link
Contributor

Choose a reason for hiding this comment

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

We can, just to make sure the approval tx did not fail for any reason, and throw an error if allowance is still not greater than amount

Copy link
Contributor

Choose a reason for hiding this comment

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

As it is right now, if approval tx fails, the stake tx would be prompted to the user as a possible revert through their wallet UI

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good, created an issue #266

Can add that to the feat/veyfi-gauges-merged branch

apps/veyfi/utils/actions/gauge.ts Outdated Show resolved Hide resolved
@xgambitox
Copy link
Contributor

Migration looks good. If you want to add Major's suggested change here or in other PR is fine by me

@karelianpie
Copy link
Member Author

Migration looks good. If you want to add Major's suggested change here or in other PR is fine by me

Nice! Let's do it in the branch with all migrations, want to see it green :)

@karelianpie karelianpie merged commit 8d0c5fd into feat/veyfi-gauges-merged Jul 3, 2023
7 checks passed
@karelianpie karelianpie deleted the feat/veyfi-gauges-merged-gauges-tab branch July 3, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🟢 Done
Development

Successfully merging this pull request may close these issues.

3 participants