Skip to content

Comments

Spike/external orchestrator lib#855

Open
marcosio wants to merge 4 commits intospike/lib-based-diamond-versionfrom
spike/external-orchestrator-lib
Open

Spike/external orchestrator lib#855
marcosio wants to merge 4 commits intospike/lib-based-diamond-versionfrom
spike/external-orchestrator-lib

Conversation

@marcosio
Copy link
Contributor

Description

Type of change

  • Bug fix 🐞
  • New feature ✨
  • Breaking change 💥
  • Documentation update 📖
  • Refactor 🔧

Testing

Node version:

  • 20
  • 22
  • 24

Checklist

  • Style Guidelines followed ✅
  • Documentation Updated 📚
  • Linters - No New Warnings ⚠️
  • Local Tests Pass ✅
  • Effective Tests Added ✔️
  • No reduction of Coverage

…ionsç

add storage accessor functions to LibSnapshots for snapshot data retrieval
add helper functions to LibClearing for clearing data management by struct
add setHoldThirdPartyByParams and getHoldThirdPartyByParams to LibHold
refactor SnapshotsFeature to use LibSnapshots accessors instead of direct storage
refactor LibClearingOps to use LibClearing helper functions
refactor LibHoldOps to use LibHold accessor functions
replace getKpiLinkedRate/getSustainabilityRate with memory-based getters
update KPI-linked and sustainability rate contracts to use new interest rate getters
remove direct storage imports from orchestrator libraries
change getClearingBasicInfo parameter from calldata to memory
format import statements in ERC3643 interface files

Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
…ations

create unified external orchestrator library for all token operations
implement transfer operations (transferByPartition, issueByPartition, redeemByPartition)
add ERC20-style wrappers (transfer, mint, burn, approve, transferFrom)
implement allowance operations with ABAF synchronization
add pre/post token transfer hooks for snapshots and voting power updates
implement total balance operations with ABAF-adjusted calculations
integrate hold operations via LibHoldOps delegation
integrate clearing operations via LibClearingOps delegation
architecture supports ~80% bytecode reduction via single deployed library with DELEGATECALL

Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
… to external libraries

- convert 4 internal orchestrator libraries to external libraries, all under 24KB EVM deployment limit
- deploy TokenCoreOps (replaces LibTokenTransfer + ERC20/allowance operations)
- deploy HoldOps (replaces LibHoldOps + LibTotalBalance - total balance reads with hold ops)
- deploy ClearingOps (replaces LibClearingOps creation + action operations)
- deploy ClearingReadOps (replaces LibClearingOps reads + absorbs ABAF prep functions)
- delete obsolete internal libraries: LibTokenTransfer.sol, LibTotalBalance.sol, LibHoldOps.sol, LibClearingOps.sol, TokenOrchestrator.sol
- all 4 new libraries compile successfully under Ethereum 24KB contract size limit diff.patch

Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
@marcosio marcosio requested review from a team as code owners February 24, 2026 14:52
@marcosio marcosio requested a review from Neurone February 24, 2026 14:52
@hedera-eng-infrastructure
Copy link

hedera-eng-infrastructure commented Feb 24, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

…ibraries

      This commit exposes errors and events in facet interfaces to support the
      external orchestrator library pattern. When errors and events are defined
      in external libraries, they need to be exposed in the facet interfaces
      for proper ABI generation and test compatibility.

      Changes:
      - Add RedeemedByPartition event to IBond for bond redemption operations
      - Add TransferByPartition event to IERC3643, IERC1594, IERC1644, ITransferAndLock
      - Add Transfer event to IERC1594 for ERC20-style transfers
      - Add InsufficientBalance error to IERC20 for balance validation
      - Add InvalidPartition error to IERC1594 for partition validation
      - Add WrongExpirationTimestamp error to IClearing for clearing operations
      - Add hold-specific errors to IHoldTokenHolder (HoldExpirationNotReached,
        WrongHoldId, InvalidDestinationAddress, InsufficientHoldBalance,
        HoldExpirationReached, IsNotEscrow)
      - Make IClearingActions inherit from IClearing to expose clearing errors
      - Make IHoldTokenHolder inherit from IClearing to expose expiration errors
      - Update LibHold and HoldOps to reference IHoldTokenHolder for error definitions

      Test Results:
      - Baseline: 1257 passing, 0 failing
      - Current: 1246 passing, 11 failing

      Remaining failures are related to event emission detection in tests and
      error format expectations, which require further investigation.

Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants