Zombie Chains - Hoarder's Collections
The first on-chain PvP tournament system powered by Plutus V2 smart contracts on Cardano. Players can participate in 1v1 battles or tournaments with up to 32 players!
Last updated
The first on-chain PvP tournament system powered by Plutus V2 smart contracts on Cardano. Players can participate in 1v1 battles or tournaments with up to 32 players!
Last updated
Zombie Chains, part of Hoarder's Collection, planned to build a PvP battle and tournament system on Cardano utilising their existing NFT collections - Zombie Chains, Zombie Hunters, Zombie Fight Club Aliens and Zombie Fight Club Fight Cards.
The requirement was a system that takes in NFT trait attributes in a transparent and fair manner, and simulate fights between players, with the chance of winning determined by the difference in NFT strength score between the players. This needs to be built to support 1v1 battles, and a grand tournament system of up to 32 players. Ideally the fees sent in by players should be held in a smart contract without single ownership.
We agreed on the team's requirement of holding player fees in a smart contract without single ownership, and proposed a solution to build this system. The battle and tournament systems were built separately, each featuring a system comprising of 4 interacting parameterised smart contracts, taking advantage of Cardano's eUTxO model and the composability of transactions to execute each battle and tournament.
For the battle system (1 vs 1 Battle), we opted to use a single smart contract system initialised by a Battle Admin Wallet which contributes a seed UTxO to mint a thread token to kickstart the system. The whole system comprises of:
Thread token minting contract
Oracle token minting contract
Oracle token holding contract
Battle wager holding contract
These 4 smart contracts work alongside each other to generate results and publish them onchain for each battle, and to release the correct rewards for each player depending on battle result.
For the tournament system, we chose to use a dynamic set of parameterised smart contracts, resulting in a unique set of 4 smart contracts for each tournament. All the tournament parameters, including buy-in price, buy-in currency, prizes etc, are entered into the smart contract system as parameters and therefore, every tournament will have a unique set of smart contract byte code.
This system comprises of:
Tournament main contract
Tournament slot id token minting contract
Tournament tag token minting contract
Tournament oracle token minting contract
The intricate interplay of these smart contracts ensures that each slot within the tournament can only be occupied once, and that every participant's strength score is verified, preventing foulplay. The tag token is particularly designed to work with the oracle minting contract such that the oracle minting contract must consume 2 tag tokens every time it mints a set of fight outcome, resulting in fight outcomes that will only ever be minted once, ensuring fairness and eliminating ambiguity.
This system is powered by a Tournament Gamemaster Wallet which deploys all 4 contracts on-chain using its own ADA upfront, then re-coups the ADA from the tournament participants' entry fee while orchestrating the minting of oracle tokens and advancement of players from round to round. This ensures a perpetually sustainable system powered by fair and transparent fees, producing reliable and definite results for each fight.