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 :
- 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.