Moderation
The Social Moderation contract enables community-driven content moderation. Moderators are elected by the DAO and can flag posts and ban users, with all moderation actions recorded on-chain for transparency and accountability. The protocol also integrates local LLMs in user applications as background content flaggers, providing automated first-pass moderation while maintaining human oversight through the elected moderator system. All moderation operations are accessed through the main SocialSDK.
Moderator Management
Section titled “Moderator Management”Moderators are elected and removed through DAO governance:
import { SocialSDK } from '@akta/sdk/social'
const social = new SocialSDK({ algorand })
// Add a moderator (requires DAO wallet)await social.addModerator({ address: moderatorAddress })
// Remove a moderatorawait social.removeModerator({ address: moderatorAddress })Checking Moderator Status
Section titled “Checking Moderator Status”const meta = await social.getModeratorMeta({ user: address })// meta.exists — whether the address is a moderator// meta.lastActive — timestamp of last moderation actionContent Flagging
Section titled “Content Flagging”Moderators can flag posts that violate content policy:
// Flag a post (requires moderator role)await social.flagPost({ ref: postKey })
// Unflag a postawait social.unflagPost({ ref: postKey })Flagged posts can be filtered by frontends. The flagging status is stored on-chain, so any client can check whether a post has been flagged.
Banning Users
Section titled “Banning Users”Moderators can ban users with an expiration timestamp:
// Ban a user for 7 daysconst sevenDays = 7n * 86_400nconst expiration = BigInt(Math.floor(Date.now() / 1000)) + sevenDays
await social.ban({ address: userAddress, expiration,})
// Unban earlyawait social.unban({ address: userAddress })Checking Ban Status
Section titled “Checking Ban Status”const banned = await social.isBanned({ account: userAddress })MBR Costs
Section titled “MBR Costs”| Operation | MBR (ALGO) |
|---|---|
| Add moderator | 0.0189 |
| Ban user | 0.0189 |
| Remove / Unban | Refunded |
Moderator Gate
Section titled “Moderator Gate”The Social Moderator Gate is a subgate that verifies whether a caller has moderator status. It can be composed with other gates:
Gate + Social Moderator Subgate → Only moderators can executeSee Gates for details on composing access control.