This is a dApp for the presale of TSTK tokens. The pre-sale runs in 24-hour stages and this app lets you purchase tokens as per the price of the current stage. The app runs on the Polygon Mumbai chain
The application is hosted here: Vercel Link
- Users can buy a maximum of 10,000 tokens per stage. This limit is enforced from this app to avoid unnecessary calls to the contract.
- Since the app is working on a testnet (Polygon Mumbai), the assumption is that gas fees are negligible, and users don't need to worry about high transaction costs.
- The app does not require user authentication, and users can interact with it using their wallets directly.
- The stage countdown component assumes that each stage will take exactly 24 hours. However, the time between blocks on Polygon Mumbai fluctuates and is not always 2 seconds which means it can sometimes take less or more than 24 hours per stage.
- Since the presale smart contract has an unlimited number of stages, it is assumed that the stage progressions are managed internally within the smart contract.
- The ERC-20 token contract is already deployed on Polygon testnet. It is assumed that this contract is correctly deployed and functioning properly. A similar assumption is made for the Presale contract.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Node.js
- Yarn or npm (This guide will use Yarn)
- Clone this repository:
git https://github.com/jillo-abdullahi/tstk-beincrypto.git
- Navigate into the project directory:
cd tstk-beincrypto
- Install the dependencies:
yarn
- Create a
.env
file and add the following values. You'll need an Alchemy API key as well as your walletConnect project key.
NEXT_PUBLIC_ALCHEMY_ID=
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
NEXT_PUBLIC_TSTK_TOKEN_ADDRESS=
NEXT_PUBLIC_PRESALE_CONTRACT_ADDRESS=
To obtain an Alchemy key head over to the Alchemy website. For the Wallet project key, you'll need to create a free project here and get your key from the project dashboard.
Start the application in development mode:
yarn dev
Then open http://localhost:3000 with your web browser to see the result.
The app has tests written using the Jest library:
yarn jest
To create an optimized production build:
yarn build
You can then serve the built application with yarn start
.
yarn start
- Next.js - The React Framework
- ConnectKit - For blockchain wallet connections.
- Wagmi - For smart contract calls.
- TypeScript - Used for static typing
- Mantine - UI components library.