Zeitgeist Fund

MINOR
Rust
Smart Contract
Zeitgeist Fund
CHECK IT OUT ↗

Zeitgeist Fund was a smart contract that I built with Polkadot's ink! smart contract framework in Rust. This was the first smart contract ever built on Zeitgeist that would interact with the core runtime (Polkadot level system calls), which is the true novelty of the ink! programming language.

The smart contract would allow managers to instantiate a fund, letting multiple people contribute money for a single fund manager to reinvest into prediction markets on Zeitgeist.

Tech Stack

The tech stack is quite simple. Everything is written in Rust, with ink! smart contracts. There is no frontend.

Design

The fund is simple. There are two phases, a funding phase and an investing phase.

In the funding phase the manager sets a permanant goal for funding, and investors add ZTG coins to fund it, receiving shares of the fund in return.

Once the funding phase is finished, the manager can interact with the core runtime to purchase and sell positions in the prediction market. At any point the manager can also issue dividends of ZTG to users via a distribution wallet smart contract.

Story

I made this for an Encode Club hackathon, and I was most interested in getting a smart contract that interacted with a call runtime because otherwise I would simply use an EVM + Solidity to write a smart contract.

So, the ink! Encode Club hackathon gave me a chance to both put my Rust to good work as well as experiment with a new feature set that Parity has churned out for the Polkadot ecosystem.

Despite a few weeks of just messing around with the smart contracts and working out the kinks with the entire ecosystem, I was able to fail my first smart contract (a DAO) due to an issue with how data is serialized in ink!. So, I pivoted and started working on a fund like the Zeitgeist team said to do.

The development was actually quite straightforward since I already knew about Zeitgeist and ink! development at this point. There were no hiccups other than those that I encountered while working on the original DAO idea, so I made do. Ultimately, the project was the only smart contract that was able to interact with the core runtime, so it was a winner of the Zeitgeist prize by default.

Interestingly enough, even the Zeitgeist team didn't go through the effort of making a smart contract that would interact with the runtime, so even they weren't sure if it worked or not. It does, or at least a bit of it does. We will see if the Zeitgeist Fund project will get continued funding for its development from the Zeitgeist team.

Zeitgeist Fund was also a finalist for the entire hackathon. You can see the pitch deck on Google Drive. You can also see the demo video on YouTube.

Zeitgeist Fund