// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "../interfaces/INumenAssetRegistry.sol";
import "../libraries/NumenAssetTypes.sol";
/**
* @title INumenObjectRegistryAttestationView
* @notice Minimal Object Registry interface required by the
* attestation layer.
*/
interface INumenObjectRegistryAttestationView {
function objectExists(
bytes32 objectId
)
external
view
returns (bool);
function isObjectActive(
bytes32 objectId
)
external
view
returns (bool);
}
/**
* @title NumenAttestationRegistry
* @notice Permissionless attestation registry for Numen assets
* and objects.
*
* @dev
* An attestation means:
*
* "Address X made claim Y about target Z at time T."
*
* It does NOT mean:
*
* - Numen verified the claim,
* - Numen verified physical authenticity,
* - Numen verified legal ownership,
* - Numen verified manufacturer origin,
* - Numen verified custody,
* - Numen verified the identity of the attester.
*
* Trust in an attestation depends on the identity, reputation and
* authority of the attester.
*
* The registry is intentionally permissionless. There is no global
* owner, administrator or privileged attester.
*/
contract NumenAttestationRegistry {
// =============================================================
// ERRORS
// =============================================================
error ZeroAddress();
error InvalidTarget();
error AssetNotFound(
bytes32 assetId
);
error AssetInactive(
bytes32 assetId
);
error ObjectNotFound(
bytes32 objectId
);
error ObjectInactive(
bytes32 objectId
);
error EmptyClaim();
error InvalidExpiration();
error AttestationNotFound(
bytes32 attestationId
);
error Unauthorized(
address caller,
bytes32 attestationId
);
error AttestationAlreadyRevoked(
bytes32 attestationId
);
error AttestationExpired(
bytes32 attestationId
);
error InvalidIndex();
// =============================================================
// EVENTS
// =============================================================
event AttestationCreated(
bytes32 indexed attestationId,
address indexed attester,
bytes32 indexed targetId,
bool targetIsAsset,
NumenAssetTypes.AttestationType attestationType,
bytes32 claimHash,
uint64 expiresAt
);
event AttestationRevoked(
bytes32 indexed attestationId,
address indexed attester,
uint64 revokedAt
);
// =============================================================
// STRUCTS
// =============================================================
/**
* @notice Input used to create an attestation.
*
* Exactly one of assetId/objectId must be non-zero.
*
* claimURI may point to off-chain structured data such as:
*
* - IPFS JSON
* - HTTPS JSON
* - decentralized storage
*
* claimHash should represent the referenced claim payload.
*
* evidenceURI/evidenceHash are optional supporting evidence.
*
* expiresAt:
* 0 = no expiration
* > block.timestamp = expiration timestamp
*/
struct CreateAttestationRequest {
bytes32 assetId;
bytes32 objectId;
NumenAssetTypes.AttestationType attestationType;
string claimURI;
bytes32 claimHash;
string evidenceURI;
bytes32 evidenceHash;
uint64 expiresAt;
}
/**
* @notice Canonical stored attestation.
*
* @dev Attestations are immutable after creation except for
* revocation status.
*/
struct AttestationRecord {
bytes32 attestationId;
bytes32 assetId;
bytes32 objectId;
address attester;
NumenAssetTypes.AttestationType attestationType;
string claimURI;
bytes32 claimHash;
string evidenceURI;
bytes32 evidenceHash;
uint64 createdAt;
uint64 expiresAt;
uint64 revokedAt;
bool revoked;
}
// =============================================================
// IMMUTABLES
// =============================================================
INumenAssetRegistry
public immutable assetRegistry;
INumenObjectRegistryAttestationView
public immutable objectRegistry;
// =============================================================
// CONSTANTS
// =============================================================
bytes32 private constant
_ATTESTATION_REGISTRY_VERSION =
keccak256(
"NUMEN_ATTESTATION_REGISTRY_V1"
);
// =============================================================
// STORAGE
// =============================================================
uint256 private _attestationNonce;
mapping(
bytes32 =>
AttestationRecord
)
private _attestations;
mapping(
bytes32 =>
bool
)
private _attestationExists;
bytes32[]
private _allAttestationIds;
mapping(
bytes32 =>
bytes32[]
)
private _assetAttestationIds;
mapping(
bytes32 =>
bytes32[]
)
private _objectAttestationIds;
mapping(
address =>
bytes32[]
)
private _attesterAttestationIds;
// =============================================================
// CONSTRUCTOR
// =============================================================
constructor(
address assetRegistry_,
address objectRegistry_
) {
if (
assetRegistry_ ==
address(0) ||
objectRegistry_ ==
address(0)
) {
revert ZeroAddress();
}
assetRegistry =
INumenAssetRegistry(
assetRegistry_
);
objectRegistry =
INumenObjectRegistryAttestationView(
objectRegistry_
);
}
// =============================================================
// VERSION
// =============================================================
function attestationRegistryVersion()
external
pure
returns (bytes32)
{
return
_ATTESTATION_REGISTRY_VERSION;
}
// =============================================================
// CREATE ATTESTATION
// =============================================================
/**
* @notice Creates an attestation about one Asset ID or one
* Object ID.
*
* @dev This function is intentionally permissionless.
*
* Anyone may make a claim, but the attester address is always
* permanently recorded.
*
* Applications should evaluate who the attester is instead of
* treating all attestations as equally trustworthy.
*/
function createAttestation(
CreateAttestationRequest calldata request
)
external
returns (
bytes32 attestationId
)
{
bool hasAsset =
request.assetId !=
bytes32(0);
bool hasObject =
request.objectId !=
bytes32(0);
if (
hasAsset ==
hasObject
) {
revert InvalidTarget();
}
if (
request.claimHash ==
bytes32(0)
) {
revert EmptyClaim();
}
if (
request.expiresAt != 0 &&
request.expiresAt <=
block.timestamp
) {
revert InvalidExpiration();
}
bytes32 targetId;
bool targetIsAsset;
if (hasAsset) {
_requireActiveAsset(
request.assetId
);
targetId =
request.assetId;
targetIsAsset =
true;
} else {
_requireActiveObject(
request.objectId
);
targetId =
request.objectId;
targetIsAsset =
false;
}
unchecked {
++_attestationNonce;
}
attestationId =
keccak256(
abi.encode(
block.chainid,
address(this),
msg.sender,
targetId,
request.attestationType,
request.claimHash,
_attestationNonce
)
);
uint64 timestamp =
uint64(
block.timestamp
);
_attestations[
attestationId
] =
AttestationRecord({
attestationId:
attestationId,
assetId:
request.assetId,
objectId:
request.objectId,
attester:
msg.sender,
attestationType:
request.attestationType,
claimURI:
request.claimURI,
claimHash:
request.claimHash,
evidenceURI:
request.evidenceURI,
evidenceHash:
request.evidenceHash,
createdAt:
timestamp,
expiresAt:
request.expiresAt,
revokedAt:
0,
revoked:
false
});
_attestationExists[
attestationId
] =
true;
_allAttestationIds.push(
attestationId
);
_attesterAttestationIds[
msg.sender
].push(
attestationId
);
if (hasAsset) {
_assetAttestationIds[
request.assetId
].push(
attestationId
);
} else {
_objectAttestationIds[
request.objectId
].push(
attestationId
);
}
emit AttestationCreated(
attestationId,
msg.sender,
targetId,
targetIsAsset,
request.attestationType,
request.claimHash,
request.expiresAt
);
}
// =============================================================
// REVOKE ATTESTATION
// =============================================================
/**
* @notice Revokes an attestation.
*
* @dev Only the original attester may revoke it.
*
* Revocation does not delete historical information.
*/
function revokeAttestation(
bytes32 attestationId
)
external
{
if (
!_attestationExists[
attestationId
]
) {
revert AttestationNotFound(
attestationId
);
}
AttestationRecord
storage record =
_attestations[
attestationId
];
if (
record.attester !=
msg.sender
) {
revert Unauthorized(
msg.sender,
attestationId
);
}
if (
record.revoked
) {
revert AttestationAlreadyRevoked(
attestationId
);
}
uint64 timestamp =
uint64(
block.timestamp
);
record.revoked =
true;
record.revokedAt =
timestamp;
emit AttestationRevoked(
attestationId,
msg.sender,
timestamp
);
}
// =============================================================
// STATUS
// =============================================================
/**
* @notice Returns true only if the attestation exists,
* has not been revoked and has not expired.
*
* @dev "active" does NOT mean "trusted" or "verified".
*/
function isAttestationActive(
bytes32 attestationId
)
public
view
returns (bool)
{
if (
!_attestationExists[
attestationId
]
) {
return false;
}
AttestationRecord
storage record =
_attestations[
attestationId
];
if (
record.revoked
) {
return false;
}
if (
record.expiresAt != 0 &&
block.timestamp >=
record.expiresAt
) {
return false;
}
return true;
}
function isAttestationExpired(
bytes32 attestationId
)
external
view
returns (bool)
{
if (
!_attestationExists[
attestationId
]
) {
return false;
}
AttestationRecord
storage record =
_attestations[
attestationId
];
return
record.expiresAt != 0 &&
block.timestamp >=
record.expiresAt;
}
// =============================================================
// BASIC READS
// =============================================================
function attestationExists(
bytes32 attestationId
)
external
view
returns (bool)
{
return
_attestationExists[
attestationId
];
}
function getAttestation(
bytes32 attestationId
)
external
view
returns (
AttestationRecord memory
)
{
if (
!_attestationExists[
attestationId
]
) {
revert AttestationNotFound(
attestationId
);
}
return
_attestations[
attestationId
];
}
// =============================================================
// GLOBAL ENUMERATION
// =============================================================
function totalAttestations()
external
view
returns (uint256)
{
return
_allAttestationIds.length;
}
function attestationIdAt(
uint256 index
)
external
view
returns (bytes32)
{
if (
index >=
_allAttestationIds.length
) {
revert InvalidIndex();
}
return
_allAttestationIds[
index
];
}
function allAttestationIds()
external
view
returns (
bytes32[] memory
)
{
return
_allAttestationIds;
}
// =============================================================
// ASSET ENUMERATION
// =============================================================
function assetAttestationCount(
bytes32 assetId
)
external
view
returns (uint256)
{
return
_assetAttestationIds[
assetId
].length;
}
function assetAttestationIdAt(
bytes32 assetId,
uint256 index
)
external
view
returns (bytes32)
{
if (
index >=
_assetAttestationIds[
assetId
].length
) {
revert InvalidIndex();
}
return
_assetAttestationIds[
assetId
][
index
];
}
function assetAttestationIds(
bytes32 assetId
)
external
view
returns (
bytes32[] memory
)
{
return
_assetAttestationIds[
assetId
];
}
// =============================================================
// OBJECT ENUMERATION
// =============================================================
function objectAttestationCount(
bytes32 objectId
)
external
view
returns (uint256)
{
return
_objectAttestationIds[
objectId
].length;
}
function objectAttestationIdAt(
bytes32 objectId,
uint256 index
)
external
view
returns (bytes32)
{
if (
index >=
_objectAttestationIds[
objectId
].length
) {
revert InvalidIndex();
}
return
_objectAttestationIds[
objectId
][
index
];
}
function objectAttestationIds(
bytes32 objectId
)
external
view
returns (
bytes32[] memory
)
{
return
_objectAttestationIds[
objectId
];
}
// =============================================================
// ATTESTER ENUMERATION
// =============================================================
function attesterAttestationCount(
address attester
)
external
view
returns (uint256)
{
return
_attesterAttestationIds[
attester
].length;
}
function attesterAttestationIdAt(
address attester,
uint256 index
)
external
view
returns (bytes32)
{
if (
index >=
_attesterAttestationIds[
attester
].length
) {
revert InvalidIndex();
}
return
_attesterAttestationIds[
attester
][
index
];
}
function attesterAttestationIds(
address attester
)
external
view
returns (
bytes32[] memory
)
{
return
_attesterAttestationIds[
attester
];
}
// =============================================================
// INTERNAL VALIDATION
// =============================================================
function _requireActiveAsset(
bytes32 assetId
)
internal
view
{
if (
!assetRegistry.assetExists(
assetId
)
) {
revert AssetNotFound(
assetId
);
}
if (
!assetRegistry.isAssetActive(
assetId
)
) {
revert AssetInactive(
assetId
);
}
}
function _requireActiveObject(
bytes32 objectId
)
internal
view
{
if (
!objectRegistry.objectExists(
objectId
)
) {
revert ObjectNotFound(
objectId
);
}
if (
!objectRegistry.isObjectActive(
objectId
)
) {
revert ObjectInactive(
objectId
);
}
}
}// 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);
}// 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;
}
}[
{
"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": "AttestationAlreadyRevoked",
"type": "error",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "AttestationExpired",
"type": "error",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "AttestationNotFound",
"type": "error",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "EmptyClaim",
"type": "error",
"inputs": []
},
{
"name": "InvalidExpiration",
"type": "error",
"inputs": []
},
{
"name": "InvalidIndex",
"type": "error",
"inputs": []
},
{
"name": "InvalidTarget",
"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": "Unauthorized",
"type": "error",
"inputs": [
{
"name": "caller",
"type": "address",
"internalType": "address"
},
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "ZeroAddress",
"type": "error",
"inputs": []
},
{
"name": "AttestationCreated",
"type": "event",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "attester",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "targetId",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "targetIsAsset",
"type": "bool",
"indexed": false,
"internalType": "bool"
},
{
"name": "attestationType",
"type": "uint8",
"indexed": false,
"internalType": "enum NumenAssetTypes.AttestationType"
},
{
"name": "claimHash",
"type": "bytes32",
"indexed": false,
"internalType": "bytes32"
},
{
"name": "expiresAt",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
}
],
"anonymous": false
},
{
"name": "AttestationRevoked",
"type": "event",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "attester",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "revokedAt",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
}
],
"anonymous": false
},
{
"name": "allAttestationIds",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32[]",
"internalType": "bytes32[]"
}
],
"stateMutability": "view"
},
{
"name": "assetAttestationCount",
"type": "function",
"inputs": [
{
"name": "assetId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "assetAttestationIdAt",
"type": "function",
"inputs": [
{
"name": "assetId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "index",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "assetAttestationIds",
"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": "attestationExists",
"type": "function",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "attestationIdAt",
"type": "function",
"inputs": [
{
"name": "index",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "attestationRegistryVersion",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "pure"
},
{
"name": "attesterAttestationCount",
"type": "function",
"inputs": [
{
"name": "attester",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "attesterAttestationIdAt",
"type": "function",
"inputs": [
{
"name": "attester",
"type": "address",
"internalType": "address"
},
{
"name": "index",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "attesterAttestationIds",
"type": "function",
"inputs": [
{
"name": "attester",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "bytes32[]",
"internalType": "bytes32[]"
}
],
"stateMutability": "view"
},
{
"name": "createAttestation",
"type": "function",
"inputs": [
{
"name": "request",
"type": "tuple",
"components": [
{
"name": "assetId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "objectId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "attestationType",
"type": "uint8",
"internalType": "enum NumenAssetTypes.AttestationType"
},
{
"name": "claimURI",
"type": "string",
"internalType": "string"
},
{
"name": "claimHash",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "evidenceURI",
"type": "string",
"internalType": "string"
},
{
"name": "evidenceHash",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "expiresAt",
"type": "uint64",
"internalType": "uint64"
}
],
"internalType": "struct NumenAttestationRegistry.CreateAttestationRequest"
}
],
"outputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "nonpayable"
},
{
"name": "getAttestation",
"type": "function",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "tuple",
"components": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "assetId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "objectId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "attester",
"type": "address",
"internalType": "address"
},
{
"name": "attestationType",
"type": "uint8",
"internalType": "enum NumenAssetTypes.AttestationType"
},
{
"name": "claimURI",
"type": "string",
"internalType": "string"
},
{
"name": "claimHash",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "evidenceURI",
"type": "string",
"internalType": "string"
},
{
"name": "evidenceHash",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "createdAt",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "expiresAt",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "revokedAt",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "revoked",
"type": "bool",
"internalType": "bool"
}
],
"internalType": "struct NumenAttestationRegistry.AttestationRecord"
}
],
"stateMutability": "view"
},
{
"name": "isAttestationActive",
"type": "function",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "isAttestationExpired",
"type": "function",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "objectAttestationCount",
"type": "function",
"inputs": [
{
"name": "objectId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "objectAttestationIdAt",
"type": "function",
"inputs": [
{
"name": "objectId",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "index",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "objectAttestationIds",
"type": "function",
"inputs": [
{
"name": "objectId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "bytes32[]",
"internalType": "bytes32[]"
}
],
"stateMutability": "view"
},
{
"name": "objectRegistry",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract INumenObjectRegistryAttestationView"
}
],
"stateMutability": "view"
},
{
"name": "revokeAttestation",
"type": "function",
"inputs": [
{
"name": "attestationId",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "totalAttestations",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
}
]