Community token based on ERC-777

Hello!

First of all, thank you for the great examples here on the forum! It really jumpstarted my adventure in blockchain development. Based on some great examples here on the forum I’m currently developing a community token to reward participation within our community. However I’m running into some conceptual issues and hope to find some help.

First things first:

Goal: stimulate and quantify online and offline participation on our community portal by giving out tokens for specific actions. IE: attending a conference, participating in projects

Added value: internally, quantify participation by amount of tokens received. Externally, discounts on products and special offerings.

Secondary: as we are an innovation community. Getting more people familiar with the concept of blockchain and its added value.

The concept :

How:

  • Create Mintable and ownable ERC777 token.
  • Create “vault” contract where the owner of the token “deposit” token to be distributed to community. (In essence an smart contract wallet)
  • Create “activity” contract with a function that gets called (by an action on the community portal) to distribute tokens. Make this contract and operator of the “vault”.

Based on the Simple ERC777 token example I’ve managed to create my own token. Next I’ve created a “vault” and “activity“ contract but couldn’t figure out how and if a smart contract could be an operator of another smart contract. Next to this, is this the best plan of approach?

In every proces I can envision I see security issues in the fact that I give someone the right to take tokens out of someone’s else “wallet”. I thought about whitelisting all know public keys from the community in the “vault” contract and place the withdraw function there. But even then a smart person could call this function from outside the community portal. The vault could have limited funds to counteract this but its still far from perfect.

Any ideas or input are greatly appreciated!

Unfortunately there aren’t a lot of people in my network who understand the blockchain in general.

Other practical problems I try to solve is:

  • how to make onboarding as easy as possible. A great example would be the Reddit vault. However such an example wouldn’t work in an web app
  • Let end user of the community portal call the “withdraw” without the need of signing an transaction in I.e. MetaMask. I’ve already got the gas station network figured out.
1 Like

Hi @Esteday,

Welcome to the community :wave:

First I suggest looking at Points to consider when creating a fungible token (ERC20, ERC777), though I am assuming that the community token has no value.

For a community token I would suggest looking at Burner wallets (web based wallets with generated private keys) running on xDAI sidechain. Onboarding is easy (open a website on your mobile phone or scan a QR code)
Try it out on your mobile phone: https://xdai.io

GitHub: https://github.com/burner-wallet/


For some community rewards, you could look at issuing NFTs (ERC721) rather than fungible tokens for attending events.
https://www.poap.xyz/
(POAPs recenlty moved to xDAI: https://medium.com/@poap/poap-ethereum-xdai-the-experiment-continues-301e08a472ff)

GitCoin Kudos is another example of this idea: https://gitcoin.co/kudos/


As for distribution, you could mint tokens as required directly to the recipients rather than needing a vault or an activity contract.


All development on the GSN has been moved to the OpenGSN organization. They are developing GSNv2.

If you have questions on GSNv2 you can asking in the GSN support telegram: https://t.me/joinchat/F_BETUjG0Crb2s6mFx1LWA

1 Like

Hi @abcoathup,

Thank you for your quick and detailed response. The xDAI ecosystem seems indeed really promising for what I’m trying to achieve. The original plan was to deploy on the Rinkeby test network for the proof of concept. Would you suggest going straight to xDAI?

The reasoning behind choosing a fungible token (which indeed won’t represent any “real world” value outside the community) is the ease of understanding as it closely represents something known. Non-fungible tokens are planned as a next phase in the proof of concept.

The part I still don’t understand is the distribution of tokens. If I would allow everyone to call the mint function of my token wouldn’t that mean that someone with some knowledge would be able to bypass the Community platform and call the contract directly to mint at its own will? Or should I initiate this transaction myself (this would mean a lot of manual actions)? By using the ERC777 and its operator features I was aiming at feature developments and its opportunities to automate these types of transactions instead of allowing an infinite amount in and ERC20 contract.

1 Like

Hi @Esteday,

You could use a public testnet or xDAI. If it is purely for experimentation then I would use a public testnet mainly to use Etherscan as your block explorer. (With xDai you can use Block Scout).


Your server software for the community portal could mint tokens (using an address that has the minter role) based on actions in the community portal (though this assumes that your software knows community members Ethereum addresses).

Alternatively community members could claim an amount of tokens for a specific activity.
You could set up a contract that either has the minter role or holds the amount of tokens that can be claimed.
This could be as simple as anyone calling the claim function gets ten tokens (either minted to them or transferred), to requiring a claim code (let’s ignore front running) that matches a preset hash, to having a merkle proof (see UniSwap example: https://etherscan.io/address/0x090d4613473dee047c3f2706764f49e0821d256e#code)

Hi @Esteday.

I suggest having a look at Circles which launched last week on xDAI for some ideas: https://twitter.com/CirclesUBI/status/1317089513009762304?s=20

1 Like

Hi @abcoathup,

Never did I tought you would think about this question without me answering back, greatly appreciate!

Based on your last answer I managed to let the end user “claim” an x amount of coins with a secret hashed claim code. I was still struggling with making sure a user only claims ones with this claim code but I’am making process. The uni swap example helped greatly.

The given circles example also sparked some new ideas that correspond with my original plan of having a vault owning the token contract.

Many thanks again for the help!

1 Like