This repository is designed to help our skills through practical challenges. Each challenge focuses on a specific aspect of Solidity and is paired with a discussion thread where you can share your solutions, learn from others, and engage with the community.
⛔️ Important Notes:
- Keep current with the discussions thread for your challenge.
- Avoid copying directly from ChatGPT. While it's an invaluable tool, let's strive for more authenticity in our responses.
- How it works
- Getting the Most Out of This Repository
- Getting Started
- Repository Structure
- How to Stay Informed and Support Us
- Join the Community
Attempt the challenge in the Challenge.sol file.
- Share your solution in the Discussions section.
- Engage with the community and learn from others.
- Official solutions will be revealed in subsequent challenges.
📚 Learning
This repository is a valuable resource for learning Solidity through practical challenges and solutions. Here’s how you can maximize your learning experience:
- Explore Challenges: Dive into each challenge folder (Challenge_X) to find specific problems and scenarios related to Solidity programming.
- Understand Problem Statements: Read each Challenge.sol file carefully to understand the problem statement and what needs to be achieved.
- Compare Solutions: Drop your solution in the discussions and compare it with others. This will help you understand different approaches and best practices.
- Experiment and Test: Use tools like Remix IDE or a local development environment to test your solutions and see how Solidity code behaves in different scenarios.
- Engage in Discussions: Join discussions in the Discussions tab to ask questions, share insights, and learn from other developers’ experiences.
🤝 Networking
Building connections within the Solidity developer community can lead to valuable opportunities and collaborations:
- Participate Actively: Engage with others in discussions. Share your knowledge, ask for advice, and connect with developers who share your interests.
- Follow Contributors: Follow active contributors to stay updated on their projects and contributions.
- Collaborate on Challenges: Consider working together on challenges with others. Collaborative problem-solving can deepen understanding and foster new relationships.
🌍 Contribute to Open Source
Contributing to open source is a great way to enhance your skills and give back to the community:
- Submit New Challenges: Have a challenge idea? Follow the steps outlined in the Submitting Your Own Challenge section to add new challenges to this repository.
- Submit Solutions: If you have a unique or optimized solution to a challenge, share it with the community by submitting a pull request.
- Review Pull Requests: Help review and provide constructive feedback on pull requests from other contributors.
- Spread the Word: Share your experiences and challenges from this repository on social media or developer forums to encourage others to join and contribute.
- Solidity: Ensure you have Solidity installed. The recommended version is 0.8.x or higher.
- Node.js and npm: For testing and running Solidity code locally using frameworks like Hardhat or Foundry.
-
Clone the Repository
git clone https://github.com/passandscore/solidity-challenges.git cd solidity-challenges -
Explore a Challenge
Navigate to the desired challenge folder:
cd challenges/Challenge_01 -
Compile and Test the Challenge
You can use tools like Remix IDE or a local development environment to compile and test your Solidity code. For Remix:
- Open Remix IDE.
- Load the
Challenge.solfile. - Compile and deploy the contract.
After working on a challenge, you can share your solution in the Discussions section.
Note: Look for the
Solutionsdiscussion thread for each challenge to share your solutions.
This is a great way to get feedback, learn from others, and engage with the community. We encourage you to provide detailed explanations of your solutions to help others understand your thought process.
👉 We will be revealing the official solutions in the subsequent challenges.
We encourage the community to contribute by submitting new challenges. Follow these steps to submit your challenge:
-
Create a New Folder
- Create a new folder named
New_Challenge.
mkdir new_challenge cd new_challenge - Create a new folder named
-
Add Challenge File
- Create a
Challenge.solfile with the challenge.
- Create a
-
Write a Description
-
Add a
README.mdfile within your challenge folder describing the challenge, including: -
Problem Statement: What needs to be solved.
-
Constraints: Any specific constraints or requirements.
-
Hints: Optional hints to guide others.
-
-
Open a Pull Request
- Fork this repository.
- Create a new branch from
main. - Add your challenge.
- Open a pull request to merge your changes.
-
Discuss Your Challenge
- Engage with the community in the Discussions section to discuss your challenge and solutions.
-
Provide The Solution
- After a week, provide the solution to your challenge in a new PR.
- If no solution is provided, the maintainers will provide one based on community feedback.
README.md inside Challenge_01:
# Challenge 01
## Problem Statement
You need to copy an array of structs from `calldata` to `storage`. However, directly assigning a `calldata` array to a `storage` array results in a compilation error.
**Task**:
- Refactor the given contract to manually copy the struct array from `calldata` to `storage`.
- Provide your solution and comments in the Discussion for this challenge.
**Constraints**:
- Use Solidity 0.8.x or higher.
**Author**: [Your GitHub Username]
Each challenge is contained within its own folder, following this structure:
└── Challenges/
├── Challenge_01/
│ ├── Challenge.sol
│ ├── Solution.sol
│ └── README.md
├── Challenge_02/
│ ├── Challenge.sol
│ ├── Solution.sol
│ └── README.md
└── README.md
- Show your support and help us reach more developers by starring this repository. Your stars make a huge difference!
- Stay updated with all the latest challenges, discussions, and updates by watching the repository. This will notify you of any new activities or changes.
- Engage in discussions about challenges, solutions, and Solidity development in our Discussions section. Share your insights, ask questions, and collaborate with the community!
By actively participating in challenges, discussions, and contributions, you not only enhance your Solidity skills but also contribute to a thriving community of developers. Together, we can build a robust repository of knowledge and solutions for Solidity development.
