Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Syntax Errors in Mapping Definitions #5335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xsimka
Copy link
Contributor

@0xsimka 0xsimka commented Dec 2, 2024

This update addresses a critical issue with the syntax used in the mapping definitions within the RoleData structure and the _roles mapping. The original code used an incorrect format that would cause a compilation failure.

Changes made:

  • The incorrect mapping definition:

    mapping(address account => bool) hasRole;

    has been corrected to:

    mapping(address => bool) hasRole;
  • A similar mistake was found in the _roles mapping:

    mapping(bytes32 role => RoleData) private _roles;

    which has been corrected to:

    mapping(bytes32 => RoleData) private _roles;

Importance:

These syntax errors prevent the contract from compiling, as Solidity does not support the use of named parameters in mapping definitions. The correct syntax requires the use of the keyType => valueType format. Fixing these errors is crucial to ensure that the contract compiles successfully and functions as expected.

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

Copy link

changeset-bot bot commented Dec 2, 2024

⚠️ No Changeset found

Latest commit: e50cae8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Amxx
Copy link
Collaborator

Amxx commented Dec 3, 2024

See: #5331 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants