Skip to content

Commit

Permalink
Comments Anytime Protocol (#735)
Browse files Browse the repository at this point in the history
# Comments Anytime Protocol

## Overview
This PR introduces a new social layer to Zora's protocol, enabling comments and value-based interactions ("sparks") on 1155 tokens.

## Key Features
- **Token-gated commenting system**: Allows token owners and holders to comment on 1155 tokens
- **Value-based interactions**: 
  - Token holders pay 1 Spark to comment
  - Creators can comment for free
  - Anyone can "spark" (like with value) existing comments
- **Revenue sharing**:
  - Comment Sparks go to token creators
  - Reply Sparks go to original commenters
  - 30% protocol fee with 20% available for referrers
- **Cross-chain functionality** through permit-based commenting and sparking
- **Smart wallet support** for commenting as a smart wallet owner
- **Legacy comment support** through backfilling system

## Contracts Added
- `Comments.sol` (`0x7777777bE14a1F7Fd6896B5FBDa5ceD5FC6e501a`)
  - Core upgradeable contract for comment functionality
  - Deterministically deployed across all chains
- `CallerAndCommenter.sol` (`0x77777775C5074b74540d9cC63Dd840A8c692B4B5`)
  - Helper contract for combined mint + comment operations
  - Enables free comments during minting

## Technical Notes
- Implements unique comment identification system using nonces
- Includes comprehensive event system for tracking comments, sparks, and backfills
- Built-in referral system for third-party integrations
- Cross-chain compatibility through permit-based operations

## Security Considerations
- Token ownership verification for commenting privileges
- Value distribution system for Spark payments
- Smart wallet verification system
  • Loading branch information
oveddan authored Nov 21, 2024
1 parent 35de74c commit 337f287
Show file tree
Hide file tree
Showing 136 changed files with 10,497 additions and 615 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@ jobs:
with:
package_folder: packages/1155-deployments
precache: "pnpm run generate"

contracts-comments:
name: Comments
uses: ./.github/workflows/contract.yml
secrets: inherit
with:
package_folder: packages/comments
name: Comments
ignore_coverage_files: '"*lib*" "*mock*"'
skip_storage_layout: true
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"yaml": "2.3.4"
},
"devDependencies": {
"@reservoir0x/relay-sdk": "^1.3.3",
"@zoralabs/tsconfig": "workspace:*"
}
}
12 changes: 12 additions & 0 deletions docs/pages/changelogs/protocol-deployments.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# @zoralabs/protocol-deployments Changelog


## 0.3.9

### Patch Changes

- [4928687d](https://github.com/ourzora/zora-protocol/commit/4928687d): - Include the `Comments` and `CallerAndCommenter` abis and deployed addresses.
- Added new exports for Comments contract cross-chain functionality:
- Introduced `permitCommentTypedDataDefinition` function to generate typed data for cross-chain permit commenting
- Introduced `permitSparkCommentTypedDataDefinition` function to generate typed data for cross-chain permit sparking
- Introduced `permitTimedSaleMintAndCommentTypedDataType` to generate typed data for cross-chain permit minting and commenting.
- Introduced `permitBuyOnSecondaryAndCommentTypedDataDefinition` function to generate typed data for cross-chain permit buying on secondary and commenting.
- Added `sparkValue` helper function to get the value of a Spark

## 0.3.8

### Patch Changes
Expand Down
9 changes: 9 additions & 0 deletions docs/pages/changelogs/protocol-sdk.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# @zoralabs/protocol-sdk Changelog


## 0.11.9

### Patch Changes

- [9d5d1638](https://github.com/ourzora/zora-protocol/commit/9d5d1638): When minting + commenting, and using the timed sale strategy, protocol sdk will call the CallerAndCommenter contract
- [088ec6fb](https://github.com/ourzora/zora-protocol/commit/088ec6fb): When buying on secondary, you can now add a comment, which will call the CallerAndCommenter's buyOnSecondaryAndComment function.
- Updated dependencies [4928687d](https://github.com/ourzora/zora-protocol/commit/4928687d)
- @zoralabs/protocol-deployments@0.3.9

## 0.11.8

### Patch Changes
Expand Down
Loading

0 comments on commit 337f287

Please sign in to comment.