-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: Ownable2Step #352
feat: Ownable2Step #352
Conversation
✅ Deploy Preview for contracts-stylus canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
/// Leaves the contract without owner. It will not be possible to call | ||
/// [`Self::only_owner`] functions. Can only be called by the current owner. | ||
/// | ||
/// NOTE: Renouncing ownership will leave the contract without an owner, | ||
/// thereby disabling any functionality that is only available to the owner. | ||
/// | ||
/// # Errors | ||
/// | ||
/// If not called by the owner, then the error | ||
/// [`OwnableError::UnauthorizedAccount`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copied from Ownable. Is there a way to reference to that documentation as we do in solidiy? e.g. here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could help #302 (comment)
to: Address, | ||
value: U256, | ||
) -> Result<(), Vec<u8>> { | ||
self.ownable._ownable.only_owner()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to not add again only_owner
as a function of the Ownable2Step
contract, since anyone inheriting from it can still access it and we are not making it public anymore. I do understand that this way of accessing is not the most ergonomic, but I still think it is better than just re-implementing it. But open to suggestions of course :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing update in CHANGELOG.md
.github/workflows/test.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggonzalez94 we should have consistent formatting in our *.yml files. You can change it everywhere or revert this change in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It got automatically formatted, what plugin or extension are you using so that I can use the same for md? :)
Co-authored-by: Gustavo Gonzalez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Resolves #290
onlyOwner()
internal in Ownable and implementMethodError
to be able to use the error in our new contract(we've already seen we will need this for others)cargo test
in the CI. It is faster(not as relevant right now) and the output is so much nicerPR Checklist