Tokenized Bond Lifecycle Prototype

EVM-based prototype of a permissioned fixed-rate bond

Zheng Huang · Source code

1 Scope

One Solidity contract, TokenizedBond, covers the lifecycle of a permissioned fixed-rate bond: investor whitelisting, issuance, transfers, coupon payments and principal redemption. The issuer controls the whitelist, issuance and payments; investors hold, transfer and redeem units.

StageFunctionRule enforced by the contract
WhitelistingsetWhitelistedonly the issuer; zero address rejected
Issuanceissueonly the issuer, only to whitelisted investors, only before maturity
Transfertransfer, transferFromsender and receiver whitelisted; balance and allowance checked
CouponpayCoupononly on or after the coupon date, exact amount, paid pro rata
RedemptionfundRedemption, redeemfunded once at maturity with the exact amount; units burned on payment

2 Requirements

Each requirement is a user story with acceptance criteria; each criterion maps to a function and an automated test with the same ID. Full text: docs/USER_STORIES.md.

IDAcceptance criterionFunction
US1 · As the issuer, I want to maintain a whitelist of investors who passed KYC, so that only eligible parties can hold the bond.
AC1.1Only the issuer can add or remove an address.setWhitelisted
AC1.2The zero address cannot be whitelisted.setWhitelisted
AC1.3Every change emits InvestorWhitelisted.setWhitelisted
US2 · As the issuer, I want to issue units to an eligible investor, so that ownership is recorded on the ledger.
AC2.1Only the issuer can issue.issue
AC2.2Units can only be issued to whitelisted investors.issue
AC2.3Issuing zero units is rejected.issue
AC2.4Balance and total supply increase; BondIssued and Transfer are emitted.issue
AC2.5No issuance at or after maturity.issue
US3 · As an investor, I want to transfer units to another eligible investor, so that transfers stay within the permissioned group.
AC3.1A transfer between whitelisted investors updates both balances.transfer
AC3.2A transfer to a non-whitelisted address is rejected.transfer
AC3.3An investor removed from the whitelist can no longer transfer.transfer
AC3.4Transfers above the balance or of zero units are rejected.transfer
AC3.5A third party moves units only within an allowance granted by the holder.transferFrom
US4 · As the issuer, I want to pay each scheduled coupon to the current holders, so that investors receive the cash flows defined in the terms.
AC4.1Coupon per unit = face value × annual rate × interval / 365 days.couponPerUnit
AC4.2No payment before the coupon date.payCoupon
AC4.3The payment must equal coupon per unit × total supply.payCoupon
AC4.4Each holder receives coupon per unit × holding; the schedule moves to the next date.payCoupon
AC4.5Only the issuer can pay a coupon.payCoupon
US5 · As an investor, I want to redeem my units for principal at maturity, so that the bond is repaid and closed.
AC5.1Principal can be funded only at or after maturity, and only once.fundRedemption
AC5.2The funding must equal face value × total supply.fundRedemption
AC5.3Redemption before funding is rejected.redeem
AC5.4Redemption pays units × face value and burns the units.redeem
AC5.5A holder without units cannot redeem.redeem

3 Workflow

Runs against the contract on a local EVM ledger in this browser.

Loading…

InvestorWhitelistedUnitsCoupons receivedPrincipal received

3.1 Lifecycle

    3.2 Controls

    Each action below violates an acceptance criterion and must be rejected by the contract.

    IDAttemptResult

    3.3 Contract events

    4 Tests

    npm test runs 24 tests for TokenizedBond: at least one per acceptance criterion, covering the permitted path and the rejected path (permissions, payment amounts, dates and lifecycle order).

    TokenizedBond
      US0 Bond terms        AC0.1 rejects invalid terms at deployment
      US1 Eligibility       AC1.1 – AC1.3     3 tests
      US2 Issuance          AC2.1 – AC2.5     5 tests
      US3 Transfers         AC3.1 – AC3.5     5 tests
      US4 Coupon payments   AC4.1 – AC4.5     5 tests
      US5 Redemption        AC5.1 – AC5.5     5 tests
    24 passing

    5 Production gaps

    AreaPrototypeNeeded in production
    KYC/AMLBoolean whitelist set by the issuerIntegration with onboarding and identity systems, sanctions screening, shared identity registry
    DvPTransfers move units without payment; coupons and principal in native test currencyRegulated settlement asset (tokenised deposits or central bank money) and delivery versus payment
    CustodyLocal test accountsCustody wallets, HSM/MPC key management, recovery, segregation of client assets
    Treasury systemsNoneFunding plan, cash and liquidity management, accounting, regulatory reporting, reconciliation
    Legal registerNoneLegally recognised register (e.g. eWpG), terms consistent with the contract
    ServicingCoupons pushed to all holders in one loop; simplified day countRecord-date snapshots, claim-based payments, day-count and business-day conventions
    ControlsSingle issuer keyRole separation, multi-signature approval, pause, forced transfer, upgrade governance
    Privacy, assurancePublic balances; automated testsConfidentiality of positions; security audit and monitoring