feat: render treasury cut in OrchestratorList#498
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This pull request enhances the OrchestratorList component to display and calculate the treasury reward cut, a protocol-level parameter that affects reward calculations. The changes improve the accuracy of the treasury cut calculation by using BigInt literal syntax and add a new "Protocol Data" section to the UI to surface this information to users.
Changes:
- Updated treasury cut calculation to use
10n ** 18ninstead ofBigInt(1e18)for better BigInt handling - Added formatted treasury cut display using numbro library with percentage formatting
- Added new "Protocol Data" UI section showing the treasury cut value for each orchestrator
Comments suppressed due to low confidence (1)
components/OrchestratorList/index.tsx:114
- The default value uses
BigInt(0.0)which passes a floating-point number to BigInt. This should beBigInt(0)or0nto use an integer value, as BigInt requires integer inputs.
const { data: treasuryRewardCutRate = BigInt(0.0) } = useReadContract({
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request enhances the display and calculation of the "Treasury cut" in the
OrchestratorListcomponent, ensuring it is accurately computed, formatted, and surfaced in the UI. The changes focus on improving the correctness of the treasury cut calculation and making this protocol data visible to users.Treasury cut calculation and formatting improvements:
treasuryRewardCutto useNumber(formatUnits(treasuryRewardCutRate, 27));, ensuring correct handling of BigInt division and scaling.formattedTreasuryCut) using thenumbrolibrary for percentage display.UI enhancements for protocol data: