Numen Mainnet

EVM address

Contract
0x7d18495c10570a39a7046b6c5a4b0840f6f71967
Mapped substrate accountnu5UGJgQXW6W8qUbwpuCXkysg51DXSCWVvyh1fUvWMePLf2k4both ways, balances live there
Status
Exact match
Compiler
solc 0.8.24+commit.e11b9ed9
Optimizer
200 runs
EVM version
istanbul
Contract
contracts/assets/object/NumenObjectBinding.sol:NumenObjectBinding
Verified
3d ago | 2026-11-29 18:32:35 (UTC)
Verifier
Creation tx
Creation code
contracts/assets/object/NumenObjectBinding.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "../interfaces/INumenAssetRegistry.sol";
import "../libraries/NumenAssetTypes.sol";

/**
 * @title INumenObjectRegistryBindingView
 * @notice Minimal Object Registry interface required by
 *         NumenObjectBinding.
 */
interface INumenObjectRegistryBindingView {
    struct ObjectRecord {
        bytes32 objectId;

        address creator;
        address controller;

        string modelURI;
        bytes32 modelHash;
        string modelFormat;

        bytes32 spectralFingerprint;
        string spectralAlgorithm;
        string spectralVersion;

        string metadataURI;
        bytes32 metadataHash;

        uint64 createdAt;
        uint64 updatedAt;

        bool active;
    }

    function objectExists(
        bytes32 objectId
    )
        external
        view
        returns (bool);

    function isObjectActive(
        bytes32 objectId
    )
        external
        view
        returns (bool);

    function getObject(
        bytes32 objectId
    )
        external
        view
        returns (
            ObjectRecord memory
        );
}

/**
 * @title NumenObjectBinding
 * @notice Bilateral-consent relationship layer between
 *         Numen Asset IDs and Numen Object IDs.
 *
 * DESIGN
 * =============================================================
 *
 * Asset identity and Object identity remain independent.
 *
 * One Object ID may be referenced by multiple assets:
 *
 * Physical Object
 *      |
 *      +-- ERC721 Digital Twin
 *      +-- ERC20 Fractional Interest
 *      +-- ERC721 Certificate
 *      +-- ERC1155 Usage Rights
 *
 * CONSENT MODEL
 * =============================================================
 *
 * If Asset controller == Object controller:
 *
 *     bindObject(...)
 *
 * may create the relationship immediately.
 *
 * If controllers are different:
 *
 *     proposeBinding(...)
 *             |
 *             v
 *     acceptBinding(...)
 *
 * is required.
 *
 * Either side may create the proposal.
 * Only the opposite current controller may accept it.
 *
 * REVOCATION
 * =============================================================
 *
 * Either current controller may deactivate an active binding.
 *
 * This is intentionally unilateral because a relationship should
 * not remain represented as active after either side withdraws
 * consent.
 *
 * REACTIVATION
 * =============================================================
 *
 * Reactivation follows the same consent model as creation:
 *
 * - same controller on both sides -> immediate
 * - different controllers -> proposal + acceptance
 *
 * CONTROLLER CHANGES
 * =============================================================
 *
 * Pending proposals store controller snapshots.
 *
 * Acceptance requires the controllers to still match those
 * snapshots. If either controller changed after the proposal was
 * created, the proposal becomes stale and cannot be accepted.
 *
 * A new proposal must then be created using the current
 * controllers.
 *
 * SEMANTIC BOUNDARY
 * =============================================================
 *
 * A binding means only:
 *
 *   "This Numen Asset record references this Numen Object record."
 *
 * It does NOT prove:
 *
 * - physical existence,
 * - authenticity,
 * - legal ownership,
 * - custody,
 * - possession,
 * - manufacturer origin,
 * - provenance,
 * - correctness of a 3D model,
 * - correctness of a spectral fingerprint.
 *
 * Those claims belong to separate attestation, document and
 * provenance layers.
 */
