luloxi / Feet2Walk

Experiment on self balancing tokens | Built with Scaffold-ETH 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feet2Walk

Experiment on self balancing tokens.

⚙️ Built using 🏗 Scaffold-ETH 2, NextJS, RainbowKit, Hardhat, Wagmi, Viem, and Typescript.

Features

It has 3 contracts, a token $FEET, a Walk NFT, and a FeetCoordinator

  1. Token $FEET: The mint price increases exponentially with supply initially and then flattens out as it reaches higher prices. This mechanism encourages early adoption while preventing rapid inflation as the token price increases.

  2. Walk NFT minting: Minted by paying with 2 $FEET tokens.

  • Benefits of a fixed price of 2 $FEET: Simplicity and predictability for users, ensuring a consistent cost for minting Walk NFTs.
  • Risks of a fixed price: Potential lack of flexibility in adjusting minting costs based on market conditions or token price fluctuations.
  1. Walk NFT "step" counting and display: Walk NFTs start counting blocks (steps) since minting and display the step count on the token image (Dynamic SVG).

  2. Walk NFT burn Functionality: Walk NFTs can be burnt to decrease the $FEET token price.

  • Walk NFTs contribute to decreasing the $FEET token price over time.
  1. FeetCoordinator Contract: Acts as the owner of both tokens and handles minting, burning, and ETH withdrawals by the owner.

  2. FeetCoordinator endWalkAndBuyTokens function: Function to prevent front-running when burning to purchase cheaper tokens. This function enhances the security and fairness of the token ecosystem.

Economic variables

  • $FEET token price: Exponentially increasing at first, flattening out later.
  • Walk NFT price: 2 $FEET (it just takes two $FEET to go for a Walk)

Original idea notes

  • Use the DEX lesson curve to display how much burning a Walk NFT would affect the $FEET token price?

Requirements

Before you begin, you need to install the following tools:

Quickstart

To get started, follow the steps below:

  1. Clone this repo & install dependencies
git clone https://github.com/luloxi/Feet2Walk.git
cd Feet2Walk
yarn install
  1. Run a local network in the first terminal:
yarn chain

This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in hardhat.config.ts.

  1. On a second terminal, deploy the test contract:
yarn deploy

This command deploys a test smart contract to the local network. The contract is located in packages/hardhat/contracts and can be modified to suit your needs. The yarn deploy command uses the deploy script located in packages/hardhat/deploy to deploy the contract to the network. You can also customize the deploy script.

  1. On a third terminal, start your NextJS app:
yarn start

Visit your app on: http://localhost:3000. You can interact with your smart contract using the Debug Contracts page. You can tweak the app config in packages/nextjs/scaffold.config.ts.

About

Experiment on self balancing tokens | Built with Scaffold-ETH 2

License:MIT License


Languages

Language:TypeScript 90.1%Language:Solidity 5.8%Language:JavaScript 4.0%Language:CSS 0.1%Language:Shell 0.0%