Space Asset Ownership Contract

What it does:
Allows users to mint, buy, sell, and manage ownership of space-related assets (satellites, modules, or virtual space land) as NFTs with verifiable provenance and royalties.

Why it matters:
Ensures transparent ownership of valuable or unique space assets, enables monetization, prevents disputes, and supports the growing space economy ecosystem.

How it works:

  • Space assets are minted as NFTs with metadata describing type, orbit, coordinates, and features

  • Ownership can be transferred or sold with automatic royalty payments to creators or developers

  • Supports collaborative ownership or fractionalized space assets

  • Integrates with Virtual Land Ownership, Gaming Asset Ownership, or Play-to-Earn Reward Engine

  • Dashboards show owned assets, transaction history, and royalties earned

  • Ensures authenticity and uniqueness of space assets via on-chain verification

      // SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @title SpaceAssetOwnership
 * @author Nam
 * @notice Manages space-related assets as NFTs with ownership and royalty management
 */
contract SpaceAssetOwnership is ERC721, Ownable {

    struct SpaceAsset {
        string metadataURI; // e.g., satellite info, module specs, coordinates
        address creator;
        uint256 royaltyPercent; // 0-100
    }

    mapping(uint256 => SpaceAsset) public assets;
    uint256 public assetCount;

    // -------------------- EVENTS --------------------

    event AssetMinted(uint256 indexed assetId, address owner, string metadataURI, uint256 royaltyPercent);
    event AssetTransferred(uint256 indexed assetId, address from, address to, uint256 salePrice, uint256 royaltyPaid);

    // -------------------- CONSTRUCTOR --------------------

    constructor() ERC721("SpaceAsset", "SPC") {}

    // -------------------- ASSET MANAGEMENT --------------------

    function mintAsset(string calldata _metadataURI, uint256 _royaltyPercent) external {
        require(_royaltyPercent  0) {
            payable(a.creator).transfer(royaltyAmount);
        }

        payable(msg.sender).transfer(sellerAmount);

        _safeTransfer(msg.sender, _to, _assetId, "");

        emit AssetTransferred(_assetId, msg.sender, _to, _salePrice, royaltyAmount);
    }

    // -------------------- VIEW FUNCTIONS --------------------

    function getAsset(uint256 _assetId) external view returns (SpaceAsset memory) {
        return assets[_assetId];
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        return assets[tokenId].metadataURI;
    }
}