contract NumenObjectBinding {
    // =============================================================
    // ERRORS
    // =============================================================

    error ZeroAddress();

    error AssetNotFound(
        bytes32 assetId
    );

    error AssetInactive(
        bytes32 assetId
    );

    error ObjectNotFound(
        bytes32 objectId
    );

    error ObjectInactive(
        bytes32 objectId
    );

    error UnauthorizedAssetController(
        address caller,
        bytes32 assetId
    );

    error UnauthorizedObjectController(
        address caller,
        bytes32 objectId
    );

    error UnauthorizedBindingParty(
        address caller,
        bytes32 assetId,
        bytes32 objectId
    );

    error BindingAlreadyExists(
        bytes32 bindingId
    );

    error BindingNotFound(
        bytes32 bindingId
    );

    error BindingAlreadyActive(
        bytes32 bindingId
    );

    error BindingAlreadyInactive(
        bytes32 bindingId
    );

    error ProposalAlreadyExists(
        bytes32 bindingId
    );

    error ProposalNotFound(
        bytes32 bindingId
    );

    error ProposalAlreadyAcceptedByCaller(
        bytes32 bindingId,
        address caller
    );

    error ProposalControllerMismatch(
        bytes32 bindingId
    );

    error SameControllerCanBindDirectly();

    error InvalidIndex();

    // =============================================================
    // EVENTS
    // =============================================================

    event BindingProposed(
        bytes32 indexed bindingId,
        bytes32 indexed assetId,
        bytes32 indexed objectId,
        NumenAssetTypes.ObjectLinkType linkType,
        address proposer,
        address assetController,
        address objectController
    );

    event BindingProposalCancelled(
        bytes32 indexed bindingId,
        address indexed cancelledBy
    );

    event BindingProposalAccepted(
        bytes32 indexed bindingId,
        address indexed acceptedBy
    );

    event ObjectBound(
        bytes32 indexed bindingId,
        bytes32 indexed assetId,
        bytes32 indexed objectId,
        NumenAssetTypes.ObjectLinkType linkType,
        address activatedBy
    );

    event ObjectUnbound(
        bytes32 indexed bindingId,
        bytes32 indexed assetId,
        bytes32 indexed objectId,
        address unboundBy
    );

    event ObjectRebound(
        bytes32 indexed bindingId,
        bytes32 indexed assetId,
        bytes32 indexed objectId,
        address reboundBy
    );

    // =============================================================
    // STRUCTS
    // =============================================================

    struct BindingRecord {
        bytes32 bindingId;

        bytes32 assetId;
        bytes32 objectId;

        NumenAssetTypes.ObjectLinkType linkType;

        address createdBy;

        uint64 createdAt;
        uint64 updatedAt;

        bool active;
    }

    struct BindingProposal {
        bytes32 bindingId;

        bytes32 assetId;
        bytes32 objectId;

        NumenAssetTypes.ObjectLinkType linkType;

        address proposer;

        address assetController;
        address objectController;

        uint64 createdAt;

        bool exists;
    }

    // =============================================================
    // IMMUTABLES
    // =============================================================

    INumenAssetRegistry
        public immutable assetRegistry;

    INumenObjectRegistryBindingView
        public immutable objectRegistry;

    // =============================================================
    // CONSTANTS
    // =============================================================

    bytes32 private constant
        _OBJECT_BINDING_VERSION =
            keccak256(
                "NUMEN_OBJECT_BINDING_V2"
            );

    // =============================================================
    // STORAGE
    // =============================================================

    mapping(
        bytes32 =>
            BindingRecord
    )
        private _bindings;

    mapping(
        bytes32 =>
            bool
    )
        private _bindingExists;

    mapping(
        bytes32 =>
            BindingProposal
    )
        private _proposals;

    bytes32[]
        private _allBindingIds;

    mapping(
        bytes32 =>
            bytes32[]
    )
        private _assetBindingIds;

    mapping(
        bytes32 =>
            bytes32[]
    )
        private _objectBindingIds;

    // =============================================================
    // CONSTRUCTOR
    // =============================================================

    constructor(
        address assetRegistry_,
        address objectRegistry_
    ) {
        if (
            assetRegistry_ ==
                address(0) ||
            objectRegistry_ ==
                address(0)
        ) {
            revert ZeroAddress();
        }

        assetRegistry =
            INumenAssetRegistry(
                assetRegistry_
            );

        objectRegistry =
            INumenObjectRegistryBindingView(
                objectRegistry_
            );
    }

    // =============================================================
    // VERSION
    // =============================================================

    function objectBindingVersion()
        external
        pure
        returns (bytes32)
    {
        return
            _OBJECT_BINDING_VERSION;
    }

    // =============================================================
    // DIRECT BIND
    // =============================================================

    /**
     * @notice Creates a binding immediately when the same address
     *         currently controls both Asset and Object.
     *
     * @dev
     * When controllers differ, proposeBinding + acceptBinding
     * must be used instead.
     */
    function bindObject(
        bytes32 assetId,
        bytes32 objectId,
        NumenAssetTypes.ObjectLinkType linkType
    )
        external
        returns (
            bytes32 bindingId
        )
    {
        (
            address assetController,
            address objectController
        ) =
            _getActiveControllers(
                assetId,
                objectId
            );

        if (
            assetController !=
                msg.sender
        ) {
            revert UnauthorizedAssetController(
                msg.sender,
                assetId
            );
        }

        if (
            objectController !=
                msg.sender
        ) {
            revert UnauthorizedObjectController(
                msg.sender,
                objectId
            );
        }

        bindingId =
            getBindingId(
                assetId,
                objectId,
                linkType
            );

        if (
            _bindingExists[
                bindingId
            ]
        ) {
            revert BindingAlreadyExists(
                bindingId
            );
        }

        _clearProposal(
            bindingId
        );

        _createBinding(
            bindingId,
            assetId,
            objectId,
            linkType,
            msg.sender
        );
    }

    // =============================================================
    // PROPOSE BINDING
    // =============================================================

    /**
     * @notice Creates a bilateral binding proposal.
     *
     * Either the current Asset controller or current Object
     * controller may create the proposal.
     *
     * If both records have the same controller, bindObject()
     * should be used instead.
     */
    function proposeBinding(
        bytes32 assetId,
        bytes32 objectId,
        NumenAssetTypes.ObjectLinkType linkType
    )
        external
        returns (
            bytes32 bindingId
        )
    {
        (
            address assetController,
            address objectController
        ) =
            _getActiveControllers(
                assetId,
                objectId
            );

        if (
            msg.sender !=
                assetController &&
            msg.sender !=
                objectController
        ) {
            revert UnauthorizedBindingParty(
                msg.sender,
                assetId,
                objectId
            );
        }

        if (
            assetController ==
                objectController
        ) {
            revert SameControllerCanBindDirectly();
        }

        bindingId =
            getBindingId(
                assetId,
                objectId,
                linkType
            );

        if (
            _bindingExists[
                bindingId
            ] &&
            _bindings[
                bindingId
            ].active
        ) {
            revert BindingAlreadyActive(
                bindingId
            );
        }

        if (
            _proposals[
                bindingId
            ].exists
        ) {
            revert ProposalAlreadyExists(
                bindingId
            );
        }

        _proposals[
            bindingId
        ] =
            BindingProposal({
                bindingId:
                    bindingId,

                assetId:
                    assetId,

                objectId:
                    objectId,

                linkType:
                    linkType,

                proposer:
                    msg.sender,

                assetController:
                    assetController,

                objectController:
                    objectController,

                createdAt:
                    uint64(
                        block.timestamp
                    ),

                exists:
                    true
            });

        emit BindingProposed(
            bindingId,
            assetId,
            objectId,
            linkType,
            msg.sender,
            assetController,
            objectController
        );
    }

    // =============================================================
    // ACCEPT PROPOSAL
    // =============================================================

    /**
     * @notice Accepts a bilateral binding proposal.
     *
     * The accepting address must be the opposite controller from
     * the proposer.
     *
     * Controller snapshots must still match current Registry
     * controllers.
     */
    function acceptBinding(
        bytes32 bindingId
    )
        external
    {
        BindingProposal
            memory proposal =
                _requireProposal(
                    bindingId
                );

        (
            address currentAssetController,
            address currentObjectController
        ) =
            _getActiveControllers(
                proposal.assetId,
                proposal.objectId
            );

        if (
            currentAssetController !=
                proposal.assetController ||
            currentObjectController !=
                proposal.objectController
        ) {
            revert ProposalControllerMismatch(
                bindingId
            );
        }

        if (
            msg.sender ==
                proposal.proposer
        ) {
            revert ProposalAlreadyAcceptedByCaller(
                bindingId,
                msg.sender
            );
        }

        bool proposerIsAssetController =
            proposal.proposer ==
                proposal.assetController;

        bool proposerIsObjectController =
            proposal.proposer ==
                proposal.objectController;

        if (
            proposerIsAssetController
        ) {
            if (
                msg.sender !=
                    proposal.objectController
            ) {
                revert UnauthorizedObjectController(
                    msg.sender,
                    proposal.objectId
                );
            }
        } else if (
            proposerIsObjectController
        ) {
            if (
                msg.sender !=
                    proposal.assetController
            ) {
                revert UnauthorizedAssetController(
                    msg.sender,
                    proposal.assetId
                );
            }
        } else {
            revert UnauthorizedBindingParty(
                proposal.proposer,
                proposal.assetId,
                proposal.objectId
            );
        }

        delete _proposals[
            bindingId
        ];

        emit BindingProposalAccepted(
            bindingId,
            msg.sender
        );

        if (
            !_bindingExists[
                bindingId
            ]
        ) {
            _createBinding(
                bindingId,
                proposal.assetId,
                proposal.objectId,
                proposal.linkType,
                proposal.proposer
            );
        } else {
            BindingRecord
                storage bindingRecord =
                    _bindings[
                        bindingId
                    ];

            if (
                bindingRecord.active
            ) {
                revert BindingAlreadyActive(
                    bindingId
                );
            }

            bindingRecord.active =
                true;

            bindingRecord.updatedAt =
                uint64(
                    block.timestamp
                );

            emit ObjectRebound(
                bindingId,
                bindingRecord.assetId,
                bindingRecord.objectId,
                msg.sender
            );
        }
    }

    // =============================================================
    // CANCEL PROPOSAL
    // =============================================================

    /**
     * @notice Cancels a pending proposal.
     *
     * Either current controller or the original proposer may cancel.
     */
    function cancelBindingProposal(
        bytes32 bindingId
    )
        external
    {
        BindingProposal
            memory proposal =
                _requireProposal(
                    bindingId
                );

        (
            address currentAssetController,
            address currentObjectController
        ) =
            _getActiveControllers(
                proposal.assetId,
                proposal.objectId
            );

        if (
            msg.sender !=
                proposal.proposer &&
            msg.sender !=
                currentAssetController &&
            msg.sender !=
                currentObjectController
        ) {
            revert UnauthorizedBindingParty(
                msg.sender,
                proposal.assetId,
                proposal.objectId
            );
        }

        delete _proposals[
            bindingId
        ];

        emit BindingProposalCancelled(
            bindingId,
            msg.sender
        );
    }

    // =============================================================
    // UNBIND
    // =============================================================

    /**
     * @notice Deactivates an active relationship.
     *
     * @dev
     * Either current Asset controller OR current Object controller
     * may revoke consent and deactivate the relationship.
     *
     * History remains stored.
     */
    function unbindObject(
        bytes32 bindingId
    )
        external
    {
        if (
            !_bindingExists[
                bindingId
            ]
        ) {
            revert BindingNotFound(
                bindingId
            );
        }

        BindingRecord
            storage bindingRecord =
                _bindings[
                    bindingId
                ];

        if (
            !bindingRecord.active
        ) {
            revert BindingAlreadyInactive(
                bindingId
            );
        }

        (
            address assetController,
            address objectController
        ) =
            _getActiveControllers(
                bindingRecord.assetId,
                bindingRecord.objectId
            );

        if (
            msg.sender !=
                assetController &&
            msg.sender !=
                objectController
        ) {
            revert UnauthorizedBindingParty(
                msg.sender,
                bindingRecord.assetId,
                bindingRecord.objectId
            );
        }

        bindingRecord.active =
            false;

        bindingRecord.updatedAt =
            uint64(
                block.timestamp
            );

        _clearProposal(
            bindingId
        );

        emit ObjectUnbound(
            bindingId,
            bindingRecord.assetId,
            bindingRecord.objectId,
            msg.sender
        );
    }

    // =============================================================
    // DIRECT REBIND
    // =============================================================

    /**
     * @notice Reactivates a binding immediately when the same
     *         address currently controls both Asset and Object.
     *
     * @dev
     * When controllers differ, proposeBinding + acceptBinding
     * must be used.
     */
    function rebindObject(
        bytes32 bindingId
    )
        external
    {
        if (
            !_bindingExists[
                bindingId
            ]
        ) {
            revert BindingNotFound(
                bindingId
            );
        }

        BindingRecord
            storage bindingRecord =
                _bindings[
                    bindingId
                ];

        if (
            bindingRecord.active
        ) {
            revert BindingAlreadyActive(
                bindingId
            );
        }

        (
            address assetController,
            address objectController
        ) =
            _getActiveControllers(
                bindingRecord.assetId,
                bindingRecord.objectId
            );

        if (
            assetController !=
                msg.sender
        ) {
            revert UnauthorizedAssetController(
                msg.sender,
                bindingRecord.assetId
            );
        }

        if (
            objectController !=
                msg.sender
        ) {
            revert UnauthorizedObjectController(
                msg.sender,
                bindingRecord.objectId
            );
        }

        bindingRecord.active =
            true;

        bindingRecord.updatedAt =
            uint64(
                block.timestamp
            );

        _clearProposal(
            bindingId
        );

        emit ObjectRebound(
            bindingId,
            bindingRecord.assetId,
            bindingRecord.objectId,
            msg.sender
        );
    }

    // =============================================================
    // BINDING ID
    // =============================================================

    function getBindingId(
        bytes32 assetId,
        bytes32 objectId,
        NumenAssetTypes.ObjectLinkType linkType
    )
        public
        pure
        returns (bytes32)
    {
        return
            keccak256(
                abi.encode(
                    assetId,
                    objectId,
                    linkType
                )
            );
    }

    // =============================================================
    // BASIC READS
    // =============================================================

    function bindingExists(
        bytes32 bindingId
    )
        external
        view
        returns (bool)
    {
        return
            _bindingExists[
                bindingId
            ];
    }

    function isBindingActive(
        bytes32 bindingId
    )
        external
        view
        returns (bool)
    {
        if (
            !_bindingExists[
                bindingId
            ]
        ) {
            return false;
        }

        return
            _bindings[
                bindingId
            ].active;
    }

    function getBinding(
        bytes32 bindingId
    )
        external
        view
        returns (
            BindingRecord memory
        )
    {
        if (
            !_bindingExists[
                bindingId
            ]
        ) {
            revert BindingNotFound(
                bindingId
            );
        }

        return
            _bindings[
                bindingId
            ];
    }

    // =============================================================
    // PROPOSAL READS
    // =============================================================

    function proposalExists(
        bytes32 bindingId
    )
        external
        view
        returns (bool)
    {
        return
            _proposals[
                bindingId
            ].exists;
    }

    function getProposal(
        bytes32 bindingId
    )
        external
        view
        returns (
            BindingProposal memory
        )
    {
        if (
            !_proposals[
                bindingId
            ].exists
        ) {
            revert ProposalNotFound(
                bindingId
            );
        }

        return
            _proposals[
                bindingId
            ];
    }

    // =============================================================
    // RELATIONSHIP LOOKUP
    // =============================================================

    function relationshipExists(
        bytes32 assetId,
        bytes32 objectId,
        NumenAssetTypes.ObjectLinkType linkType
    )
        external
        view
        returns (bool)
    {
        bytes32 bindingId =
            getBindingId(
                assetId,
                objectId,
                linkType
            );

        return
            _bindingExists[
                bindingId
            ];
    }

    function isRelationshipActive(
        bytes32 assetId,
        bytes32 objectId,
        NumenAssetTypes.ObjectLinkType linkType
    )
        external
        view
        returns (bool)
    {
        bytes32 bindingId =
            getBindingId(
                assetId,
                objectId,
                linkType
            );

        if (
            !_bindingExists[
                bindingId
            ]
        ) {
            return false;
        }

        return
            _bindings[
                bindingId
            ].active;
    }

    // =============================================================
    // GLOBAL ENUMERATION
    // =============================================================

    function totalBindings()
        external
        view
        returns (uint256)
    {
        return
            _allBindingIds.length;
    }

    function bindingIdAt(
        uint256 index
    )
        external
        view
        returns (bytes32)
    {
        if (
            index >=
                _allBindingIds.length
        ) {
            revert InvalidIndex();
        }

        return
            _allBindingIds[
                index
            ];
    }

    function allBindingIds()
        external
        view
        returns (
            bytes32[] memory
        )
    {
        return
            _allBindingIds;
    }

    // =============================================================
    // ASSET ENUMERATION
    // =============================================================

    function assetBindingCount(
        bytes32 assetId
    )
        external
        view
        returns (uint256)
    {
        return
            _assetBindingIds[
                assetId
            ].length;
    }

    function assetBindingIdAt(
        bytes32 assetId,
        uint256 index
    )
        external
        view
        returns (bytes32)
    {
        if (
            index >=
                _assetBindingIds[
                    assetId
                ].length
        ) {
            revert InvalidIndex();
        }

        return
            _assetBindingIds[
                assetId
            ][
                index
            ];
    }

    function assetBindingIds(
        bytes32 assetId
    )
        external
        view
        returns (
            bytes32[] memory
        )
    {
        return
            _assetBindingIds[
                assetId
            ];
    }

    // =============================================================
    // OBJECT ENUMERATION
    // =============================================================

    function objectBindingCount(
        bytes32 objectId
    )
        external
        view
        returns (uint256)
    {
        return
            _objectBindingIds[
                objectId
            ].length;
    }

    function objectBindingIdAt(
        bytes32 objectId,
        uint256 index
    )
        external
        view
        returns (bytes32)
    {
        if (
            index >=
                _objectBindingIds[
                    objectId
                ].length
        ) {
            revert InvalidIndex();
        }

        return
            _objectBindingIds[
                objectId
            ][
                index
            ];
    }

    function objectBindingIds(
        bytes32 objectId
    )
        external
        view
        returns (
            bytes32[] memory
        )
    {
        return
            _objectBindingIds[
                objectId
            ];
    }

    // =============================================================
    // INTERNAL CREATE
    // =============================================================

    function _createBinding(
        bytes32 bindingId,
        bytes32 assetId,
        bytes32 objectId,
        NumenAssetTypes.ObjectLinkType linkType,
        address createdBy
    )
        internal
    {
        if (
            _bindingExists[
                bindingId
            ]
        ) {
            revert BindingAlreadyExists(
                bindingId
            );
        }

        uint64 timestamp =
            uint64(
                block.timestamp
            );

        _bindings[
            bindingId
        ] =
            BindingRecord({
                bindingId:
                    bindingId,

                assetId:
                    assetId,

                objectId:
                    objectId,

                linkType:
                    linkType,

                createdBy:
                    createdBy,

                createdAt:
                    timestamp,

                updatedAt:
                    timestamp,

                active:
                    true
            });

        _bindingExists[
            bindingId
        ] =
            true;

        _allBindingIds.push(
            bindingId
        );

        _assetBindingIds[
            assetId
        ].push(
            bindingId
        );

        _objectBindingIds[
            objectId
        ].push(
            bindingId
        );

        emit ObjectBound(
            bindingId,
            assetId,
            objectId,
            linkType,
            msg.sender
        );
    }

    // =============================================================
    // INTERNAL CONTROLLER LOOKUP
    // =============================================================

    function _getActiveControllers(
        bytes32 assetId,
        bytes32 objectId
    )
        internal
        view
        returns (
            address assetController,
            address objectController
        )
    {
        assetController =
            _getActiveAssetController(
                assetId
            );

        objectController =
            _getActiveObjectController(
                objectId
            );
    }

    function _getActiveAssetController(
        bytes32 assetId
    )
        internal
        view
        returns (
            address controller
        )
    {
        if (
            !assetRegistry.assetExists(
                assetId
            )
        ) {
            revert AssetNotFound(
                assetId
            );
        }

        if (
            !assetRegistry.isAssetActive(
                assetId
            )
        ) {
            revert AssetInactive(
                assetId
            );
        }

        INumenAssetRegistry.AssetRecord
            memory record =
                assetRegistry.getAsset(
                    assetId
                );

        controller =
            record.controller;
    }

    function _getActiveObjectController(
        bytes32 objectId
    )
        internal
        view
        returns (
            address controller
        )
    {
        if (
            !objectRegistry.objectExists(
                objectId
            )
        ) {
            revert ObjectNotFound(
                objectId
            );
        }

        if (
            !objectRegistry.isObjectActive(
                objectId
            )
        ) {
            revert ObjectInactive(
                objectId
            );
        }

        INumenObjectRegistryBindingView
            .ObjectRecord
            memory record =
                objectRegistry.getObject(
                    objectId
                );

        controller =
            record.controller;
    }

    // =============================================================
    // INTERNAL PROPOSAL HELPERS
    // =============================================================

    function _requireProposal(
        bytes32 bindingId
    )
        internal
        view
        returns (
            BindingProposal memory proposal
        )
    {
        if (
            !_proposals[
                bindingId
            ].exists
        ) {
            revert ProposalNotFound(
                bindingId
            );
        }

        proposal =
            _proposals[
                bindingId
            ];
    }

    function _clearProposal(
        bytes32 bindingId
    )
        internal
    {
        if (
            _proposals[
                bindingId
            ].exists
        ) {
            delete _proposals[
                bindingId
            ];
        }
    }
}
contracts/assets/interfaces/INumenAssetRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "../libraries/NumenAssetTypes.sol";

