Plasa Protocol is a decentralized platform that implements a unique system of Stamps, Points, and Questions for community engagement and governance. This README provides an overview of the main components and their functionalities.
Plasa Protocol is a decentralized platform that implements a unique system of Stamps, Points, and Questions for community engagement and governance.
Spaces represent communities, organizations, or leaders using Plasa for their community engagement and governance. Each Space manages its own follower stamps, points, and questions.
Key features:
- Deploys and manages Follower Since Stamps and Follower Since Points
- Creates and manages Fixed and Open Questions
- Customizable space information (name, description, image URL)
- Stamps: Represents a user's follower status since a specific date on a platform.
- Points: Calculates points based on how long a user has been a follower.
- Questions: Both Fixed and Open questions for community voting and governance.
Stamps are non-transferable ERC721 tokens that represent specific achievements or statuses within the Plasa ecosystem. There are two types of stamps:
- Represents ownership of an account on a specific platform (e.g., Twitter, GitHub).
- Each stamp is unique to a platform and username combination.
- Minting requires a signature from an authorized signer.
Key features:
- Platform-specific (e.g., "Twitter", "GitHub")
- Username-to-stampId mapping
- Signature-based minting
- Represents a user's follower status since a specific date on a platform.
- Each stamp includes a timestamp indicating when the follow relationship began.
- Useful for calculating duration-based points.
Key features:
- Platform and followed account specific
- Stores the follow start timestamp for each stamp
- Signature-based minting
Points are non-transferable ERC20-like tokens that represent a user's influence or participation within the Plasa ecosystem. There are two types of point systems:
- Calculates points based on how long a user has been a follower.
- Uses the Follower Since Stamp to determine the duration of following.
- Points increase over time as long as the user remains a follower.
Key features:
- Time-based point calculation
- Integrates with Follower Since Stamp
- Non-transferable
- An extension of Follower Since Points that considers multiple follower relationships.
- Allows for different point multipliers for various platforms or followed accounts.
- Aggregates points from multiple Follower Since Stamps.
Key features:
- Supports multiple follower relationships
- Configurable point multipliers for each relationship
- Aggregates points across platforms or followed accounts
Questions are the core of the Plasa governance system, allowing users to create and vote on proposals. There are two types of questions:
- Has a predefined set of options that cannot be changed after creation.
- Users can only vote on the existing options.
Key features:
- Immutable options
- Voting based on user's point balance
- Allows users to add new options during the voting period.
- Requires a minimum point balance to add a new option.
Key features:
- Dynamic option addition
- Minimum point requirement for adding options
- Voting based on user's point balance
The Plasa Protocol is implemented using several Solidity smart contracts:
Space.sol
: Main contract for managing a space, including follower stamps, points, and questions.Stamp.sol
: Base contract for non-transferable ERC721 tokens (stamps).AccountOwnershipStamp.sol
: Implementation of the Account Ownership Stamp.FollowerSinceStamp.sol
: Implementation of the Follower Since Stamp.Points.sol
: Base contract for non-transferable ERC20-like tokens (points).FollowerSincePoints.sol
: Implementation of the Follower Since Points system.MultipleFollowerSincePoints.sol
: Implementation of the Multiple Follower Since Points system.Question.sol
: Base contract for voting questions.OpenQuestion.sol
: Implementation of the Open Question type.FixedQuestion.sol
: Implementation of the Fixed Question type.
These contracts work together to create a comprehensive system for community engagement, reputation tracking, and decentralized decision-making.
For detailed information on each contract and its functions, please refer to the inline documentation in the source code.
The Plasa Protocol provides various ways to query data from the smart contracts. Here are some common queries and how to perform them:
Each space contract has a getSpaceView()
function that returns a SpaceView
struct. This struct contains all the information about the space.
plasa-protocol/src/spaces/interfaces/ISpace.sol
Lines 153 to 156 in d55d048
plasa-protocol/src/spaces/interfaces/ISpace.sol
Lines 14 to 47 in d55d048
Each question contract has a getQuestionView(address user)
function that returns a QuestionView
struct. This struct contains all the information about the question and the user's voting status.
It includes an array of OptionView
structs, which contain information about each option.
plasa-protocol/src/voting/interfaces/IQuestion.sol
Lines 124 to 127 in 19eaa42
plasa-protocol/src/voting/interfaces/IQuestion.sol
Lines 25 to 40 in 19eaa42
plasa-protocol/src/voting/interfaces/IQuestion.sol
Lines 42 to 50 in 19eaa42
plasa-protocol/src/voting/interfaces/IQuestion.sol
Lines 10 to 15 in 19eaa42
More details can be found in the IQuestion.sol
interface.
plasa-protocol/src/stamps/interfaces/IFollowerSinceStamp.sol
Lines 34 to 46 in d55d048
plasa-protocol/src/voting/interfaces/IQuestion.sol
Lines 98 to 101 in d55d048
plasa-protocol/src/voting/interfaces/IOpenQuestion.sol
Lines 25 to 29 in d55d048