ERC-1129 DAPP announcement standard (Standardised DAPP announcements)

Stagnant · Other · created 2018-05-31

Defines a standard structure and permission system that lets a DAPP or service operator post and remove announcements, such as service shutdowns or migrations, within a contract.

Why it is needed

Without this standard, DAPPs or ERC20-style token services have no common way to inform users of situations such as maintenance, contract replacement, or service shutdown. Because each operator posts announcements on different channels such as Twitter, their official site, or Discord, it is hard for users to know where to check, and if an announcement is deleted or edited there is no way to trace what happened in the past. In particular, there is no mechanism at the contract level to guarantee who has the authority to post announcements, or when and why an announcement was taken down, leaving room for impersonation or opaque operation.

What to implement

In depth

Announcer struct

allowedToPost is a bool value indicating whether the address has permission to post announcements, and the canPost modifier checks this value. name is a string used to display the author in a human-readable way.

Announcement struct

author stores a human-readable author identifier, authorAddress stores the Ethereum address linked to the author, and post stores the announcement content itself.

Querying the announcement count

theNumberOfAnnouncements is an OPTIONAL function that returns the number of currently active announcements, intended to display information in a UI faster, and it is stated that the same value can also be obtained from the numberOfMessages variable.

Reading announcements

readPosts looks up the announcement corresponding to _postNumber and returns the author name _author together with the content _post.

Managing posting permission

givePostingPermission is restricted to onlyOwner, so only the owner can call it. It grants or revokes permission by setting the _postingPrivileges value for the _newAnnouncer address, and registers that author's human-friendly name via _posterName.

The canPost modifier

Consists of a require statement checking that posterData[msg.sender].allowedToPost is true, and the function body only executes if this condition passes. It is applied to postAnnouncement to block posting from unauthorized addresses.

Posting and removing announcements

postAnnouncement has the canPost modifier applied, so only an authorized address can post a new announcement with the _message content. removeAnnouncement removes the announcement specified by _messageNumber and reorders the mapping so no empty slot remains, with _removalReason informing the user whether the issue was resolved or what the next steps are.

Events and proposal status

NewAnnouncement MUST be emitted whenever a new announcement is created, reporting the author and message, and RemovedAnnouncement MUST be emitted whenever an announcement is removed, recording the author, message, removal reason, and the address that performed the removal. This proposal's status is Stagnant: it was written in 2018 and has not progressed since, remaining a stalled draft.

Original ERC · ← ERCs