Inspiration
The world of crypto, blockchains, and distributed ledgers is currently rife with scam artists, "get rich quick" schemes, and profiteers. This was not the original intent of blockchain technology when Satoshi wrote the Bitcoin paper back in 2008, setting off a cascade of groundbreaking technologies like the Hedera Hashgraph. "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks." They intended this blockchain to enable everybody to take part in the financial system, and one aspect that has fallen to the wayside is the concept of "giving". This is where Eleeos comes in. Eleeos aims to be a trusted marketplace of donation recipients where individuals can pick from a set of causes or individuals they care about, verify that the money donated will make it into the correct hands, and building customized funds that can split donations across multiple recipients.
What it does
Eleeos is built with three key tenets in mind. Trust, transparency, and accessibility. We uphold these tenets through the power of the Hedera Hashgraph, the accessibility given by a mobile-first world, and the secure infrastructure upon which Web2 was built.
Causes, individuals, or organizations wishing to participate in the recipient marketplace place a set of HTML meta tags on their website's index.html that identify themselves, one or more tags so that they can be search for on the marketplace, and their Hedera account ID so that ownership of the account can be attested. By the power of public key infrastructure and transport layer security (TLS), as long as the Eleeos gateway API is using secure DNS servers, the ownership of accounts can be guaranteed so that donations make it to the intended recipients, preventing scams and fraud. As long as the website is considered trustworthy and the source of truth for the cause, so can the addresses embedded.
Those wishing to donate can then browse the Eleeos marketplace and build groups of recipients which will be organized into "funds". An Eleeos fund contains two or more recipients, each allocated a particular number of "shares" that must total up to 100. These funds are represented as smart contracts on the Hedera network, availabile for anyone to donate to (although visibility in the gateway can be set as private) and view how monies are being transferred. This transparency of money movement creates accountability and trust, knowing how much each recipient is getting, which funds they are receiving money from, and the "popularity" of marketplace participants based on number of funds the are listed in, how many total shares they are allocated, frequency of disbursements, and volume of disbursements. Transparency ultimately helps to uphold the first tenet of trust as well.
Web3, to date, is notorious for being difficult-to-understand and hard for the average person to break into. This contradicts the tenet of accessibility that Eleeos rigorously upholds. Everybody in this world should be able to make an impact on the causes they care about. To enable accessibility, we leveraged Flutter as the frontend framework of choice so that all platforms are accounted for, enabling the masses to participate in creating customized impact funds. Eleeos is compatible on all major devices, incuding web, iOS, and Android. This acceesibility is further reinforced through the use of the Sonic protocol. Sonic enables secured storage of the cryptographic artifacts used for signing transactions on the network. Inspired and heavily derived from the Audius Hedgehog Protocol, Sonic adds support for multiple BIP32 derived wallets, profiles, PIN-encryption on the device, password changes, and all existing functionality from the Hedgehog Protocol. Perfectly suited for low risk web3 dApps, Sonic enhances the user experience so that users do not need to have knowledge of the underlying signing, private keys, BIP32, BIP39, BIP44, and all the complexities that come with participating in the web3 ecosystem. Although not suited for higher risk transactions such as those associated with decentralized finance, it works perfect for the low risk transactions associated with Eleeos.
How we built it
Eleeos was built using three smart contracts, a gateway (API), and a cross-platform Flutter application. The backend was written in Go with a Postgres database to store metadata (we try to keep a majority of the data in the smart contracts). The underlying distributed ledger technology is the Hedera Hashgraph, more specifically the Hedera Smart Contract Service. The smart contracts developed are as follows:
- Factory Contract: Acts as the entry point for funds deployment. Uses the CREATE2 opcode to deploy Eleeos funds and then set the static fees for each fee.
- Fund Contract: The Eleeos Fund contract gets deployed by the CREATE2 opcode to ensure deterministic fund addresses for users. This contract was heavily inspired by the OpenZeppelin Payment Splitter smart contract. The fund contract maintains the recipients, shares, fee details, and disbursements and provides the following interactions:
Constructor: Sets the ownership of the fund
Set Fee: Can only be called once, and sets the fee rate, max fee, and fee recipient for the fund. Update Fund: Sets the shares and recipients for the fund. Can only be called when the fund is first deployed or if the balance is zero. This guarantees that when money is donated to an address, it will reach the recipients specified at that time.
Disburse: This will disburse the fee based on the fee recipient, fee rate, and max fee, and then calculate and disburse the payouts for each recipient, ultimately bringing the smart contract to zero.
Get fund details: Returns all the details of the fund including recipients, shares, last disbursement time, balance, and fund details.
- MultiCall: Taken from the MarkerDao Multicall contract, but adapted to work with the smart contract parameters allowed by the Hedera SDK, allows Eleeos to call multiple
fundDetailson multiple fund contracts at the same time.
Challenges we ran into
The Hedera Hashgraph is a novel platform full of opportunity, but with any novel platform comes the unknown and the allure of roads less traveled. This creates immense opportunity for trailblazers, but presents plenty of challenges. Below are some of the challenges we ran into during development:
- How to interact with Hedera from mobile platforms: Hedera's growing suite of SDKs does not currently have Dart (the language behind Flutter), but this limitation was accounted for by implementing a gateway API that acts as a passthrough for meta transactions.
- How to abstract the concept of gas away from users: Making users account for gas quickly poses complexities and undue burdens for end users. We accounted for this challenge by leveraging meta transactions which utilizes mechanisms present in ERC2771 and OpenZeppelin's ECDSA utility contract.
- How do we account for smart contract security: We took into consideration re-entrancy, frontrunning, access control, and other smart contract vulnerabilities throughout the development of Eleeos. Eleeos has not been audited, but we used battle-tested code from OpenZeppelin for a majority of codebase.
- How do we quickly get the balance of multiple funds: We deployed MakerDao's Multicall Contract on the Hedera testnet to quickly call the
fundDetailsendpoint on multiple funds at the same consensus timestamp. This limits the requests hitting the Hedera node, and also ensures we are pulling the data at a single consensus timestamp.
Accomplishments that we're proud of
We are one of the first, if not the first, to develop a cross-platform Flutter application that has the Hedera Hashgraph at its core. This undertaking was not taken lightly as we wanted to ensure we could reach as many people as possible, on as many platforms as possible. This cross-platform capability with Flutter is what we are most proud of. Second to that, we discovered a lot of tricks when working with the Hedera Smart Contract Service and platform in general that benefited the Eleeos platform.
What we learned
Throughout the project, we learned how the Hedera Smart Contract Service works, tricks for deploying and testing smart contracts on Hedera, and how gas fees work on Hedera. With these discoveries, further expanded upon in the challenges section above, we plan to share tips and tricks with the Hedera community in order to further foster a collaborative developer ecosystem.
What's next for Eleeos
Eleeos is nothing without the participation of people. This can only come with an incredible user experience that makes people want to use the platform. The Eleeos platform will continue to evolve, with the following concepts:
- Continue to add additional data points to the user interface to give better insight and understanding to users
- Further hone the smart contracts to be optimized and secure, while maintaining accessibility outside of the Eleeos gateway
- Enhance the participant marketplace to be easier to join and browse since Eleeos is faced by the "double-sided market" problem
- Introduce community-controlled funds which use a governance token minted on the Hedera Token Service (DAO funds)
Ivy Deploy
While building Eleeos we ran into a problem where iterating quickly for "hackathon style" development was difficult without some tools in place. For this, we built a set of scripts which we rolled into a tool called Ivy Deploy (hedera is latin for Ivy). We are continuing to add additional functionality to Ivy deploy, but we have started with has allowed us to test the Eleeos platform quickly and effectively. The available functionality can be found in the readme on the Github repo, along with examples, and the code. https://github.com/Eleeos-Crypto/ivy-deploy
Built With
- dart
- flutter
- go
- hashgraph
- hedera
- postgresql
- solidity
Log in or sign up for Devpost to join the conversation.