# Follow the White Rabbit into the wilderness of ETH Mainnet ButtPlug Wars is an on-chain composability playground. It's not designed to be a DeFi Lego, but more like a decentralized Lego assembly, to play with, and to inspire developers to re-understand and re-significate the space in which we spend our time these days. Its composed of a game (Fiveoutofnine), an NFT marketplace (Sudoswap), and an automation protocol (Keep3r), designed to integrate them into a Capture the Flag (CTF) experience, competing for the underlying value that this gamified inter-connection of blocks generates. ## The badges > One pill makes you larger > And one pill makes you small > And the ones that mother gives you > Don't do anything at all > Go ask Alice > When she's ten feet tall There are 2 types of NFT badges to play with: **Player badges**, and **ButtPlug badges**. With a player badge, you'll be able to vote for a ButtPlug, in order to try to score points for yourself and your team. To mint a player badge, one must stake a Fiveoutofnine NFT and spend some ETH to give it some voting weight: $weight=\sqrt{eth}$ (in that way, a quadratic voting is applied, where more badges overweight same ETH on 1). The staked NFT that can be either be OG -have been minted before the game is announced-, or be official -have been minted through the game, and acquired on the official Sudoswap pool (*)-. > (*) All of the Fiveoutofnine NFTs minted through the game at each move, will be desposited on the pool, that follows a XYK curve, making the price depend only on demand, fast demand will pump the value up, while low demand will accumulate NFTs on the pool and reduce their price. ButtPlug badges will be assigned to on-chain contracts designed to play this game, and they will score points every time they're voted to transact a move, scoring points to all the players that voted for it, depending on the transaction outcome. ## The prizes > And if you go chasing rabbits > And you know you're going to fall > Tell 'em a hookah-smoking caterpillar > Has given you the call > Call Alice > When she was just small If you decide to play, you'll be competing to earn 1 of 2 reward options available: - **Prize**: all of the ETH used for badge minting will be converted to kLPs (*) and staked, the winner team will be able to withdraw them (value exposed to Impermanent Loss), depending on the score of the badge. - **Honor**: all of the ETH collected in the official Sudoswap pool (selling Fiveoutofnine NFTs) will be able to be withdrawn by all of the players that didn't claim the main prize, depending on the inputted ETH of the badge minting -only for players-. > (*) kLPs are tokenized full-range UniV3 KP3R-WETH positions, staked on Keep3r protocol in order to yield KP3R credits, that will reward the keepers for paying the gas costs of the whole game Game tokenomics goes like this: ### Player minting process: ```sequence User->>Game: mintPlayerBadge(eth) User-->>Game: FiveoutOfNine NFT Game-->>UniV3: eth UniV3-->>Keep3r: eth + kp3r Keep3r-->>Game: kLP (weight) Game-->>Game: + processing power Game-->>User: [PlayerBadge] ``` > ⚠️ Notice: a Fiveoutofnine token previous to game deployment, or minted throughout the game are required to mint a Player Badge. ### Purchasing whitelisted tokens: ```sequence User->>SudoPool: purchaseNft(eth) SudoPool-->>User: FiveoutOfNine NFT SudoPool-->>Game: eth (sales) SudoPool-->>SudoPool: ++price ``` > ⚠️ Warning: even tho the game pushes whitelisted NFTs to the pool, an outsider could donate a non-whitelisted one to the pool and still be sold by the pool, not being useful for minting. ### Strategy minting process: > Free for devs: no eth involved (other than deployment costs) ```sequence User->>Game: mintButtPlugBadge(address) Game-->>ButtPlug: owner() ButtPlug-->>Game: owner Game-->>Owner: [ButtPlugBadge] ``` ### Rewards: ```sequence User->>Game: mintMedalNft(badges[]]) User-->>Game: badges[] Game-->>User: FiveoutOfNine NFT[] Game-->>User: MedalBadge NFT ``` The MedalBadge has 2 properties: - the weight: the sum of the weights of the badges of the winner team - the score: the total sum of the scores of the badges (replacing 1 for 0 or negative scores) The LPs are gonna be distributed based on the `weight` of the medal, and NFT sales (that still may increase with time) are distributed to medals based on their `score`. ```sequence User->>Game: claimRewards(medalBadge) Game-->>User: kLP (only once) Game-->>User: eth (sales) ``` After game has ended, all the liquidity is withdrawn and distributed to players, according to their inputted eth (weight) if they were lucky (or smart). And an open method will allow the Sudoswap pool to increase its delta, initiating a Dutch auction on minted and not used Fiveoutofnine tokens remaining on the pool. The eth collected so far, and eth to be collected in future sales, will be distributed to the higher scoring players. ## The chessboard > When the men on the chessboard > Get up and tell you where to go > And you've just had some kind of mushroom > And your mind is moving low > Go ask Alice > I think she'll know The game proposed is to play Fiveoutofnine, an on-chain chessboard, that allows the player to make a white move, and calculates the AI response of the black pieces. Since the AI will always play the black ones, both teams will compete in turns (of 5 days), playing the whites, and scoring points depending the final outcome of the move made. The **team scoring** can be: - `+3` checkmate - `+2` black piece eaten, no white one - `+1` black and white pieces eaten - `+0` no pieces eaten - `-1` white piece eaten, no black one - `-2` read or move reverted By the end of each match, team with more points scores a `+1`, 9 matches will be played, first team to `+5` wins it all. Each time is the team's turn to play, the transaction will read the most voted ButtPlug for the playing team, and read the next move to play from it. Then use a pseudo-random method to determine the depth (smartness of the response of the chess engine), and execute the move, calculating later the previously describe score. ButtPlug's move score will be calculated as the multiplication of weight of the votes deposited on the ButtPlug and the team score (`-2/+3`) of each move. All of the players that voted for that ButtPlug will be exposed the same score (despite the weight of each player's badge). Game move mechanics goes like this: ```sequence Game->>FiveOutOfNine: board() FiveOutOfNine-->>Game: uint256 board Game->>ButtPlug: readMove(board) ButtPlug-->>Game: uint256 move Game-->>Game: calcDepth(board,keeper,salt) Game->>FiveOutOfNine: mintMove(move, depth) FiveOutOfNine-->>Game: [ NFT ] Game-->>SudoPool: [ NFT ] Game->>SudoPool: increaseDelta() SudoPool-->>SudoPool: --price Game->>FiveOutOfNine: board() FiveOutOfNine-->>Game: uint256 board Game-->>Game: calcScore(board1,board2) ``` > All gas expenses of the described transaction will be spent by keepers, external signers that execute the transactions, spending their ETH, and receiveing KP3Rs in reward (that the badge minting liquidity generates). The depth of each move will also depend on the keeper's address, making the pseudo-randomness another aspect of the gameplay. ## The Hall of Fame > When logic and proportion > Have fallen sloppy dead > And the White Knight is talking backwards > And the Red Queen's off with her head > Remember what the dormouse said > Feed your head > Feed your head As ButtPlugs are contracts developed to play, they require to have a standarized way to show what's their proposed move to make. For such, the NFT metadata will show both the proposed move at each time, and the gas spent to process that move (since more gas efficient ButtPlugs are preferred, as they'll be able to transact more often). The overall score will also be only accessible through NFT metadata, being able to see the scoreboard by sorting the NFT collection by `score` rarity index, as well as the `weight` of player badges.