import”@patchwork/contracts/Patchwork1155Patch/IPatchwork1155Patch.sol”;

Inherits: IPatchworkScoped

Functions


mintPatch

Creates a new token for the owner, representing a patch

function mintPatch(address to, PatchTarget memory target) external payable returns (uint256 tokenId);

Parameters

NameTypeDescription
toaddressAddress of the owner of the patch token
targetPatchTargetPath to an 1155 to patch

Returns

NameTypeDescription
tokenIduint256ID of the newly minted token

Structs


PatchTarget

A canonical path to a Patched ERC-1155.

struct PatchTarget {
    address addr;
    uint256 tokenId;
    address account;
}

IPatchworkReversible1155Patch

This is an IPatchwork1155Patch extension to enable reverse lookup.

import”@patchwork/contracts/IPatchworkReversible1155Patch/IPatchworkReversible1155Patch.sol”;

Inherits: IPatchwork1155Patch

Functions


getTokenIdByTarget

Returns the token ID (if it exists) for an 1155 that may have been patched

Requires reverse storage enabled.
function getTokenIdByTarget(PatchTarget memory target) external returns (uint256 tokenId);

Parameters

NameTypeDescription
targetPatchTargetThe 1155 target that was patched

Returns

NameTypeDescription
tokenIduint256token ID of the patch