Skip to content

Conversation

@AlbertoMolinaIoBuilders
Copy link
Contributor

@AlbertoMolinaIoBuilders AlbertoMolinaIoBuilders commented Nov 18, 2025

Description

This pull request introduces a new feature for full bond redemption at maturity, allowing all of a token holder's bond partitions to be redeemed in a single transaction. The change is implemented across the smart contract, SDK, and test suite, and includes updates to the interface, function selectors, and registry. Comprehensive tests are added to ensure correct behavior and error handling for the new method.

Feature Addition: Full Redeem at Maturity

  • Added fullRedeemAtMaturity function to the Bond smart contract, enabling redemption of all partitions for a token holder at maturity with appropriate access control and validation checks.
  • Updated IBond interface to include the new fullRedeemAtMaturity(address) method, with documentation.

Integration and Registry Updates

  • Registered the new function selector for fullRedeemAtMaturity in BondUSAFacet and updated the facet registry data for contract discovery and integration. [1] [2]

SDK and Fixture Enhancements

  • Added FullRedeemAtMaturityCommand and FullRedeemAtMaturityRequest fixtures to the SDK for testing and integration purposes. [1] [2] [3]

Comprehensive Testing

  • Extended the bond contract test suite to cover the new full redemption method, including success scenarios and all relevant error conditions (e.g., invalid address, blocked account, missing role, paused token, invalid KYC, premature redemption, recovered wallet, and multi-partition support). [1] [2] [3] [4] [5]

Release Notes

  • Updated the changeset to reflect minor/patch releases for relevant packages and document the addition of the full redeem at maturity method.

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

@hedera-eng-infrastructure
Copy link

hedera-eng-infrastructure commented Nov 18, 2025

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.

Signed-off-by: Alberto Molina <[email protected]>
Signed-off-by: Alberto Molina <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new fullRedeemAtMaturity feature that enables redeeming all bond tokens at maturity across all partitions for a specified token holder. This complements the existing redeemAtMaturityByPartition method which only redeems from a single partition.

Key changes:

  • New smart contract function fullRedeemAtMaturity in Bond contract with proper validations
  • SDK integration with transaction adapters, command handlers, and request models
  • Comprehensive test coverage at both contract and SDK levels

Reviewed Changes

Copilot reviewed 16 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Bond.sol Implements core fullRedeemAtMaturity logic to iterate through all partitions and redeem balances
IBond.sol Adds interface definition for the new function
BondUSAFacet.sol Registers the function selector in the facet
RPCTransactionAdapter.ts Implements RPC adapter for the transaction
HederaTransactionAdapter.ts Implements Hedera adapter for the transaction
TransactionAdapter.ts Adds abstract method signature
FullRedeemAtMaturityRequest.ts Defines request validation model
FullRedeemAtMaturityCommand.ts Defines command and response objects
FullRedeemAtMaturityCommandHandler.ts Implements command execution logic
FullRedeemAtMaturityCommandError.ts Defines error handling
Bond.ts Integrates new method into Bond API
bond.test.ts Adds comprehensive contract tests
Bond.unit.test.ts Adds SDK unit tests
BondFixture.ts Adds test fixtures
Constants.ts Adds gas constant

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AlbertoMolinaIoBuilders AlbertoMolinaIoBuilders marked this pull request as ready for review November 19, 2025 08:28
@AlbertoMolinaIoBuilders AlbertoMolinaIoBuilders merged commit 0a0f427 into develop Nov 19, 2025
11 checks passed
@AlbertoMolinaIoBuilders AlbertoMolinaIoBuilders deleted the feat/BBND-1246-RedeemAllAtMaturity branch November 19, 2025 08:28
themariofrancia pushed a commit that referenced this pull request Dec 9, 2025
themariofrancia pushed a commit that referenced this pull request Dec 10, 2025
themariofrancia pushed a commit that referenced this pull request Dec 10, 2025
Signed-off-by: Alberto Molina <[email protected]>
Signed-off-by: Mario Francia <[email protected]>
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.

4 participants