/**
 * @title INumenAssetRegistry
 * @notice Canonical registry interface for the Numen Asset Protocol.
 *
 * Registration means that an asset record exists in the
 * Numen Asset Protocol.
 *
 * Registration does NOT by itself prove physical authenticity,
 * legal ownership, regulatory compliance, provenance, issuer
 * legitimacy or correctness of metadata.
 */
interface INumenAssetRegistry {
    // =============================================================
    // EVENTS
    // =============================================================

    event AssetRegistered(
        bytes32 indexed assetId,
        address indexed assetContract,
        address indexed creator,
        NumenAssetTypes.AssetScope scope,
        uint256 tokenId,
        NumenAssetTypes.AssetClass assetClass,
        NumenAssetTypes.AssetStandard standard,
        NumenAssetTypes.AssetCategory category,
        NumenAssetTypes.RepresentationType representation
    );

    event AssetClassificationUpdated(
        bytes32 indexed assetId,
        NumenAssetTypes.AssetCategory category,
        NumenAssetTypes.RepresentationType representation,
        address indexed updatedBy
    );

    event AssetMetadataUpdated(
        bytes32 indexed assetId,
        string metadataURI,
        bytes32 metadataHash,
        address indexed updatedBy
    );

    event AssetDeactivated(
        bytes32 indexed assetId,
        address indexed deactivatedBy
    );

