A simple staking contract connected to a Nextjs Front end.
- User can connect Metamask wallet to stake and withdraw
- Owner can issue reward to staked users
- Issue and reward your own token
- Supported tokens: Wone, Weth, Dai
- Hardhat - Ethereum development environment
- NextJS - The React Framework for Production!
- TailwindCSS - A utility-first CSS framework
These following steps is for deploying and using contract on Harmony testnet. You can change to any network you like by changing the config.
Copy the .env.example file in this directory to .env (which will be ignored by Git):
cp .env.example .env
Then set each variable on .env.local:
- PRIVATE_KEY should be the private key of your Metamask wallet.
Your .env file should look like this:
PRIVATE_KEY=...
npm install
# or
yarn
npx hardhat run scripts/deployToHarmony.ts --network harmony_testnet
# or
hh run scripts/deployToHarmony.ts --network harmony_testnet
Your contract should be deployed to Harmony Testnet. The staking contract and token contract address should be printed on terminal.
NDTToken deployed to: ...
TokenFarm deployed to: ...
You can check the address on https://explorer.pops.one/
cp -R artifacts front_end/src/lib/
cd front_end && npm install && npm run dev
# or
cd front_end && yarn && yarn dev
Your DApp should be up and running on http://localhost:3000!