StakingDapp
StakingDapp is a fullstack DeFi protocol built with Solidity, NextJS, NodeJS, Ethers, and Web3. The contract was deployed using Remix IDE. It allows users to connect their MetaMask wallet, stake their SepoliaETH, and unstake their tokens at a desired interest rate.
Before you begin, ensure you have met the following requirements:
- Clone the project repository:
git clone https://github.com/hadesbaker/StakingDapp.git
cd StakingDapp
- Install the required frontend dependencies:
cd frontend
npm install
# or
yarn install
- Install the required backend dependencies:
cd ..
cd backend
npm install
# or
yarn install
Log into RemixIDE and deploy the Staking.sol contract. Copy the ABI and contract address and replace the values within frontend/contracts/index.js.
In the backend folder, create a file called .env. Within the .env file, add a MORALIS_KEY variable with the moralis api key you can get from here.
i.e. MORALIS_KEY=dwindwdiwndiwniwndiwdinwdinwdidindiwn
In a seperate terminal window, run the backend node server:
cd backend
node index.js
In another terminal window, run the development server:
cd frontend
npm run dev
Finally, open https://localhost:3000 with your browser to see the result.
Make sure to properly use the protocol, your metamask wallet is switched to the Sepolia network and the account you connect has SepoliaETH available.
Before deploying your contracts to the Ethereum mainnet, ensure you have:
- Sufficient ETH for gas fees in your deployment account
- Completed a security audit of your contracts
- Considered legal and regulatory compliance
To deploy your contracts, return to Remix and change the environment to Injected Provider - MetaMask. Afterwards change the network in your MetaMask browser extension to Ethereum Mainnet and hit deploy.
Copy the new contract address and ABI, paste them into frontend/contracts/index.js and then refresh the page.