Skip to content

Conversation

@LaGodxy
Copy link
Contributor

@LaGodxy LaGodxy commented Jan 21, 2026

Description

This PR introduces the foundational Asset Registry smart contract built with Soroban (Stellar smart contracts). The contract serves as the decentralized source of truth for on-chain asset records, supporting asset registration, ownership tracking, immutable history, and emergency controls. It establishes the core infrastructure required for managing tokenized assets securely and transparently.

Related Issues

Closes #370

Changes Made

  • Implemented asset registry mapping (asset_id → Asset) with optimized storage
  • Implemented owner registry mapping (owner → asset_ids) for reverse lookups
  • Added contract initialization with admin address, metadata, and versioning
  • Implemented asset registration with validation and authorization checks
  • Added asset metadata updates restricted to asset owner or admin
  • Implemented secure asset ownership transfer with atomicity guarantees
  • Added asset retirement/deactivation functionality
  • Implemented read-only query functions (by asset ID, by owner, total count)
  • Added admin-only functions (admin update, pause/unpause contract)
  • Implemented pause state to block write operations during emergencies
  • Emitted events for all state-changing operations (register, transfer, update, retire, admin changes)
  • Added validation rules for asset uniqueness, ownership, metadata, and values
  • Optimized storage usage using Soroban SDK data structures (Map, Vec)

How to Test

  1. Deploy the contract to Stellar testnet using Soroban CLI

  2. Initialize the contract with an admin address

  3. Register a new asset and verify:

    • Asset is stored correctly
    • AssetRegistered event is emitted
  4. Query the asset by ID and by owner address

  5. Transfer asset ownership and confirm:

    • Ownership mappings update correctly
    • AssetTransferred event is emitted
  6. Update asset metadata as owner/admin and verify authorization enforcement

  7. Retire an asset and confirm status update and event emission

  8. Pause the contract and ensure all write operations are blocked

  9. Unpause the contract and verify normal operation resumes

  10. Test invalid scenarios (duplicate asset ID, unauthorized access, paused state)

Screenshots (if applicable)

N/A (Smart contract implementation)

Checklist

  • My code follows the project's coding style
  • I have tested these changes locally and on Stellar testnet
  • Documentation has been updated where necessary

@vercel
Copy link

vercel bot commented Jan 21, 2026

@LaGodxy is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@yusuftomilola yusuftomilola merged commit 88bb52c into DistinctCodes:main Jan 24, 2026
0 of 5 checks passed
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.

Implement Core Asset Registry Smart Contract

2 participants