-
Notifications
You must be signed in to change notification settings - Fork 18
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
refactor(tangle-dapp): Integrate bridge ERC-20 tokens into restaking #2783
refactor(tangle-dapp): Integrate bridge ERC-20 tokens into restaking #2783
Conversation
β Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Progress:
|
@yurixander I was able to bridge CleanShot.2025-02-01.at.12.23.24.mp4As we discussed, these issues need to be addressed:
Otherwise, LGTM! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments.
}), | ||
); | ||
return Object.entries(delegatorInfo.deposits).map(([assetIdString]) => { | ||
const availableForWithdrawal = calculateRestakeAvailableBalance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend has a field called delegated_amount
that indicates the total delegated amount, which can be used to calculate the available balance.
This issue has been addressed in PR #2788.
(delegation) => delegation.assetId === selectedAsset.id, | ||
)?.amountBonded ?? ZERO_BIG_INT; | ||
|
||
const availableBalance = amountBigInt - delegatedBigInt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend has a field called delegated_amount
that indicates the total delegated amount, which can be used to calculate the available balance.
This issue has been addressed in PR #2788.
(delegation) => delegation.assetId === assetId, | ||
)?.amountBonded ?? ZERO_BIG_INT; | ||
|
||
const balance = new BN((amount - delegatedAmount).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend has a field called delegated_amount
that indicates the total delegated amount, which can be used to calculate the available balance.
This issue has been addressed in PR #2788.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AtelyPham I tested with these calculations, and everything seems to be in order, including after you deposit, delegate, withdraw, etc. all the values updated accordingly. Just to make sure, that's the same case for when you used delegated_amount
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ Also these tests were done with local dev on latest Tangle node changes, since testnet has different / incorrect values which seem to have been fixed on newer node updates.
return {}; | ||
} | ||
|
||
const depositedAsset = Object.entries(delegatorInfo.deposits).find( | ||
([assetId]) => assetId === selectedAssetId, | ||
const availableBalance = calculateRestakeAvailableBalance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend has a field called delegated_amount
that indicates the total delegated amount, which can be used to calculate the available balance.
This issue has been addressed in PR #2788.
Conflicts here |
@devpavan04 and I are seeing different TVL for WETH restake vault here, both on your latest open PR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- to address [BUG] Fix Network Detection + Asset Rendering IssueΒ #2765, let's also remove this selector so user cannot switch network from here. What's displayed here should always be synchronized with the network user is connected to, as displayed in top nav.
![Screenshot 2025-02-03 at 3 44 21β―PM](https://private-user-images.githubusercontent.com/109539270/409007605-cfb961a3-80d2-45ac-9e87-2304db8d6135.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NzE0NTQsIm5iZiI6MTczOTY3MTE1NCwicGF0aCI6Ii8xMDk1MzkyNzAvNDA5MDA3NjA1LWNmYjk2MWEzLTgwZDItNDVhYy05ZTg3LTIzMDRkYjhkNjEzNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwMTU5MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02MjUzYzU2NGYwOTA2NzU2Zjk2NTMzMTI3OTBmM2Y2ZmRmYzkyODczMWNhNmQ0ZDVmYWY5NzdhN2RhYTEyODZmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.sWczhicWDAXWIVvU543P28y9BNkg42k7eTLRQZcASoQ)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated display in this PR reduces the "Deposits" amount when tokens are delegated, which could be misleading since it doesn't reflect the actual total deposits.
Proposing we modify the display to:
- always show the total deposits as the primary number
- show delegation info as secondary info (on hover), and make it clear that delegation is a subset of the total deposits rather than a reduction of deposits.
I think this better reflects our system's behavior where delegation is simply a action perform on deposited tokens, not a separate pool of tokens. Thoughts?
![Screenshot 2025-02-03 at 4 49 16β―PM](https://private-user-images.githubusercontent.com/109539270/409030822-ff933850-eb8d-4f93-bc05-ae3d944936bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NzE0NTQsIm5iZiI6MTczOTY3MTE1NCwicGF0aCI6Ii8xMDk1MzkyNzAvNDA5MDMwODIyLWZmOTMzODUwLWViOGQtNGY5My1iYzA1LWFlM2Q5NDQ5MzZiYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwMTU5MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xYWI3NThlZGYxZmU4YzNhNThkMTg2YzE0OTAxY2IzMTVhYjY3YjI2YmYxNzcxZjg2OWFhMjVmM2JmZTI4Y2NkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.6QVG9kGGPBHckbM1hZu3gOd3AlhdxVcaUXwP152k9Mg)
Summary of changes
Provide a detailed description of proposed changes.
Proposed area of change
Put an
x
in the boxes that apply.apps/tangle-dapp
apps/tangle-cloud
libs/tangle-shared-ui
libs/webb-ui-components
Associated issue(s)
Specify any issues that can be closed from these changes (e.g.
Closes #233
).Screen Recording
If possible provide screenshots and/or a screen recording of proposed change.