    event AssetReactivated(
        bytes32 indexed assetId,
        address indexed reactivatedBy
    );

    /**
     * @notice Emitted when the current controller proposes a new
     *         controller.
     */
    event AssetControllerTransferProposed(
        bytes32 indexed assetId,
        address indexed currentController,
        address indexed proposedController
    );

    /**
     * @notice Emitted when a pending controller transfer is cancelled.
     */
    event AssetControllerTransferCancelled(
        bytes32 indexed assetId,
        address indexed controller,
        address indexed cancelledProposedController
    );

    /**
     * @notice Emitted only after the proposed controller explicitly
     *         accepts control.
     */
    event AssetControllerTransferred(
        bytes32 indexed assetId,
        address indexed previousController,
        address indexed newController
    );

    // =============================================================
    // REGISTRATION REQUEST
    // =============================================================

    struct RegisterAssetRequest {
        NumenAssetTypes.AssetClass assetClass;
        NumenAssetTypes.AssetStandard standard;
        NumenAssetTypes.AssetScope scope;
        NumenAssetTypes.AssetCategory category;
        NumenAssetTypes.RepresentationType representation;
        address assetContract;
        uint256 tokenId;
        address creator;
        address controller;
        string metadataURI;
        bytes32 metadataHash;
    }

    // =============================================================
    // REGISTRY RECORD
    // =============================================================

