This project is a decentralized application (dApp); this serves as a practical demonstration of skills acquired in blockchain development, testing, and frontend integration within the Web3 ecosystem.
The project showcases the ability to create a functional Web3 application, integrating blockchain technology with modern web development practices. It provides users with a platform to stake their ETH, potentially earn rewards, and interact with smart contracts through an intuitive interface.
This project was developed by:
We appreciate their hard work and contributions to make this project possible.
This project is licensed under the MIT License.
The Staker contract is deployed on the Ethereum network. You can view the contract on Etherscan:
View Staker Contract on Etherscan
The project consists of the following key files:
Staker.sol
: The main staking contractstackingTest.ts
: Test file for the staking contract01_deploy_staker.ts
: Deployment script for the Staker contractpage.tsx
: Main page component of the Next.js application
First, run the development server:
npm run dev
Open [http://localhost:3000] with your browser to see the result.
You can start editing the page by modifying pages/index.tsx
. The page auto-updates as you edit the file.
Staker.sol
is the main smart contract for this project. It implements a staking mechanism where users can:
- Stake ETH
- Withdraw their stake
- Execute a function after a threshold is met
Key features:
- Time-based staking periods
- Threshold-based execution
- Withdrawal functionality
stackingTest.ts
contains the test suite for the Staker contract. It uses Hardhat and Chai for testing. The tests cover:
- Deployment of the contract
- Staking functionality
- Withdrawal scenarios
- Threshold execution
To run the tests:
npx hardhat test
01_deploy_staker.ts
is the deployment script for the Staker contract. It uses Hardhat's deployment system to:
- Deploy the Staker contract
- Set initial parameters
- Verify the contract on Etherscan (if on a supported network)
To deploy the contract:
npx hardhat run scripts/01_deploy_staker.ts --network <your-network>
page.tsx
is the main page component of the Next.js application. It provides the user interface for interacting with the Staker contract.
Key features:
- Connect wallet functionality
- Display of staking information
- Interface for staking and withdrawing tokens
To learn more about this stack, take a look at the following resources:
- wagmi Documentation - Learn about wagmi Hooks and API.
- Next.js Documentation - Learn about Next.js features and API.
- Hardhat Documentation - Learn about Hardhat for Ethereum development.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out the Next.js deployment documentation for more details.