Skip to content

Instantly share code, notes, and snippets.

@jim-toth
Last active January 23, 2024 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jim-toth/827a79a7cc3670edaccdd779cc56a086 to your computer and use it in GitHub Desktop.
Save jim-toth/827a79a7cc3670edaccdd779cc56a086 to your computer and use it in GitHub Desktop.
SWS-5: Following Interface
Error in user YAML: (<unknown>): did not find expected key while parsing a block mapping at line 1 column 1
---
GroupId: "SWS-5"
Title: "Following Interface"
Description: "This document describes the standard interface for SmartWeave Contracts that represent a list for the tracking of unique blockchain addresses (i.e. "following")."
Topics: 
- "specs"
- "standard"
- "sws"
- "smartweave"
- "following"
- "social"
Authors: 
- "36Ar8VmyC7YS7JGaep9ca2ANjLABETTpxSeA7WOV45Y"
Forks: ""

---

SWS-5: Following Interface

Status: Draft

Version: 1.0.0

Author: Jim Toth (jim@artby.city)

Abstract

This document describes the standard interface for SmartWeave Contracts that represent a list for the tracking of unique blockchain addresses (i.e. "following").

Motivation

While it is possible to design a protocol using simple data uploads to represent a unique list of blockchain addresses, at scale this begins to behave like the SmartWeave Protocol itself. Additionally, developers may wish to implement custom logic for following list contracts for different purposes, such as enabling chain-verified collaboration on these contracts.

Specification

The base specification describes a simple interface for adding, removing, and reading the represented list of blockchain addresses. Note that tracked addresses may be from any blockchain.

Standard Interface

follow

follow(address: string) => void
  • Adds address to the list
  • SHOULD THROW if address is already found in the list

unfollow

unfollow(address: string) => void
  • Removes address from the list
  • SHOULD THROW if address is not found in the list

following

following() => string[]
  • Returns a list of address strings currently tracked by the contract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment