View Modules

balanceOf()

Find out follow or not through the method balanceOf, it represents being followed or following if return value is larger than 0.

function balanceOf(address account,uint256 id) external view returns (uint256)

account is the address trigger the follow action, id is the serializations of the address being followed.

eg: uint256(uint160("$(address)")) or hexadecimal to 10 interpretations.

Query if is being followed:

Like if A is being followed by B -> balanceOf(B, uint256(uint160(A)))

Query if is following:

Like if A is following B -> balanceOf(A, uint256(uint160(B)))

baseInfo()

Query base info of Profile NFT, return name and image.

function baseInfo(address account) external view returns 
(string memory name, string memory image)
Parameter NameTypeDescription

account

address

which Profile NFT query

name

string

name of Profile NFT

image

string

avatar of Profile NFT

relation()

Query Profile NFT followings and followers.

function relation(address account) external view virtual returns 
(uint256 tokenSupply, uint256 totalBalance)
Parameter NameTypeDescription

account

address

which Profile NFT query

tokenSupply

uint256

followers of Profile NFT

totalBalance

uint256

followings of Profile NFT

uri()

Query Profile NFT Metadata.

function uri(uint256 tokenId) external view virtual returns (string memory)
Parameter NameTypeDescription

tokenId

uint256

Profile NFT ID

tokenId: Use the t address uint256, that is, hexadecimal to 10 interpretations.

eg: uint256(uint160("$(address)"))

Return metadata format as below:

the JSON metadata to use base64 encode.

Parameter NameTypeDescription

name

string

name of Profile NFT

image

string

avatar of Profile NFT

maxSupply

uint256

Follower limitation

tokenSupply

uint256

followers of Profile NFT

totalBalance

uint256

followings of Profile NFT

properties

string

extension data of Profile NFT

Last updated