Skip to content

About

Solidity challenges & discussions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Solidity Challenges Repository

GitHub stars GitHub watchers GitHub forks

Welcome Solidity Developers & Researchers! 🎉

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.


🏆 Challenges

# Challenge Discussion Solution
3 Test should revert when attempting to mint as an unauthorized user View
2 Successfully gridlock this contract with a DoS attack View View
1 Successfully withdraw all funds from the contract View View

📋 Table of Contents

  1. How it works
  2. Getting the Most Out of This Repository
  3. Getting Started
  4. Repository Structure
  5. How to Stay Informed and Support Us
  6. Join the Community


How it Works

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.


Getting the Most Out of This Repository

📚 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.


Getting Started

Prerequisites

  • 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.

Running the Challenges

  1. Clone the Repository

    git clone https://github.com/passandscore/solidity-challenges.git
    cd solidity-challenges
  2. Explore a Challenge

    Navigate to the desired challenge folder:

    cd challenges/Challenge_01
  3. 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.sol file.
    • Compile and deploy the contract.


Providing Solutions

After working on a challenge, you can share your solution in the Discussions section.

Note: Look for the Solutions discussion 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.



Submitting Your Own Challenge

We encourage the community to contribute by submitting new challenges. Follow these steps to submit your challenge:

  1. Create a New Folder

    • Create a new folder named New_Challenge.
    mkdir new_challenge
    cd new_challenge
  2. Add Challenge File

    • Create a Challenge.sol file with the challenge.
  3. Write a Description

    • Add a README.md file 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.

  4. Open a Pull Request

    • Fork this repository.
    • Create a new branch from main.
    • Add your challenge.
    • Open a pull request to merge your changes.
  5. Discuss Your Challenge

    • Engage with the community in the Discussions section to discuss your challenge and solutions.
  6. 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.

Example Challenge Description

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]


Repository Structure

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



How to Stay Informed and Support Us

⭐️ Star the Repository

  • Show your support and help us reach more developers by starring this repository. Your stars make a huge difference!

👀 Watch the Repository

  • Stay updated with all the latest challenges, discussions, and updates by watching the repository. This will notify you of any new activities or changes.

💬 Join Discussions

  • Engage in discussions about challenges, solutions, and Solidity development in our Discussions section. Share your insights, ask questions, and collaborate with the community!



Join 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.


About

Solidity challenges & discussions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages