Relations Modules
How to establish the relationship index
As the on-chain storage fee is taken into consideration, the complete relationship network isnβt stored on-chain, and it needs to be figured out off-chain. Given that 5Degrees completely follows the EIP-1155 protocol, we can quickly index data through TransferSingle and TransferBatch to establish complete relationship network data.
TransferSingle()
Parameter Name | Type | Description |
---|---|---|
operator | address | operator of transaction |
from | address | Profile NFT old owner |
to | address | Profile NFT new owner |
id | uint256 | Profile NFT ID |
value | uint256 | Profile NFT value |
While mint
(the follow action), parameter from
is address(0), to
is follower address, id
is serialization of the address being followed.
While burn
(the unfollow action), parameter from
is follower's address, to
is address(0), id
is serialization of the address being followed.
eg: value always 1
TransferBatch()
Parameter Name | Type | Description |
---|---|---|
operator | address | operator of transaction |
from | address | Profile NFT old owner |
to | address | Profile NFT new owner |
ids | uint256[] | Profile NFT ID's list |
values | uint256[] | Profile NFT ID value's list |
ids
is a set of serializations of addresses being followed.
Last updated