-
Notifications
You must be signed in to change notification settings - Fork 427
feat: claim rewards #2598
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
base: main
Are you sure you want to change the base?
feat: claim rewards #2598
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
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.
reviewing code i think i don't have rewards to claim and test all flows
@@ -33,7 +33,7 @@ | |||
"dependencies": { | |||
"@aave/contract-helpers": "1.36.1", | |||
"@aave/math-utils": "1.36.1", | |||
"@aave/react": "^0.4.0", | |||
"@aave/react": "canary", |
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.
would rather a specific version to avoid issues on updates
// Calculate merit rewards USD value | ||
const meritRewardsUsd = | ||
meritClaimRewards?.rewards?.reduce((total, reward) => { | ||
return total + Number(reward.amount.usd || 0); |
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.
if we dont get a usd value shouldn't we return undefined/hide to avoid invalid values?
const isClaimingAll = selectedReward.symbol === 'all'; | ||
const isClaimingMeritAll = selectedReward.symbol === 'merit-all'; | ||
const isClaimingProtocolAll = selectedReward.symbol === 'protocol-all'; |
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.
we are using those keys in multiple places i'd say to use an enum
calls.push({ | ||
target: tx.to, | ||
callData: tx.data, | ||
value: tx.value || '0', |
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.
just double checking we are sending tx.value here and in return we set value to zero
|
||
return { | ||
gasLimit: estimatedTx.gasLimit?.toString(), | ||
gasPrice: '0', |
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.
not sure where is this being used by pointing out gasPrice 0
claimType: 'all', | ||
protocolRewardsCount, | ||
meritRewardsCount, | ||
totalRewardsCount: protocolRewardsCount + meritRewardsCount, |
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.
worth it to add usd value to compare with the next one?
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.
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.
General Changes
Developer Notes
Add any notes here that may be helpful for reviewers.
Reviewer Checklist
Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur.
.env.example
file as well as the pertinant.github/actions/*
files