    struct AssetRecord {
        bytes32 assetId;
        NumenAssetTypes.AssetClass assetClass;
        NumenAssetTypes.AssetStandard standard;
        NumenAssetTypes.AssetScope scope;
        NumenAssetTypes.AssetCategory category;
        NumenAssetTypes.RepresentationType representation;
        address assetContract;
        uint256 tokenId;
        address creator;
        address controller;
        string metadataURI;
        bytes32 metadataHash;
        uint64 createdAt;
        uint64 updatedAt;
        bool active;
    }

    // =============================================================
    // REGISTRATION
    // =============================================================

    function registerAsset(
        RegisterAssetRequest calldata request
    )
        external
        returns (bytes32 assetId);

    // =============================================================
    // LOOKUPS
    // =============================================================

    function assetExists(
        bytes32 assetId
    )
        external
        view
        returns (bool);

    function isAssetActive(
        bytes32 assetId
    )
        external
        view
        returns (bool);

    function getAsset(
        bytes32 assetId
    )
        external
        view
        returns (AssetRecord memory);

    function getAssetId(
        address assetContract,
        NumenAssetTypes.AssetScope scope,
        uint256 tokenId
    )
        external
        view
        returns (bytes32);

    function isRegisteredAsset(
        address assetContract,
        NumenAssetTypes.AssetScope scope,
        uint256 tokenId
    )
        external
        view
        returns (bool);

    // =============================================================
    // COUNTERS
    // =============================================================

    function totalAssets()
        external
        view
        returns (uint256);

    function assetIdAt(
        uint256 index
    )
        external
        view
        returns (bytes32);

    // =============================================================
    // CREATOR / CONTROLLER INDEX
    // =============================================================

    function creatorAssetCount(
        address creator
    )
        external
        view
        returns (uint256);

    function creatorAssetIdAt(
        address creator,
        uint256 index
    )
        external
        view
        returns (bytes32);

    function controllerAssetCount(
        address controller
    )
        external
        view
        returns (uint256);

    function controllerAssetIdAt(
        address controller,
        uint256 index
    )
        external
        view
        returns (bytes32);

    // =============================================================
    // MUTABLE DATA
    // =============================================================

    function updateClassification(
        bytes32 assetId,
        NumenAssetTypes.AssetCategory category,
        NumenAssetTypes.RepresentationType representation
    )
        external;

