Docs Home

This details the content of the post contract. View Deployed Contracts for the address.

Since PostPlaza is an on-chain platform, posts can also be directly created and interacted with on a block explorer that supports contract interactions.

MintPost

Each post is created with the mintPost function in the PostPlaza post smart contract.

Parameter Description
Poster Address of the poster. This can be different from the address sending the transaction, which could be a relay.
Content Content for the post. This is stored on-chain. “;IpfsImageHash:[imgIPFSHash]” is used to set an image. ";PostNFT:[nft_addr]_[nft_id]” is used to set an external NFT image.
MetadataURI Can be empty if no image. NFT image is auto generated into an SVG if it is just text. If the post contains an image, however, MetadataURI is needed to show the image as the NFT’s image.
ParentPostId The tokenId of the post being replied to, should be 0 if not a reply.
Tags Tags that can be used to differentiate between types of posts, and potentially types of platforms post should be shown on.
Seed A tokenId is created with a hash of the poster, the content, and the seed.
Signature An optional parameter for a relay to use if the transaction was signed with EIP-712. This lets the interaction be free for the poster, since the relay address pays the gas fee.

Other functions in the post contract

Function Description
setApprovalForAllByApprovedAddress Approved Address can set approval for marketplace to sell the NFT posts.
createCollectionProfile Creates a collection for the user’s NFT posts. If this isn’t called, a collection is automatically created when the user mints their first post.
batchMintPosts Mint multiple posts at the same time.
deletePost Delete a post. Can only be used if the poster is currently the owner of the NFT.
upvote Upvote a post. This emits an event. Data is only stored on the blockchain in the form of an event.
removeUpvote Removes upvote. This emits an event. Data is only stored on the blockchain in the form of an event.
downvote Downvotes a post. This emits an event. Data is only stored on the blockchain in the form of an event.
removeDownvote Removes downvote. This emits an event. Data is only stored on the blockchain in the form of an event.
repost Reposts a post. This emits an event. Data is only stored on the blockchain in the form of an event.
removeRepost Removes a repost. This emits an event. Data is only stored on the blockchain in the form of an event.
tokenURI Gets the URI for the NFT image. If the post is text-only, the image is a generated SVG. If not, then it returns an IPFS hash to metadata.