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

Update ownable check to validate zero address #398

Merged
merged 9 commits into from
Jul 19, 2022

Conversation

JulissaDantes
Copy link
Contributor

Fixes #374

Includes:

  • Extra check for caller to not be zero address when using assert_only_owner.
  • Test case to revert if protected function gets called after the renounce ownership.

PR Checklist

  • Tests
  • Documentation
  • Changelog entry

Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! We should probably document this check as well—maybe a small note in the assert_only_owner description?

tests/mocks/Ownable.cairo Outdated Show resolved Hide resolved
Copy link
Contributor

@martriay martriay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments on top of Andrew's.

tests/access/test_Ownable.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvements! I left a couple small suggestions and a question :)

docs/Access.md Outdated Show resolved Hide resolved
tests/access/test_Ownable.py Outdated Show resolved Hide resolved
tests/access/test_Ownable.py Outdated Show resolved Hide resolved
JulissaDantes and others added 4 commits July 18, 2022 08:15
Co-authored-by: Andrew Fleming <fleming.andrew@protonmail.com>
Co-authored-by: Andrew Fleming <fleming.andrew@protonmail.com>
Copy link
Contributor

@martriay martriay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

tests/access/test_Ownable.py Outdated Show resolved Hide resolved
tests/access/test_Ownable.py Outdated Show resolved Hide resolved
@andrew-fleming andrew-fleming merged commit 02bb5f9 into OpenZeppelin:main Jul 19, 2022
@andrew-fleming andrew-fleming mentioned this pull request Jul 20, 2022
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.

Unsafe use case of ownable.cairo
3 participants