Easier Times Token & Sacred Farm

Building a token that aims to end world poverty using the Sacred Coin Protocol, and building a staking mechanism for the token to reinforce the coin's aim

Easier Times Token & Sacred Farm

Created At

Road to Web3

Winner of

šŸŠ Polygon Pool Prize

Project Description

Before joining this hackathon, I began work on the Sacred Coin Protocol. The Sacred Coin Protocol aims to introduce human values in the DeFi space, and in doing so to expand the value proposition of Defi and attract more users, since traditional finance does not fundamentally address human values - and so, hopefully via the Sacred Coin Protocol, anyone who wants to see money 'be used for good' will be even more drawn to DeFi.

Step 1 of building the Sacred Coin Protocol was creating an add-on to the ERC-20 standard that allows for the inclusion of guidelines into a token. These guidelines are immutable, are meant for users who interact with the coin, and are stored into the smart contract of the token in a standardized way, to allow any protocol to easily retrieve them.

To show off an example, I created the Gratitude Coin, whose guideline is "Every time you buy, sell or otherwise use the coin, take a second to think of something that you are grateful for. It could be your family, your friends, the neighbourhood you are living in or your pet tortoise. Ideally, you should think about something different that you're grateful for every time you use the coin."

The coin also has contract methods that allowed someone to save a message of gratitude whenever they bought or sold the coin. Their message of gratitude (whose structure is hardcoded in coin contract in the form of [name] is grateful for [something]) would be stored on the blockchain as an event, and anyone could go on the contract to see all of the events.

The whole idea of the coin was to encourage the practice of gratitude, by connecting the coin with the idea of thinking about things that you, as the coin user, are grateful for.

However, creating sacred coins like the Gratitude Coin is only the first step in building the Sacred Coin Protocol. The protocol aims to provide an entire ecosystem for sacred coins, that reinforce the coin guidelines while providing monetary value for the user.

To that effect, the next stage in building the Sacred Coin Protocol is to build a DeFi app that: a). Displays the token guideline whenever the user interacts with a sacred coin such as the Gratitude Coin. b). Incentivizes the user to uphold the token guideline, by asking people for some piece of information that is related to the guideline when they interact with the Dapp. For example, for the gratitude coin, the piece of information to ask could be "What are you grateful for?", and every time you trade using the coin, you have the option of answering the question, which would reinforce the guideline of the coin.

This is because the power of a sacred coin built using the Sacred Coin standard is via the psychological effect known as 'nudging' via presenting the guideline to people and nudging them to think of what they're grateful for when they transact with the coin.

Current Project

The project is comprised of two parts: Building a sacred coin for this project and building an innovative staking mechanism and coin production mechanism around the coin. Both are integrated into one contract which has been deployed to the blockchain.

  1. Building a sacred coin

In order to illustrate the power of the staking mechanism, we will be creating a coin called the Easier Times Token (Symbol: UPNUP), whose aim is to end world poverty (#humblebeginnings). The coin has two guidelines:

  1. Help to remove poverty: "Every time you share or stake the coin, think of ways in which you can help to remove poverty in the world, and whenever possible act on those thoughts. It can be something at the level of your family, your community, your city, up to the whole world."

  2. Share the coin with those in need: "Perhaps one of the best ways to potentially remove poverty is to share the Easier Times Token with those who find themselves fallen on hard times. That way, a high demand of the coin can become eponymous with reducing poverty in the world, since whoever has these coins will have their finances improving."

  3. Building The Staking Mechanism

The total supply of the The Easier Times Token (UPNUP) is 679 million, which coincides with the latest numbers on the amount of people that live in poverty around the world. However, only one million tokens have been minted when deploying the contract. The only way to get more tokens is by staking the existing ones into the token contract. Importantly, when you stake, you are required to write a message that will be stored as an event on the blokchain.

The message can take one of two formats:

ā— Type 1: Lately, I helped to remove poverty from the world by [insert the rest of the message here].

ā— Type 2: [Insert name]'s challenging times story is [insert story].

You can choose which message you want to provide. Since it is the blockchain, anyone can query the data to see what has been written by others.

When you stake the coin, you also have the option of which timeframe to stake the coin in:

ā— If you stake for 4 weeks, your reward is 0.1% of the amount you stake per hour.

ā— If you stake for 2 weeks, your reward is 0.16% of the amount you stake per hour.

ā— If you stake for 1 week, your rewards are 0.2% per hour. That's double than if you were to stake for 4 weeks!

The reason why you are rewarding for staking for less time is because the value of the coin rests in its ability to nudge people into thinking of ways to remove poverty, and the more often people need to come on this website do that, the better.

But there's a catch to the staking mechanism! You will need to withdraw your tokens before your timeframe ends in order to collect any rewards. So if you staked for 1 week, you will need to withdraw your token before a week passes. If you staked for 2 weeks, it will need to do it before 2 weeks pass, and so on.

If the amount of time that passes is over the timeframe you select (1 week, 2 weeks, 4 weeks), and you haven't either withdrawn your stake, or added more UPNUPs to the stake, then you lose your rewards! This is so as to have users interact with the coin and therefore increase its value. However, you will not lose the initial amount staked. That you can always withdraw.

For more information on the staking mechanics, please visit the dApp page. I'm writing this in the final moments of the hackathon, and my head's a little woozy. :)) The page I think describes it better.

You can extend the deadline by adding more UPNUP to the stake. That automatically compounds your stake, and resets your timer.

Or you can withdraw your stake, and then restake, which will reset the timer as well. The process will cost you some gas, but the mechanics are intentional, to give you space to think of how to use your new amount of Better Times Token. Perhaps by giving some away to those you meet that have hit upon hard times.

Finally, the last thing to know is that you cannot withdraw your tokens until the cooldown period has passed, which is 3 days after staking. You can, however, add new coins to reset the timer at any time.

Why this Dapp?

The reason for creating this Dapp is because DeFi users usually end up compounding farm tokens. That is, they sell the farm token and then use the revenue to buy more of the original tokens and stake them back into farming. This process is cyclical, and so having this process as part of the Sacred Coin Protocol is great, because it can serve as a tool to reinforce the guidelines of the coin.

Usually farming is done by staking liquidity pool tokens, but that requires building a DEX, which would take much longer than the few days that I have available as part of EthGlobal, and in any case, this project is a great stepping stone towards building a fully fledged DEX that incorporates sacred coins.

How it's Made

This project is based on a number of technologies that work together.

For the backend, I used truffle, ganache, of course solidity, IntelliJ Idea for the IDE.

In terms of libraries, I used the OpenZeppelin library, the Sacred Coin Protocol library, and as a starting point for the staking mechanism I used a library by percyblomer

https://github.com/percybolmer/DevToken/tree/stakeable

Although it is heavily modified.

The frontend is built using html, css, javascript. I used a template for the design, but I've heavily modified that as well to accommodate web3, as it was only built for web2.

I of course used Polygon for deploying the contracts - it is the L2 that I used before this project in my own work.

In terms of how, it also took all of my time since the hackathon started, but that may be outside of the scope of technology.

background image mobile

Join the mailing list

Get the latest news and updates