Inspiration
We want to apply Soroban to a game that uses blockchain technology as its basis. After considering several options, we chose a game similar to cow farm management. That's the idea that built the Cowchain Farm.
What it does
Basically, Cowchain Farm is a game where you can Buy, Feed, Sell, and Auction your Cow in the app. The primary purpose of this activity is to increase the Cow's price to make a profit.
We'll try to explain briefly how the app works.
BUY
First, you have to Buy the Cow in the Market. Your Cow will have a random gender chosen by the smart contract and have a life for 24 hours.
FEED
Take care of your cows by feeding them every 6 hours. Every time you feed the Cow, their lifetime will be prolonged for the next 24 hours. It will die if you don't feed your Cow longer than 24 hours.
SELL
You can start selling your Cow to the Market after their age reaches 3 days. Their selling price depends on how well you feed them. If you always feed them on time, between 6-12 hours after the last feed, the price will increase quite well.
AUCTION
You can interact with other players of Cowchain through auctions. There's no age limit on auctions. You can start auctioning your Cow as soon as you buy them from the Market.
Every time you bid on an auction, your funds will be transferred to the Cowchain Farm contract account, which acts as a temporary holding account until the auction has ended.
If someone outbid you at an auction, your funds will be refunded.
If you win the auction, the cow ownership will be transferred to you.
If your Cow is successfully auctioned, the funds from the bidder will be transferred to you.
When the auction is ended, you have to finalize it. You can do it manually by pushing the Claim button on the Auction page. But most of the time, the notification service automatically does it for you.
PUSH NOTIFICATION
Cowchain also has a notification service to help users play this game. Users install the Cowchain Farm notification application and register the Stellar wallet address they use for Cowchain. After that, the notification service will tell them everything happening to their Cowchain Farm cows.
You can download the prebuild Android APK file at this DropBox link.
You can also clone the repository for the Cowchain Farm notification app at Cowchain Farm App repository and build the app by yourself
You can read more about installing the Mobile Notification apps in the DEV.to article below. Currently, the app is only available for Android.
How we built it
The main framework that we use to build the Cowchain Farm is Flutter. We chose Flutter because it's a cross-platform framework, and the Flutter Stellar SDK is very well-maintained and already supports Soroban.
The first thing we do is build the contract, then the Flutter web app, the Mobile notification app, and lastly, build the Notification service using Dart CLI.
Challenges we ran into
Initially, there were several bugs in the Flutter Stellar SDK, which caused us not to be able to call smart contract functions.
These bugs occurred on the web platform. This happens because the Flutter Stellar SDK has not been optimized to run on a web platform.
The final bug we encountered was when we tried to compile the Dart CLI for Notification service into an executable file. This bug can be resolved, so now we can confirm that we can use the Flutter Stellar SDK for websites as well as CLI.
Accomplishments that we're proud of
We are very proud to be able to contribute to Flutter Stellar SDK to test it to run on various platforms. We are also proud that we can finish this hackathon with all the bugs and the breaking changes that happened.
What we learned
A lot of things. We cannot describe them one by one. All we can say is that Soroban is very powerful and very capable of making anything with it. The limit is only our imagination.
What's next for Cowchain Farm
Currently, only adult cows are available, it would be more interesting if we could develop cow features starting from birth, growth, maturity, and death. Some crazy ideas: maybe cow racing could be developed as a feature in the future.

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