Chore: Adding new field to the return all treasuries - fe need it#278
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the getAllTreasuryBalances view in the Soulbound Rewards/Treasury flow to also return a tokenIds array, enabling callers (notably FE) to distinguish ERC1155 assets by token ID while keeping ERC20/ERC721 tokenIds as 0.
Changes:
- Updated
Rewards.getAllTreasuryBalances()andTreasury.getAllTreasuryBalances()to return an additionaluint256[] tokenIds. - Updated Treasury’s ERC1155 aggregation to populate
tokenIdsper unique(contract, tokenId)pair. - Updated
rewardsSoulbound.test.tsassertions to validatetokenIdsfor empty / ERC20 / ERC1155 and mixed scenarios.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
contracts/upgradeables/soulbounds/Rewards.sol |
Extends Rewards’ delegated treasury balance getter to include tokenIds in the return tuple and docs. |
contracts/upgradeables/soulbounds/Treasury.sol |
Allocates/fills tokenIds and threads it through ERC1155 processing; updates return signature accordingly. |
test/rewardsSoulbound.test.ts |
Adds test assertions to validate the new tokenIds field across several scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Chore: Adding new field to the return all treasuries - fe need it
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
karacurt
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: resolves
🐵 Description
This pull request enhances the
getAllTreasuryBalancesfunctionality in the Rewards and Treasury contracts to include token IDs for all treasury assets. This addition provides more granular information about each token, especially for ERC1155 tokens, and updates the related tests to ensure correctness.Smart Contract Enhancements:
getAllTreasuryBalancesfunction in bothRewards.solandTreasury.solnow returns an additional array,tokenIds, which contains the token ID for each asset (0 for ERC20/ERC721, actual token ID for ERC1155). [1] [2] [3]Treasury.solis updated to populate thetokenIdsarray appropriately for each token type, including modifications to the ERC1155 processing function to handle token IDs. [1] [2] [3] [4]Testing Improvements:
rewardsSoulbound.test.tsis updated to assert the correct handling and values of the newtokenIdsfield for all token types, ensuring the changes are verified across different scenarios. [1] [2] [3] [4] [5]🙊 Checklist: