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

Rewrite AddLiquidityActionCard #134

Merged
merged 3 commits into from
Oct 26, 2022
Merged

Conversation

haydenshively
Copy link
Member

@haydenshively haydenshively commented Oct 25, 2022

With the live version, it's possible to make the tokenInputs spike to infinity and write "OUT OF BOUNDS" errors to the console. This rewrite fixes those issues (whatever they were) and substantially simplifies the code. Again, this is part of the broader refactor I'm working on.

When reviewing, there's really no point to looking at the diff. Better off seeing if it works in the deploy preview, and then just reading the new code in isolation.

@netlify
Copy link

netlify bot commented Oct 25, 2022

Deploy Preview for aloe-blend-staging canceled.

Name Link
🔨 Latest commit 12f518a
🔍 Latest deploy log https://app.netlify.com/sites/aloe-blend-staging/deploys/635980ce55def100092941ae

@netlify
Copy link

netlify bot commented Oct 25, 2022

Deploy Preview for aloe-prime ready!

Name Link
🔨 Latest commit 12f518a
🔍 Latest deploy log https://app.netlify.com/sites/aloe-prime/deploys/635980ced6c90b0008917074
😎 Deploy Preview https://deploy-preview-134--aloe-prime.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 25, 2022

Deploy Preview for aloe-earn canceled.

Name Link
🔨 Latest commit 12f518a
🔍 Latest deploy log https://app.netlify.com/sites/aloe-earn/deploys/635980ce90c0c0000775df68

IanWoodard
IanWoodard previously approved these changes Oct 26, 2022
Copy link
Collaborator

@IanWoodard IanWoodard left a comment

Choose a reason for hiding this comment

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

Left a few suggestions and comments but overall, LGTM
Great work!

amount1Str: fields?.at(1) ?? '',
lowerStr: fields?.at(2) ?? '',
upperStr: fields?.at(3) ?? '',
isToken0Selected: fields?.at(4) === 'true',
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a huge fan of using strings for this but understand the reasoning and the tradeoff

setLocalToken0Amount(previousActionCardState.textFields[0]);
setLocalToken1Amount(previousActionCardState.textFields[1]);
if (lower != null && upper != null && currentTick != null) {
if (shouldAmount0InputBeDisabled(lower, upper, currentTick)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is on me as I did this, but I think shouldAmount0InputBeDisabled and shouldAmount1InputBeDisabled should be in this file above this component as they aren't relevant to other actions and don't make sense to have for general Uniswap purposes. You don't need to move them, just pointing it out.

@haydenshively haydenshively merged commit 8014d91 into master Oct 26, 2022
@haydenshively haydenshively deleted the hs-clean-uniswap-actions2 branch October 26, 2022 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants