IPatchworkLiteRef
IPatchwork721 extension to enable Lite Reference support, allowing them to accommodate Fragment assignments.
Functions
registerReferenceAddress
Registers a reference address
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address to register |
Returns
Name | Type | Description |
---|---|---|
id | uint8 | ID assigned to the address |
getReferenceId
Gets the ID assigned to the address from registration
Parameters
Name | Type | Description |
---|---|---|
addr | address | Registered address |
Returns
Name | Type | Description |
---|---|---|
id | uint8 | ID assigned to the address |
redacted | bool | Redacted status |
getReferenceAddress
Gets the address assigned to this id
Parameters
Name | Type | Description |
---|---|---|
id | uint8 | ID assigned to the address |
Returns
Name | Type | Description |
---|---|---|
addr | address | Registered address |
redacted | bool | Redacted status |
redactReferenceAddress
Redacts a reference address
Parameters
Name | Type | Description |
---|---|---|
id | uint8 | ID of the address to redact |
unredactReferenceAddress
Unredacts a reference address
Parameters
Name | Type | Description |
---|---|---|
id | uint8 | ID of the address to unredact |
getLiteReference
Returns a lite reference for a given address and token ID
Parameters
Name | Type | Description |
---|---|---|
addr | address | Address to get reference for |
tokenId | uint256 | ID of the token |
Returns
Name | Type | Description |
---|---|---|
liteRef | uint64 | Lite reference |
redacted | bool | Redacted status |
getReferenceAddressAndTokenId
Returns an address and token ID for a given lite reference
Parameters
Name | Type | Description |
---|---|---|
liteRef | uint64 | Lite reference to get address and token ID for |
Returns
Name | Type | Description |
---|---|---|
addr | address | Address |
tokenId | uint256 | Token ID |
addReference
Adds a reference to a token
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
liteRef | uint64 | LiteRef to add |
addReference
Adds a reference to a token
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
liteRef | uint64 | LiteRef to add |
targetMetadataId | uint256 | The metadata ID on the target to assign to |
addReferenceBatch
Adds multiple references to a token
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
liteRefs | uint64[] | Array of lite references to add |
addReferenceBatch
Adds multiple references to a token
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
liteRefs | uint64[] | Array of lite references to add |
targetMetadataId | uint256 | The metadata ID on the target to assign to |
removeReference
Removes a reference from a token
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
liteRef | uint64 | Lite reference to remove |
removeReference
Removes a reference from a token
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
liteRef | uint64 | Lite reference to remove |
targetMetadataId | uint256 | The metadata ID on the target to unassign from |
loadReferenceAddressAndTokenId
Loads a reference address and token ID at a given index
Parameters
Name | Type | Description |
---|---|---|
ourTokenId | uint256 | ID of the token |
idx | uint256 | Index to load from |
Returns
Name | Type | Description |
---|---|---|
addr | address | Address |
tokenId | uint256 | Token ID |
loadAllStaticReferences
Loads all static references for a given token ID
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
Returns
Name | Type | Description |
---|---|---|
addresses | address[] | Array of addresses |
tokenIds | uint256[] | Array of token IDs |
getDynamicReferenceCount
Count all dynamic references for a given token ID
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
Returns
Name | Type | Description |
---|---|---|
count | uint256 | the number of dynamic references |
loadDynamicReferencePage
Load a page of dynamic references for a given token ID
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | ID of the token |
offset | uint256 | The starting offset 0-indexed |
count | uint256 | The maximum number of references to return |
Returns
Name | Type | Description |
---|---|---|
addresses | address[] | An array of reference addresses |
tokenIds | uint256[] | An array of reference token IDs |
Events
Redact
Emitted when a contract redacts a fragment
Parameters
Name | Type | Description |
---|---|---|
target | address | the contract which issued the redaction |
fragment | address | the fragment that was redacted |
Unredact
Emitted when a contract unredacts a fragment
Parameters
Name | Type | Description |
---|---|---|
target | address | the contract which revoked the redaction |
fragment | address | the fragment that was unredacted |
Register
Emitted when a contract registers a fragment
Parameters
Name | Type | Description |
---|---|---|
target | address | the contract that registered the fragment |
fragment | address | the fragment that was registered |
idx | uint8 | the idx of the literef |