Skip to content

Nonfunctional typos #1643 #1652

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

Merged
merged 27 commits into from
Feb 28, 2019

Conversation

nikeshnazareth
Copy link
Contributor

Fixes #1643

This PR

  1. Adds .idea (IntelliJ IDE configuration) to the .gitignore file
  2. Fixes various spelling and grammar mistakes in comments
  3. Clarifies some comments
  4. Renames a variable for clarification purposes (without affecting functionality)

There are no new tests.

I wasn't sure if you usually squash commits before or after reviewing the PR. I'm happy to squash them if you prefer.

The Ownable contract has a comment explaining that renouncing
ownership will prevent execution of functions with the onlyOwner
modifier.

This commit moves that comment to the @dev section and replaces it
with a description suitable for a generic user.
FinalizableCrowdsale and RefundableCrowsale both have comments
indicating that they are extensions of the Crowdsale contract.

This commit refines those comments to the most immediate ancestor
( TimedCrowdsale and RefundableCrowdsale respectively )
The SignatureBouncer contract has modifiers to validate the
message sender is authorised to perform an action. They pass
msg.sender to internal functions as the variable `account`, but
the function comments refer to the variable as `sender`

This commit changes the variable name to `sender`
@nikeshnazareth nikeshnazareth force-pushed the nonfunctional-typos-#1643 branch from e090ba1 to 608beeb Compare February 27, 2019 03:31
@nventuro nventuro self-requested a review February 27, 2019 15:10
@nventuro nventuro self-assigned this Feb 27, 2019
Copy link
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

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

😍 this is amazing @nikeshnazareth, thank you so much!

@@ -75,36 +75,36 @@ contract SignatureBouncer is SignerRole {
* @dev is the signature of `this + sender` from a signer?
* @return bool
*/
function _isValidSignature(address account, bytes memory signature) internal view returns (bool) {
return _isValidDataHash(keccak256(abi.encodePacked(address(this), account)), signature);
function _isValidSignature(address sender, bytes memory signature) internal view returns (bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd go the other way around with this one: the signer isn't necessarily the sender of the message, so I think the more generic account fits better. What we should do is update the comments so that they no longer read 'sender'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem - I'm really excited to start contributing to the ecosystem! Thanks for being so welcoming 😀

With respect to the SignatureBouncer, if I've understood the contract correctly, the signer isn't necessarily the sender but the account variable is (at least in the base contract). The onlyValidSignature[And..] modifiers are ensuring that the current message sender has been authorised to call the function by some unspecified signer.

On the other hand, I could imagine derived contracts that use the _isValidSignature[And..] set of functions to ensure that a signer has authorised a third party to perform an action on the contract, so your instinct to avoid tightly coupling the function to its current use makes a lot of sense. Happy to follow your lead.

I've updated the PR accordingly 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that is precisely the reason why - those functions could even be abstracted away to some sort of signature utilities contract that SignatureBouncer uses.

@nventuro
Copy link
Contributor

Regarding commits, don't worry about it - we always squash-merge. Keeping a clean commit history does make it easier to review in some scenarios though :)

The SignatureBouncer has comments that use the description
`sender` to refer to the variable `account`.

This commit updates the comments for consistency.

Maintainer Note: this reverts changes in the previous commit,
which renamed the variable `account` instead.
Copy link
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

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

Fantastic work, thanks!

@nventuro nventuro merged commit 0dded49 into OpenZeppelin:master Feb 28, 2019
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.

Various non-functional typos and code intention suggestions
2 participants