Skip to content

Instantly share code, notes, and snippets.

@steveklebanoff
Last active May 27, 2024 07:55
Show Gist options
  • Save steveklebanoff/a1f842c2279ea3f1ead6cc1c3bbf707e to your computer and use it in GitHub Desktop.
Save steveklebanoff/a1f842c2279ea3f1ead6cc1c3bbf707e to your computer and use it in GitHub Desktop.

Update as of March 14, 2024

Egg Wars soft-launched on Base on March 9th at https://eggwars.xyz

Unanticipated dynamics caused a whale to be able to dominate the game quickly, and the DAO is considering options to launch a second iteration. Suggestions are welcome, commenting is open on the doc: Egg Wars 2: Froyo's Vision.

To keep up to date with what's going on, follow Egg Wars on Farcaster: https://warpcast.com/eggwars/

Egg Wars: A game on Base

Assets

Our game has 2 core assets:

  1. Chickens: ERC-721 tokens, the game pieces used by players.

  2. $EGG: The ERC-20 used as the main fuel / ammo of the game.

Game Mechanics

The game starts with 150 players. Each player has a Chicken NFT that starts at Level 1.

Every 8 hours, your chicken can lay eggs. Laid eggs are $EGG tokens added to the player's wallet. The amount of $EGG you get each time is equal to your chicken's level.

There are 3 things players can do with $EGG:

  1. FEED. Feed 1 $EGG to your chicken to increase its level by 1 (e.g. if your chicken is level 1 and you feed it 5 eggs, the chicken will be level 6). Chickens have a max level of 20. When an egg is fed to a chicken, the egg is burned.

  2. THROW. Throw 1 $EGG at an enemy chicken to decrease its level by 1. A chicken’s level can never go below 1. Each egg that is thrown is burned.

  3. HATCH. Attempt to hatch an egg for a chance to get a new chicken NFT. The likelihood of success with hatching is 10%. If the hatching succeeds, the player receives a new ERC-721 of a chicken that starts at level 1. Whether the hatching succeeds or fails, the egg is burned.

The original 150 players contributed 0.015 ETH each, for a total of 2.25 ETH. This ETH will be used to start a liquidity pool on Uniswap with 20,000 eggs. Existing players can buy or sell eggs to support their game strategy. New players can buy eggs to attempt to hatch new chickens and join the game.

Source Code

Deployed to Base Sepolia. All solidity contracts are verified and viewable on basescan.

EggToken: https://sepolia.basescan.org/address/0x46f63d7a3dc87bec772425cba949956f24045f71#code

Chicken: https://sepolia.basescan.org/address/0x050A02eD16BB99803c46E82CC0A707EeE8A7263c#code

Testnet OpenSea link: https://testnets.opensea.io/collection/egg-wars-chicken-5

Front-end

Live on Base Sepolia at https://egg-wars.vercel.app/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment