Github
https://github.com/thearthurchen/TogetherWeRun
Inspiration
The importance of health and fitness has garnered increasing awareness over the past decades and is a major striving point in society. One of the most predominant issues with building good habits with fitness is primarily due to the aspect of motivation. In a world where a vast amount of finances are spent on memberships, coaches, and other external motivational aspects, we would like to offer a different approach. Studies have shown that peer motivation and positive reinforcement builds some of the best habits and we have attempted to pull together that foundation with the help of smart contracts.
What it does
Our smart contract allows an individual to construct a fitness goal with friends, all make pledge amounts towards it, and have it automatically return their pledge based on smart contracts. In our demo, we leverage the Ethereum blockchain to lock in a set goal of running with pledged funds, and Chainlink to interface with an external fitness tracker (Strava) to automatically detect completion. If all friends are able to meet the goal within the set timeframe, they will receive their pledged amounts back to their wallets, otherwise it will be donated to a pre-selected charity wallet address.
How we built it
The main contracts have two parts, the BetterTogetherGateway and EscrowFactory which are configured to deploy via the hardhat development environment.
Note: The EscrowFactory was created because creating Escrows in Pact would cause the BetterTogetherGateway contract to exceed the maximum contract size.
The BetterTogetherGateway also acts a Pact Factory for users who create pacts. It allows users to create or join existing Pacts. It also contains the lists of Pacts that are created to keep track of what has been created.
The Pact allows a "Host" user to configure the contract with settings such as the miles to run, the pledge amount required, and the goal deadline timeframe. "Friends" can join this Pact via an invite code upon which the "Host" can then start the pact.
Challenges we ran into
- Contract size exceeded the limit for Kovan. As described above we had to split certain factories out and use interfaces to interact with them.
Accomplishments that we're proud of
We are proud of the fact that we created a full E2E working Smart Contract with Chainlink External Adapters and Oracles where multiple users could interact with said contracts.
What we learned
A lot about Solidity and the general limitations of deploying smart contracts.
What's next for TogetherWeRun
- Authentication
- Extensibility for other Health/Fitness APIs
- Linking to desired charities



Log in or sign up for Devpost to join the conversation.