    function updateMetadata(
        bytes32 assetId,
        string calldata metadataURI,
        bytes32 metadataHash
    )
        external;

    // =============================================================
    // CONTROLLER MANAGEMENT
    // =============================================================

    /**
     * @notice Proposes transfer of control to a new address.
     *
     * @dev The proposed controller receives no authority until
     *      acceptAssetController() is called by that address.
     */
    function proposeAssetController(
        bytes32 assetId,
        address newController
    )
        external;

    /**
     * @notice Accepts a pending controller transfer.
     *
     * @dev Only the currently proposed controller may accept.
     */
    function acceptAssetController(
        bytes32 assetId
    )
        external;

    /**
     * @notice Cancels the pending controller transfer.
     *
     * @dev Only the current controller may cancel.
     */
    function cancelAssetControllerTransfer(
        bytes32 assetId
    )
        external;

    /**
     * @notice Returns the currently proposed controller.
     *
     * @return Zero address when no transfer is pending.
     */
    function pendingAssetController(
        bytes32 assetId
    )
        external
        view
        returns (address);

    // =============================================================
    // ACTIVE STATUS
    // =============================================================

    function deactivateAsset(
        bytes32 assetId
    )
        external;

    function reactivateAsset(
        bytes32 assetId
    )
        external;

    // =============================================================
    // PROTOCOL INFORMATION
    // =============================================================

    function registryVersion()
        external
        pure
        returns (bytes32);
}
contracts/assets/libraries/NumenAssetTypes.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/**
 * @title NumenAssetTypes
 * @notice Shared data types for the Numen Asset Protocol.
 *
 * @dev
 * This library defines the common vocabulary used by:
 *
 * - Fungible assets
 * - Non-fungible assets
 * - Real-world assets (RWA)
 * - Digital twins
 * - Physical / 3D-linked assets
 * - Product passports
 * - Certificates
 * - Collections
 * - Future Numen Object Registry integrations
 *
 * IMPORTANT:
 *
 * A physical or 3D association does NOT by itself prove authenticity,
 * legal ownership, provenance, or physical-world identity.
 *
 * Verification and attestation states must be represented separately.
 */
