refactor(erc1410): introduce balance and supply helper methods#833
Merged
marcosio merged 9 commits intodevelopmentfrom Feb 16, 2026
Merged
refactor(erc1410): introduce balance and supply helper methods#833marcosio merged 9 commits intodevelopmentfrom
marcosio merged 9 commits intodevelopmentfrom
Conversation
- rename storage fields and to and in ERC1410BasicStorage - replace direct balance updates with and methods - add and methods for total supply adjustments - remove redundant and implementations from ERC1410BasicStorageWrapperRead - update to handle migration from legacy storage to new balance/supply helpers - add to Internals abstract contract - add visibility override in ERC20StorageWrapper2 - fix ProtectedPartitions initialize function to assign return value to success_ Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…ategy - create MigrationFacetTest contract for testing legacy ERC1410 storage - rename _totalSupply_ to DEPRECATED_totalSupply and _balances_ to DEPRECATED_balances in ERC1410BasicStorage - implement internal migration functions _migrateTotalSupplyIfNeeded and _migrateBalanceIfNeeded in ERC20StorageWrapper1 - add view functions to check legacy vs new storage state - update _totalSupply and _balanceOf to prioritize legacy storage then fall back to new storage - add comprehensive test suite for migration scenarios including transfer-triggered migration and idempotency - create registerMigrationFacetFixture for test setup - refactor variable names in existing tests to avoid naming conflicts - remove unused imports and console.log statements Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
- add registerMigrationFacetFixture for ERC20 storage migration testing - implement _migrateTotalSupplyIfNeeded and _migrateBalanceIfNeeded functions - emit Transfer events in ERC3643, Lock, Hold, and Clearing storage wrappers - update ERC1410 storage variable names to DEPRECATED_totalSupply and DEPRECATED_balances - add comprehensive ERC20 storage migration test suite - update atsRegistry.data.ts with new event signature for ERC1410BasicStorageWrapper - reorder TransferByPartition emission in ERC1410BasicStorageWrapper Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
…RC20 Signed-off-by: Marcos Serradilla Diez <marcos@io.builders> # Conflicts: # packages/ats/contracts/scripts/domain/atsRegistry.data.ts
…RC20 Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
…justment execution - add important note about on-chain view methods immediately reflecting adjusted amounts - document event emission delay until next on-chain operation - specify that backend systems may show mismatched balances during the interim window - recommend periodic reconciliation with on-chain view methods around execution dates Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
AlbertoMolinaIoBuilders
approved these changes
Feb 13, 2026
… method replace _emitTransferEvent calls with direct emit Transfer statements in ERC20StorageWrapper2 remove _emitTransferEvent function from Internals base contract update clearing, hold, lock, and ERC3643 storage wrappers to use direct event emission maintain identical functionality while reducing code complexity Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
…tion strategy add totalSupply and balances fields to ERC20Storage struct in ERC20StorageWrapper1 implement _migrateTotalSupplyIfNeeded and _migrateBalanceIfNeeded lazy migration functions maintain backward compatibility with legacy ERC1410BasicStorage values rename totalSupply to DEPRECATED_totalSupply and balances to DEPRECATED_balances replace _emitTransferEvent wrapper with direct emit Transfer statements add _increaseBalance, _reduceBalance, _increaseTotalSupply, _reduceTotalSupply helper methods add MigrationFacetTest contract for testing migration scenarios achieve ~50-70 gas savings per transfer from simplified event emission Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
…nd implement resolver key change base contract from ERC20StorageWrapper1 to Common remove abstract keyword to make contract deployable for testing add getStaticResolverKey function returning keccak256(MigrationFacetTest) Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
ruben-martinez-iob
pushed a commit
that referenced
this pull request
Feb 16, 2026
Signed-off-by: Marcos Serradilla Diez <marcos@io.builders> Signed-off-by: Ruben Martinez <ruben.martinez@io.builders>
jaime-iobermudez
pushed a commit
that referenced
this pull request
Feb 27, 2026
Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
jaime-iobermudez
pushed a commit
that referenced
this pull request
Mar 2, 2026
Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
jaime-iobermudez
pushed a commit
that referenced
this pull request
Mar 2, 2026
Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
jaime-iobermudez
pushed a commit
that referenced
this pull request
Mar 3, 2026
Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
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.
Description
Type of change
Testing
Node version:
Checklist