KUTHULU
The Heart of the Madness!
Contract Address: 0x1337AF99B61116CE034C1972EEc87cF348Dd668e
Table of Contents
Warrant Canary
This is what may be the first of it's kind, a warrant canary for a smart contract
This value should always return "safe" or "test" (on a temp basis)
A warrant canary is a statement that declares that an organization has not taken certain actions or received certain requests for information from government or law enforcement authorities. Many services use warrant canaries to let users know how private their data is.
Some types of law enforcement and intelligence requests come with orders prohibiting organizations from disclosing that they have been received. However, by removing the corresponding warrant canary statement from their website (or wherever it is posted), organizations can indicate that they have received such a request.
Since contract deployment, KUTHULU has the following warrant canaries posted:
KUTHULU has never turned over our encryption or authentication keys to anyone.
KUTHULU has never installed any law enforcement software or code in any smart contract
KUTHULU has never modified the intended destination of DNS responses at the request of law enforcement or another third party.
Public Functions
postMsg
The postMsg
function is used to post a new message into KUTHULU. The function takes various parameters including message, _hashtags, taggedAccounts, uri, attribs, and inGroups.
Inputs
message
string
The message you want to post.
_hashtags
array of strings
An array of hashtags to associate with the post. Limit to maxHashtags. (optional)
taggedAccounts
array of addresses
An array of addresses to tag with the post. Limit to maxTaggedAccounts. (optional)
uri
string
A URI to attach to the post. Can be used to attach images / movies / etc. (optional)
attribs
array of uint256
An array of post attributes (comment level / comment to / repost of / group ID)
attribs[0]
- Comment Level Allowed (0 = No comments Allowed, 1 = Comments Allowed)
attribs[1]
- Message ID of the post it is a comment to
attribs[2]
- Message ID of post if it's a repost of another post
attribs[3]
- Group ID to be posted as
attribs[4]
- 0 = MATIC tips / >0 = Tips from ERC20 Contract (Contract Address is the last address in taggedAccount array posted)
inGroups
array of uint256
An array of group ID that this message is being posted into. Must be a member of groups. (optional)
Outputs
There is no direct output returned by the function. However, two events are emitted:
logMsgPostMsg1
logMsgPostMsg2
The events take the message ID, the poster address, the message, an array of hashtags, an array of tagged accounts, and other related parameters as arguments.
Example
The following example demonstrates how to use the postMsg
function using ethers.js:
In this example, a message is posted to the contract with a specified message, hashtags, tagged accounts, a URI, attributes, and group IDs. The function is called with a signer (the account that will post the message) and an attached MATIC amount to be used for tips. The wait
function is used to ensure the transaction is mined before proceeding.
Erase Message
This function allows a user to archive a message they posted. Only the original poster can remove thier post.
This clears the data from the blockchain and KUTHULU, but the history of it is ALWAYS there. You can never completely erase anything from the blockchain. Ever.
Input
msgID
uint256
The message ID you want to erase
Output
This function does not return any output.
Example with Ethers.js
Toggle Like
This function allows a user to toggle their like status for a specific message.
Input
msgID
uint256
The message ID you want to toggle the like for
Output
This function does not return any output.
Example with Ethers.js
Follow User
This function allows a user to follow another user or group.
Input
addressToFollow
address
The user or group address to follow
Output
This function does not return any output.
Example with Ethers.js
Unfollow User
This function allows a user to unfollow another user or group.
Input
addressToUnFollow
address
The user or group address to unfollow
Output
This function does not return any output.
Example with Ethers.js
Get Message IDs by Address
This function retrieves message IDs posted by a specific user or group. The startFrom
parameter allows you to paganate through results by passing in the message ID you want to start from. This will returm a maximum of maxMsgReturnCount
. If you want to receive all the comments from a user or group, set getUserComments
to true. If you want to view a all the posts a user or group has reposted, set getUserReposts to true.
Input
usrAddress
address
The user or group address to get message IDs for
startFrom
uint256
The place to start from for paginating
getUserComments
bool
(optional) true = get only the comments of a user
getUserReposts
bool
(optional) true = get only the reposts of a user
Output
This function returns an array of message IDs.
Example with Ethers.js
Get Sub IDs by Post
This function retrieves a list of comment IDs or repost IDs of a given message ID.
Input
msgID
uint256
The message ID to get comments or reposts for
startFrom
uint256
The place to start from for paginating
isRepost
bool
(optional)
true = get the reposts of the message
false = get the comments of the message
Output
This function returns an array of message IDs.
Example with Ethers.js
Get Message IDs by Hashtag
This function retrieves a list of message IDs that have a certain hashtag.
Input
hashtag
string
The hashtag to get messages for
startFrom
uint256
The place to start from for paginating
Output
This function returns an array of message IDs.
Example with Ethers.js
Get Message IDs by Tag
This function retrieves a list of message IDs that have a certain user or group tagged in them.
Input
taggedAddress
address
The user or group to get messages for that they are tagged in
startFrom
uint256
The place to start from for paginating
Output
This function returns an array of message IDs.
Example with Ethers.js
getMsgsByIDs
This function returns a multi-dimensional array of message data for a given list of message IDs. It uses the MessageData contract to define the structure of the data. The number of IDs that can be passed must be less than maxMsgReturnCount
.
Input Parameters
msgIDs
uint256[] calldata
An array of message IDs to get data for.
onlyFollowers
bool
If set to true
, it will return only messages of accounts that the provided address follows.
userToCheck
address
This address will be used to filter the response to contain only messages from accounts that this user follows.
Return Parameters
string[][] memory
A multi-dimensional array of message data.
Example Usage with ethers.js
getStats
This function returns an array of all stats for the app including message count, comment count, groupPosts, reposts, hashtags, tags, likes, tips, and follows.
Input Parameters
None
Return Parameters
uint256[] memory
An array of stats for the app.
Example Usage with ethers.js
Last updated