library NumenAssetTypes {
    // =============================================================
    //                           ASSET CLASS
    // =============================================================

    /**
     * @notice Fundamental economic class of an asset.
     */
    enum AssetClass {
        FUNGIBLE,
        NON_FUNGIBLE
    }

    // =============================================================
    //                         ASSET STANDARD
    // =============================================================

    /**
     * @notice Technical representation used by an asset.
     *
     * NONE is useful for registry records that are not themselves
     * represented by a token contract.
     */
    enum AssetStandard {
        NONE,
        ERC20,
        ERC721,
        ERC1155
    }

    // =============================================================
    //                          ASSET SCOPE
    // =============================================================

    /**
     * @notice Defines whether a registry record represents an entire
     * token contract / collection or one individual token ID.
     *
     * CONTRACT:
     * - ERC20 assets
     * - ERC721 collection-level records
     * - ERC1155 collection-level records
     *
     * TOKEN:
     * - Individual ERC721 tokens
     * - Individual ERC1155 token types
     *
     * Scope is part of canonical Numen asset identity.
     *
     * This makes the following two identities distinct:
     *
     * contract = 0xABC...
     * scope    = CONTRACT
     * tokenId  = 0
     *
     * and:
     *
     * contract = 0xABC...
     * scope    = TOKEN
     * tokenId  = 0
     *
     * This distinction is required because NFT token ID 0 is valid.
     */
    enum AssetScope {
        CONTRACT,
        TOKEN
    }

    // =============================================================
    //                        ASSET CATEGORY
    // =============================================================

    /**
     * @notice High-level semantic category of an asset.
     *
     * CUSTOM allows applications to provide a human-readable
     * category through metadata without requiring a protocol upgrade.
     */
    enum AssetCategory {
        UNSPECIFIED,
        CURRENCY,
        PAYMENT,
        UTILITY,
        GOVERNANCE,
        COMMUNITY,
        GAMING,
        COMMODITY,
        REAL_ESTATE,
        PRECIOUS_METAL,
        PRECIOUS_STONE,
        COLLECTIBLE,
        ARTWORK,
        CULTURAL_HERITAGE,
        PRODUCT,
        VEHICLE,
        MACHINERY,
        INTELLECTUAL_PROPERTY,
        MEDIA,
        CERTIFICATE,
        IDENTITY,
        FINANCIAL_ASSET,
        CUSTOM
    }

    // =============================================================
    //                      REPRESENTATION TYPE
    // =============================================================

    /**
     * @notice Describes what the on-chain asset represents.
     *
     * This is deliberately separate from AssetCategory.
     *
     * Example:
     *
     * category       = REAL_ESTATE
     * representation = FRACTIONAL_INTEREST
     */
    enum RepresentationType {
        UNSPECIFIED,
        DIGITAL_ASSET,
        PHYSICAL_REFERENCE,
        DIGITAL_TWIN,
        FRACTIONAL_INTEREST,
        OWNERSHIP_CLAIM,
        USAGE_RIGHT,
        REVENUE_RIGHT,
        CERTIFICATE,
        PRODUCT_PASSPORT,
        MEMBERSHIP,
        LICENSE,
        CUSTOM
    }

    // =============================================================
    //                         SUPPLY MODEL
    // =============================================================

    /**
     * @notice Supply policy for fungible or multi-token assets.
     */
    enum SupplyModel {
        NOT_APPLICABLE,
        FIXED,
        CAPPED,
        UNCAPPED
    }

    // =============================================================
    //                       PROPERTY VALUE TYPE
    // =============================================================

    /**
     * @notice Supported value types for extensible asset properties.
     *
     * Properties are intended for data such as:
     *
     * Weight      -> DECIMAL
     * Serial No.  -> TEXT
     * Certified   -> BOOLEAN
     * Manufacture -> DATE
     * Document    -> URI / HASH
     */
    enum PropertyValueType {
        TEXT,
        INTEGER,
        DECIMAL,
        BOOLEAN,
        DATE,
        URI,
        HASH,
        ADDRESS,
        BYTES
    }

    // =============================================================
    //                       ATTESTATION TYPE
    // =============================================================

    /**
     * @notice Semantic purpose of an attestation.
     *
     * An attestation means that an identifiable party made a claim.
     * It does not automatically make that claim true.
     */
    enum AttestationType {
        CUSTOM,
        ISSUER,
        MANUFACTURER,
        OWNERSHIP,
        ORIGIN,
        INSPECTION,
        APPRAISAL,
        CUSTODY,
        AUDIT,
        LEGAL,
        DOCUMENT,
        MODEL,
        SCAN
    }

    // =============================================================
    //                     VERIFICATION STATUS
    // =============================================================

    /**
     * @notice Generic lifecycle for an independently verifiable claim.
     */
    enum VerificationStatus {
        NONE,
        PENDING,
        VERIFIED,
        REJECTED,
        REVOKED,
        EXPIRED
    }

    // =============================================================
    //                       OBJECT LINK TYPE
    // =============================================================

    /**
     * @notice Relationship between an asset and an object record.
     *
     * Multiple assets may reference the same object.
     *
     * Example:
     *
     * Object
     *   ├── DIGITAL_TWIN       -> ERC721
     *   ├── FRACTIONALIZATION -> ERC20
     *   └── CERTIFICATE       -> ERC721
     */
    enum ObjectLinkType {
        UNSPECIFIED,
        PRIMARY,
        DIGITAL_TWIN,
        FRACTIONALIZATION,
        CERTIFICATE,
        OWNERSHIP,
        USAGE_RIGHT,
        PROVENANCE,
        CUSTOM
    }

    // =============================================================
    //                        ASSET IDENTITY
    // =============================================================

    /**
     * @notice Core registry identity for an asset.
     *
     * assetId:
     * Protocol-generated identifier.
     *
     * assetContract:
     * ERC20 / ERC721 / ERC1155 contract address when applicable.
     *
     * scope:
     * CONTRACT when the record represents the whole token contract
     * or collection.
     *
     * TOKEN when the record represents one specific ERC721 or
     * ERC1155 token ID.
     *
     * tokenId:
     * Must be 0 for CONTRACT-scoped records.
     *
     * For TOKEN-scoped ERC721 / ERC1155 records, this is the
     * corresponding token ID. Token ID 0 is valid and is distinct
     * from a CONTRACT-scoped record because scope is part of the
     * canonical identity.
     */
    struct AssetIdentity {
        bytes32 assetId;
        AssetClass assetClass;
        AssetStandard standard;
        AssetScope scope;
        AssetCategory category;
        RepresentationType representation;
        address assetContract;
        uint256 tokenId;
        address creator;
        uint64 createdAt;
    }

    // =============================================================
    //                         ASSET METADATA
    // =============================================================

    /**
     * @notice Human-readable and external metadata references.
     *
     * Large files and metadata should generally remain off-chain.
     * Hashes can be committed on-chain independently.
     */
    struct AssetMetadata {
        string name;
        string symbol;
        string description;
        string metadataURI;
        bytes32 metadataHash;
    }

    // =============================================================
    //                       CUSTOM PROPERTY
    // =============================================================

    /**
     * @notice Extensible property attached to an asset.
     *
     * The value is encoded as bytes so the registry can support
     * additional property semantics without redeploying every asset.
     *
     * Example:
     *
     * key       = keccak256("weight")
     * name      = "Weight"
     * valueType = DECIMAL
     * value     = abi.encode("1.75388")
     * unit      = "kg"
     */
    struct AssetProperty {
        bytes32 key;
        string name;
        PropertyValueType valueType;
        bytes value;
        string unit;
        address addedBy;
        uint64 createdAt;
        uint64 updatedAt;
    }

    // =============================================================
    //                         3D MODEL DATA
    // =============================================================

    /**
     * @notice Information about a digital 3D model associated
     * with an asset or object.
     *
     * modelHash commits to the exact model bytes.
     *
     * spectralFingerprint may reference a separately generated
     * asset-oriented geometric fingerprint.
     *
     * This MUST NOT be interpreted as the PoScan mining work hash
     * and MUST NOT by itself be represented as proof of physical
     * authenticity.
     */
    struct ModelData {
        string modelURI;
        bytes32 modelHash;
        bytes32 spectralFingerprint;
        string spectralVersion;
        address submittedBy;
        uint64 createdAt;
    }

    // =============================================================
    //                         OBJECT RECORD
    // =============================================================

    /**
     * @notice Registry record for an object that may later be
     * associated with one or more digital assets.
     *
     * objectId is a protocol-level identifier.
     *
     * The existence of an ObjectRecord means that an object record
     * exists on-chain. It does NOT automatically mean the physical
     * object has been independently authenticated.
     */
    struct ObjectRecord {
        bytes32 objectId;
        address creator;
        bytes32 primaryModelHash;
        bytes32 spectralFingerprint;
        string metadataURI;
        uint64 createdAt;
        bool active;
    }

    // =============================================================
    //                         OBJECT BINDING
    // =============================================================

    /**
     * @notice Relationship between an object and an asset.
     */
    struct ObjectBinding {
        bytes32 objectId;
        bytes32 assetId;
        ObjectLinkType linkType;
        address createdBy;
        uint64 createdAt;
        bool active;
    }

    // =============================================================
    //                          ATTESTATION
    // =============================================================

    /**
     * @notice Signed/registered claim made about an asset or object.
     *
     * subjectId may be an assetId or objectId depending on the
     * registry context.
     *
     * evidenceHash can commit to a report, certificate, scan,
     * inspection, legal document, or other evidence.
     */
    struct Attestation {
        bytes32 attestationId;
        bytes32 subjectId;
        AttestationType attestationType;
        address attester;
        bytes32 evidenceHash;
        string evidenceURI;
        VerificationStatus status;
        uint64 issuedAt;
        uint64 expiresAt;
    }

    // =============================================================
    //                           DOCUMENT
    // =============================================================

    /**
     * @notice Document reference associated with an asset or object.
     *
     * Sensitive documents do not need to expose their contents.
     * documentHash can be recorded without publishing documentURI.
     */
    struct DocumentReference {
        bytes32 documentId;
        bytes32 subjectId;
        string documentType;
        string documentURI;
        bytes32 documentHash;
        address submittedBy;
        uint64 createdAt;
    }

    // =============================================================
    //                         PROVENANCE
    // =============================================================

    /**
     * @notice Generic historical event for an asset or object.
     *
     * eventType is intentionally bytes32 so applications can define
     * additional event types without modifying this library.
     */
    struct ProvenanceEvent {
        bytes32 eventId;
        bytes32 subjectId;
        bytes32 eventType;
        address actor;
        bytes32 dataHash;
        string dataURI;
        uint64 timestamp;
    }

    // =============================================================
    //                     FUNGIBLE CONFIGURATION
    // =============================================================

    /**
     * @notice Configuration recorded for fungible assets.
     *
     * Feature flags describe the deployed asset's capabilities.
     * They do not themselves grant permissions.
     */
    struct FungibleConfig {
        SupplyModel supplyModel;
        uint8 decimals;
        uint256 initialSupply;
        uint256 maxSupply;
        bool mintable;
        bool burnable;
        bool pausable;
        bool permitEnabled;
        bool votesEnabled;
    }

    // =============================================================
    //                  NON-FUNGIBLE CONFIGURATION
    // =============================================================

    /**
     * @notice Configuration recorded for NFT / multi-token assets.
     */
    struct NonFungibleConfig {
        bool multiToken;
        bool burnable;
        bool pausable;
        bool enumerable;
        bool royaltyEnabled;
        uint96 royaltyBps;
        address royaltyReceiver;
    }
}
ABI
[
  {
    "type": "constructor",
    "inputs": [
      {
        "name": "assetRegistry_",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "objectRegistry_",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "name": "AssetInactive",
    "type": "error",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "AssetNotFound",
    "type": "error",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "BindingAlreadyActive",
    "type": "error",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "BindingAlreadyExists",
    "type": "error",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "BindingAlreadyInactive",
    "type": "error",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "BindingNotFound",
    "type": "error",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "InvalidIndex",
    "type": "error",
    "inputs": []
  },
  {
    "name": "ObjectInactive",
    "type": "error",
    "inputs": [
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "ObjectNotFound",
    "type": "error",
    "inputs": [
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "ProposalAlreadyAcceptedByCaller",
    "type": "error",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "caller",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "name": "ProposalAlreadyExists",
    "type": "error",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "ProposalControllerMismatch",
    "type": "error",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "ProposalNotFound",
    "type": "error",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "SameControllerCanBindDirectly",
    "type": "error",
    "inputs": []
  },
  {
    "name": "UnauthorizedAssetController",
    "type": "error",
    "inputs": [
      {
        "name": "caller",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "UnauthorizedBindingParty",
    "type": "error",
    "inputs": [
      {
        "name": "caller",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "UnauthorizedObjectController",
    "type": "error",
    "inputs": [
      {
        "name": "caller",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ]
  },
  {
    "name": "ZeroAddress",
    "type": "error",
    "inputs": []
  },
  {
    "name": "BindingProposalAccepted",
    "type": "event",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "acceptedBy",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "name": "BindingProposalCancelled",
    "type": "event",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "cancelledBy",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "name": "BindingProposed",
    "type": "event",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "assetId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "linkType",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum NumenAssetTypes.ObjectLinkType"
      },
      {
        "name": "proposer",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "assetController",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "objectController",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "name": "ObjectBound",
    "type": "event",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "assetId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "linkType",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum NumenAssetTypes.ObjectLinkType"
      },
      {
        "name": "activatedBy",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "name": "ObjectRebound",
    "type": "event",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "assetId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "reboundBy",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "name": "ObjectUnbound",
    "type": "event",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "assetId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "unboundBy",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "name": "acceptBinding",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "name": "allBindingIds",
    "type": "function",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "assetBindingCount",
    "type": "function",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "assetBindingIdAt",
    "type": "function",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "index",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "assetBindingIds",
    "type": "function",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "assetRegistry",
    "type": "function",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract INumenAssetRegistry"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "bindObject",
    "type": "function",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "linkType",
        "type": "uint8",
        "internalType": "enum NumenAssetTypes.ObjectLinkType"
      }
    ],
    "outputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "name": "bindingExists",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "bindingIdAt",
    "type": "function",
    "inputs": [
      {
        "name": "index",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "cancelBindingProposal",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "name": "getBinding",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "components": [
          {
            "name": "bindingId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "assetId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "objectId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "linkType",
            "type": "uint8",
            "internalType": "enum NumenAssetTypes.ObjectLinkType"
          },
          {
            "name": "createdBy",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "createdAt",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "updatedAt",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "active",
            "type": "bool",
            "internalType": "bool"
          }
        ],
        "internalType": "struct NumenObjectBinding.BindingRecord"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "getBindingId",
    "type": "function",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "linkType",
        "type": "uint8",
        "internalType": "enum NumenAssetTypes.ObjectLinkType"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "name": "getProposal",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "components": [
          {
            "name": "bindingId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "assetId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "objectId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "linkType",
            "type": "uint8",
            "internalType": "enum NumenAssetTypes.ObjectLinkType"
          },
          {
            "name": "proposer",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "assetController",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "objectController",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "createdAt",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "exists",
            "type": "bool",
            "internalType": "bool"
          }
        ],
        "internalType": "struct NumenObjectBinding.BindingProposal"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "isBindingActive",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "isRelationshipActive",
    "type": "function",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "linkType",
        "type": "uint8",
        "internalType": "enum NumenAssetTypes.ObjectLinkType"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "objectBindingCount",
    "type": "function",
    "inputs": [
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "objectBindingIdAt",
    "type": "function",
    "inputs": [
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "index",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "objectBindingIds",
    "type": "function",
    "inputs": [
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "objectBindingVersion",
    "type": "function",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "name": "objectRegistry",
    "type": "function",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract INumenObjectRegistryBindingView"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "proposalExists",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "proposeBinding",
    "type": "function",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "linkType",
        "type": "uint8",
        "internalType": "enum NumenAssetTypes.ObjectLinkType"
      }
    ],
    "outputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "name": "rebindObject",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "name": "relationshipExists",
    "type": "function",
    "inputs": [
      {
        "name": "assetId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "objectId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "linkType",
        "type": "uint8",
        "internalType": "enum NumenAssetTypes.ObjectLinkType"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "totalBindings",
    "type": "function",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "name": "unbindObject",
    "type": "function",
    "inputs": [
      {
        "name": "bindingId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  }
]