Have you heard about Kalamazoo? If not, have I got a story for you!
For this demo project, I wrote a little JavaScript to go along with the two new NFTs that are now on the Theta blockchain.
And, even though the mint is unlimited, there will only be 42 winners awarded! It’s a first come, first served winning spree, so once you understand the concept, make sure you read how to win! (below at claim prize).
Kalamazoo
The main NFT is the Kalamazoo membership demo. This NFT simulates buying a club membership that costs a penny an hour. When a member signs up, there is a joining fee of $0.25 and the requirement that the purchaser funds at least 100 hours’ worth of membership time.
To do this, I wrote some ‘treasury’ code in the smart contract that allows the NFT owner to manage his Tfuel balance. Anyone can add Tfuel to an NFT, but only the owner of that NFT can withdraw the balance. At any time, anyone can query in order to determine how much tfuel balance is left. If there is a balance, the membership is considered active. If funds backing the token run dry, the owner of the NFT (or anyone else) can reactivate the NFT by placing funds on that account.
The fee associated with minting, reactivation and membership is credited to “The Titled” person (or account). The contract has the idea that there is a project owner and an IT owner. The project owner is considered the property owner, thus is credited the funds associated with the project. The IT owner is allowed to operate admin functionality in the smart contract on behalf of the property owner but can’t claim any funds.
Said differently, funds are managed by token Id. If you put 50 Tfuel on your token that will be used to pay your membership balance over time. But, if you transfer your token to someone else, they will now have ownership of that Tfuel balance which effectively gives them the hours that you just bought. In a way, the Token now has intrinsic value based on the number of hours of membership time it can buy.
Penny Oracle V1
I also created a contract that can be used to provide the current cost of a penny’s worth of Tfuel. The Kalamazoo contract uses the Penny Oracle V1 in order to determine the dollar price for membership.
This means that the value in the treasury buys more or less time as the price of Tfuel fluctuates. If tfuel goes to a dollar, the Kalamazoo membership will only charge a penny’s worth of tfuel per hour.
(* There is also a concept of claiming which cements the running calculations. If you want to learn the details, find me in the TraderPunks discord.)
Summary
If I were to spin this contract up again, there are some things that I would do differently. The most obvious thing is to write fewer functions in the smart contract.
Why? Well, Solidity and JavaScript allow for returning multiple values on a call. When loading a page for a website, each call adds to the load time. Thus, rather then call a bunch of small routines to get the ‘status’ of the NFT, it makes more sense to call a getStatus() type routine that returns everything at once.
So, how to you take a closer look?
Kalamazoo Membership
The best way to get involved is to visit the minting page:
Mint Page Here
Oh, and read the whitepaper.
Also, this is a demo, so cut it some slack. The best thing you can do is copy the project and put out something better. If not, help me make it better.
Claim Prize
To win the prize, you have to follow a specific set of steps in order to be allowed to claim a winning position. These steps are designed to show you how to mint, withdraw your balance, reactivate and monitor your remaining hours.
Basically, when there are 15 hours left on your membership balance, the Claim Prize button will activate on the minting page. If there is still a position open, you will be assigned that position and the token will enter the winner’s circle.
The easiest way to get there is to mint, withdraw your balance and then reactivate with enough Tfuel to cover the $0.10 reactivation fee and another $0.15 to enable 15 hours’ worth of membership time. If you get that correct, the minting page will enable the Claim Prize button and you can ‘win’ if you want.