Skip to content

Bug in Lesson 2, Chapter 2 (Mappings): Missing validation for 'public' modifier in answer checking #63

Description

@LexExCodice

Description

In Lesson 2, Chapter 2 (Mappings and Addresses), the tutorial description explicitly states that zombieToOwner should be a public mapping. However, for the second assignment (ownerZombieCount), the text does not mention the public modifier.

The issue is that the automated test checker allows the user to pass the chapter even if ownerZombieCount is declared without the public modifier (e.g., mapping (address => uint) ownerZombieCount;), whereas the frontend would realistically require it to be public for external queries.

Exploit/Incorrect Behavior Scenario

  1. Go to Lesson 2, Chapter 2.
  2. Provide the second mapping without the public visibility modifier.
  3. Click "Check Answer".
  4. The system grants a green light and accepts the code, despite the missing visibility modifier.

Recommendation

Update the validation script for Lesson 2, Chapter 2 to strictly enforce the public modifier for both mappings, or clarify the text instructions in the second task to avoid confusing students who notice the difference in the compilation checks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions