目录

zkMessage

A simple contract for onchain broadcasting

The zkMessage smart contract is a role-based messaging system deployed on the ZKsync network. This contract allows an admin to assign specific users as “messengers” and enable them to broadcast messages on-chain. The admin has the ability to assign or revoke messenger roles, ensuring only authorized users can send messages.

The intention is that this contract can be used to broadcast a message that can be picked up by an RSS feed, composable with other software such as Slack, Telegram, Discord, Discourse, etc.

Methods / Functions

Assign Messenger: The admin can assign a user as a messenger by calling the assignMessenger function with the user’s address and a role tag.

Send Message: Authorized messengers or the admin can call the sendMessage function with a string message. The contract will emit the MessageSent event.

Revoke Messenger: The admin can revoke a messenger’s role using the revokeMessenger function.

Transfer Admin Role: The admin can transfer their role to a new address using the setAdmin function.

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号