Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 2.26 KB

README.md

File metadata and controls

36 lines (23 loc) · 2.26 KB

One of your team mates has just posted in slack that they’ve fixed that gnarly bug. What do you do? Give them the muscle emoji of course. What if you could reward them with your own company token to show your appreciation.

Strong work is a PoC that enables colleagues to reward each other ERC20 tokens by adding specific reactions to their team mates slack messages.

StrongWork.mp4

Please note: You can't reward yourself, the check was removed for the purposes of this demo.

How it works

Strong works consists of a slack app, smart contract, a cloud function and a front-end.

Slack App

Slack was used for this PoC, however another service with a webhooks API (such as discord or telegram) could be used instead. The slack app does a few important things.

  • It handles the Slack OAuth in the frontend
  • listens out for the reaction:read event in a specific channel
  • Posts a message in the channel with a link to the confirmed blockchain transaction receipt.

The smart contract comprises of two (non-admin) functions. Update and reward. The update function adds a mapping of the users slack ID to their ethereum address and the reward function, you guessed it....rewards the user.

Slack's event API calls an endpoint when certain events happen. In this instance, the cloud function is called when the reaction:added event is fired. The cloud function then does a couple of checks and calls the reward function in the smart contract sending along with it the Slack ID of the receiver of the reaction.

Frontend

The frontend is a simple NextJS app. A mapping of the users ethereum address and slack ID needs to be added to the smart contract in order for them to receive rewards. The main functions of the frontend app are -

  • Authenticating via Slack OAuth
  • Authenticating via Metamask
  • Calling the update function in the smart contract.