Skip to content

Commit 0dded49

Browse files
nikeshnazarethnventuro
authored andcommitted
Nonfunctional typos #1643 (#1652)
* Add IntelliJ IDE config to .gitignore * Fix variable name in ERC20 function comments * Fix typos in Arrays function comment * Fix typos in ownership test names * Fix typo in Pausable test name * Fix grammar in Ownable function comment * Fix grammar in Crowdsale contract comment * Fix typo in Counters contract comment * Fix typo in ERC721Enumerable comment * Fix typo in ERC721PausedToken test name * Fix typo in Crowdsale function comment * Fix typo in IncreasingPriceCrowdsale function comment * Fix grammar in IncreasingPriceCrowdsale test name * Fix typo in AllowanceCrowdsale test name * Fix typo in RefundEscrow function comment * Fix typo in ERC20Migrator contract comment * Fix typos in SignatureBouncer comments * Fix typo in SignedSafeMath test name * Fix typo in TokenVesting contract comment * Move Ownable comment from @notice section to @dev 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. * Clarify purpose of ERC20 transfer function * Clarify registration of ERC721Enumerable interface * Clarify purpose of AllowanceCrowdsale test * Increase specificity of inheritance comments 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 ) * Remove unused parameter in PaymentSplitter test * Rename parameter in SignatureBouncer functions 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` * Clarify comments in SignatureBouncer functions 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.
1 parent a1f168b commit 0dded49

22 files changed

+41
-37
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ build/
3737

3838
# truffle
3939
.node-xmlhttprequest-*
40+
41+
# IntelliJ IDE
42+
.idea

contracts/crowdsale/Crowdsale.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import "../utils/ReentrancyGuard.sol";
1111
* allowing investors to purchase tokens with ether. This contract implements
1212
* such functionality in its most fundamental form and can be extended to provide additional
1313
* functionality and/or custom behavior.
14-
* The external interface represents the basic interface for purchasing tokens, and conform
15-
* the base architecture for crowdsales. They are *not* intended to be modified / overridden.
14+
* The external interface represents the basic interface for purchasing tokens, and conforms
15+
* the base architecture for crowdsales. It is *not* intended to be modified / overridden.
1616
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
1717
* the methods to add functionality. Consider using 'super' where appropriate to concatenate
1818
* behavior.
@@ -65,7 +65,7 @@ contract Crowdsale is ReentrancyGuard {
6565

6666
/**
6767
* @dev fallback function ***DO NOT OVERRIDE***
68-
* Note that other contracts will transfer fund with a base gas stipend
68+
* Note that other contracts will transfer funds with a base gas stipend
6969
* of 2300, which is not enough to call buyTokens. Consider calling
7070
* buyTokens directly when purchasing tokens from a contract.
7171
*/

contracts/crowdsale/distribution/FinalizableCrowdsale.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "../validation/TimedCrowdsale.sol";
55

66
/**
77
* @title FinalizableCrowdsale
8-
* @dev Extension of Crowdsale with a one-off finalization action, where one
8+
* @dev Extension of TimedCrowdsale with a one-off finalization action, where one
99
* can do extra work after finishing.
1010
*/
1111
contract FinalizableCrowdsale is TimedCrowdsale {

contracts/crowdsale/distribution/RefundableCrowdsale.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import "../../payment/escrow/RefundEscrow.sol";
66

77
/**
88
* @title RefundableCrowdsale
9-
* @dev Extension of Crowdsale contract that adds a funding goal, and the possibility of users getting a refund
10-
* if goal is not met.
9+
* @dev Extension of FinalizableCrowdsale contract that adds a funding goal, and the possibility of users
10+
* getting a refund if goal is not met.
1111
*
1212
* Deprecated, use RefundablePostDeliveryCrowdsale instead. Note that if you allow tokens to be traded before the goal
1313
* is met, then an attack is possible in which the attacker purchases tokens from the crowdsale and when they sees that

contracts/crowdsale/price/IncreasingPriceCrowdsale.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ contract IncreasingPriceCrowdsale is TimedCrowdsale {
2828
}
2929

3030
/**
31-
* The base rate function is overridden to revert, since this crowdsale doens't use it, and
31+
* The base rate function is overridden to revert, since this crowdsale doesn't use it, and
3232
* all calls to it are a mistake.
3333
*/
3434
function rate() public view returns (uint256) {

contracts/drafts/Counters.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "../math/SafeMath.sol";
88
* @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
99
* of elements in a mapping, issuing ERC721 ids, or counting request ids
1010
*
11-
* Include with `using Counter for Counter.Counter;`
11+
* Include with `using Counters for Counters.Counter;`
1212
* Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the SafeMath
1313
* overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
1414
* directly accessed.

contracts/drafts/ERC20Migrator.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import "../math/Math.sol";
1717
* OpenZeppelin's ERC20Mintable, but the only functions that are needed are
1818
* `isMinter(address)` and `mint(address, amount)`. The migrator will check
1919
* that it is a minter for the token.
20-
* The balance from the legacy token will be transfered to the migrator, as it
20+
* The balance from the legacy token will be transferred to the migrator, as it
2121
* is migrated, and remain there forever.
2222
* Although this contract can be used in many different scenarios, the main
2323
* motivation was to provide a way to migrate ERC20 tokens into an upgradeable

contracts/drafts/SignatureBouncer.sol

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import "../cryptography/ECDSA.sol";
2929
* @notice A method that uses the `onlyValidSignatureAndData` modifier must make
3030
* the _signature parameter the "last" parameter. You cannot sign a message that
3131
* has its own signature in it so the last 128 bytes of msg.data (which
32-
* represents the length of the _signature data and the _signaature data itself)
32+
* represents the length of the _signature data and the _signature data itself)
3333
* is ignored when validating. Also non fixed sized parameters make constructing
3434
* the data in the signature much more complex.
3535
* See https://ethereum.stackexchange.com/a/50616 for more details.
@@ -56,31 +56,31 @@ contract SignatureBouncer is SignerRole {
5656
}
5757

5858
/**
59-
* @dev requires that a valid signature with a specifed method of a signer was provided
59+
* @dev requires that a valid signature with a specified method of a signer was provided
6060
*/
6161
modifier onlyValidSignatureAndMethod(bytes memory signature) {
6262
require(_isValidSignatureAndMethod(msg.sender, signature));
6363
_;
6464
}
6565

6666
/**
67-
* @dev requires that a valid signature with a specifed method and params of a signer was provided
67+
* @dev requires that a valid signature with a specified method and params of a signer was provided
6868
*/
6969
modifier onlyValidSignatureAndData(bytes memory signature) {
7070
require(_isValidSignatureAndData(msg.sender, signature));
7171
_;
7272
}
7373

7474
/**
75-
* @dev is the signature of `this + sender` from a signer?
75+
* @dev is the signature of `this + account` from a signer?
7676
* @return bool
7777
*/
7878
function _isValidSignature(address account, bytes memory signature) internal view returns (bool) {
7979
return _isValidDataHash(keccak256(abi.encodePacked(address(this), account)), signature);
8080
}
8181

8282
/**
83-
* @dev is the signature of `this + sender + methodId` from a signer?
83+
* @dev is the signature of `this + account + methodId` from a signer?
8484
* @return bool
8585
*/
8686
function _isValidSignatureAndMethod(address account, bytes memory signature) internal view returns (bool) {
@@ -92,7 +92,7 @@ contract SignatureBouncer is SignerRole {
9292
}
9393

9494
/**
95-
* @dev is the signature of `this + sender + methodId + params(s)` from a signer?
95+
* @dev is the signature of `this + account + methodId + params(s)` from a signer?
9696
* @notice the signature parameter of the method being validated must be the "last" parameter
9797
* @return bool
9898
*/

contracts/drafts/TokenVesting.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import "../math/SafeMath.sol";
1212
*/
1313
contract TokenVesting is Ownable {
1414
// The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is
15-
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree).Therefore,
15+
// therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore,
1616
// it is recommended to avoid using short time durations (less than a minute). Typical vesting schemes, with a
1717
// cliff period of a year and a duration of four years, are safe to use.
1818
// solhint-disable not-rely-on-time

contracts/ownership/Ownable.sol

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ contract Ownable {
4343

4444
/**
4545
* @dev Allows the current owner to relinquish control of the contract.
46-
* @notice Renouncing to ownership will leave the contract without an owner.
4746
* It will not be possible to call the functions with the `onlyOwner`
4847
* modifier anymore.
48+
* @notice Renouncing ownership will leave the contract without an owner,
49+
* thereby removing any functionality that is only available to the owner.
4950
*/
5051
function renounceOwnership() public onlyOwner {
5152
emit OwnershipTransferred(_owner, address(0));

contracts/payment/escrow/RefundEscrow.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ contract RefundEscrow is ConditionalEscrow {
8383
}
8484

8585
/**
86-
* @dev Returns whether refundees can withdraw their deposits (be refunded). The overriden function receives a
86+
* @dev Returns whether refundees can withdraw their deposits (be refunded). The overridden function receives a
8787
* 'payee' argument, but we ignore it here since the condition is global, not per-payee.
8888
*/
8989
function withdrawalAllowed(address) public view returns (bool) {

contracts/token/ERC20/ERC20.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ contract ERC20 is IERC20 {
5151
}
5252

5353
/**
54-
* @dev Transfer token for a specified address
54+
* @dev Transfer token to a specified address
5555
* @param to The address to transfer to.
5656
* @param value The amount to be transferred.
5757
*/
@@ -90,7 +90,7 @@ contract ERC20 is IERC20 {
9090

9191
/**
9292
* @dev Increase the amount of tokens that an owner allowed to a spender.
93-
* approve should be called when allowed_[_spender] == 0. To increment
93+
* approve should be called when _allowed[msg.sender][spender] == 0. To increment
9494
* allowed value is better to use this function to avoid 2 calls (and wait until
9595
* the first transaction is mined)
9696
* From MonolithDAO Token.sol
@@ -105,7 +105,7 @@ contract ERC20 is IERC20 {
105105

106106
/**
107107
* @dev Decrease the amount of tokens that an owner allowed to a spender.
108-
* approve should be called when allowed_[_spender] == 0. To decrement
108+
* approve should be called when _allowed[msg.sender][spender] == 0. To decrement
109109
* allowed value is better to use this function to avoid 2 calls (and wait until
110110
* the first transaction is mined)
111111
* From MonolithDAO Token.sol

contracts/token/ERC721/ERC721Enumerable.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {
3333
* @dev Constructor function
3434
*/
3535
constructor () public {
36-
// register the supported interface to conform to ERC721 via ERC165
36+
// register the supported interface to conform to ERC721Enumerable via ERC165
3737
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
3838
}
3939

@@ -167,8 +167,8 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {
167167
// This also deletes the contents at the last position of the array
168168
_ownedTokens[from].length--;
169169

170-
// Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occcupied by
171-
// lasTokenId, or just over the end of the array if the token was the last one).
170+
// Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by
171+
// lastTokenId, or just over the end of the array if the token was the last one).
172172
}
173173

174174
/**

contracts/utils/Arrays.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import "../math/Math.sol";
99
*/
1010
library Arrays {
1111
/**
12-
* @dev Upper bound search function which is kind of binary search algoritm. It searches sorted
13-
* array to find index of the element value. If element is found then returns it's index otherwise
12+
* @dev Upper bound search function which is kind of binary search algorithm. It searches sorted
13+
* array to find index of the element value. If element is found then returns its index otherwise
1414
* it returns index of first element which is greater than searched value. If searched element is
1515
* bigger than any array element function then returns first index after last element (i.e. all
1616
* values inside the array are smaller than the target). Complexity O(log n).

test/crowdsale/AllowanceCrowdsale.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenW
5454
});
5555

5656
describe('check remaining allowance', function () {
57-
it('should report correct allowace left', async function () {
57+
it('should report correct allowance left', async function () {
5858
const remainingAllowance = tokenAllowance.sub(expectedTokenAmount);
5959
await this.crowdsale.buyTokens(investor, { value: value, from: purchaser });
6060
(await this.crowdsale.remainingTokens()).should.be.bignumber.equal(remainingAllowance);
@@ -72,7 +72,7 @@ contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenW
7272
});
7373
});
7474

75-
describe('when token wallet is different from token address', function () {
75+
describe('when token wallet is the zero address', function () {
7676
it('creation reverts', async function () {
7777
this.token = await SimpleToken.new({ from: tokenWallet });
7878
await shouldFail.reverting(AllowanceCrowdsaleImpl.new(rate, wallet, this.token.address, ZERO_ADDRESS));

test/crowdsale/IncreasingPriceCrowdsale.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ contract('IncreasingPriceCrowdsale', function ([_, investor, wallet, purchaser])
3131
));
3232
});
3333

34-
it('reverts with a final equal to the initial rate', async function () {
34+
it('reverts with a final rate equal to the initial rate', async function () {
3535
await shouldFail.reverting(IncreasingPriceCrowdsaleImpl.new(
3636
this.startTime, this.closingTime, wallet, this.token.address, initialRate, initialRate
3737
));

test/drafts/SignedSafeMath.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ contract('SignedSafeMath', function () {
1919
}
2020

2121
describe('add', function () {
22-
it('adds correctly if it does not overflow and the result is positve', async function () {
22+
it('adds correctly if it does not overflow and the result is positive', async function () {
2323
const a = new BN('1234');
2424
const b = new BN('5678');
2525

test/lifecycle/Pausable.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ contract('Pausable', function ([_, pauser, otherPauser, anyone, ...otherAccounts
1717
shouldBehaveLikePublicRole(pauser, otherPauser, otherAccounts, 'pauser');
1818
});
1919

20-
context('when unapused', function () {
20+
context('when unpaused', function () {
2121
beforeEach(async function () {
2222
(await this.pausable.paused()).should.equal(false);
2323
});

test/ownership/Ownable.behavior.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function shouldBehaveLikeOwnable (owner, [anyone]) {
1616
(await this.ownable.isOwner({ from: anyone })).should.be.equal(true);
1717
});
1818

19-
it('should prevent non-owners from transfering', async function () {
19+
it('should prevent non-owners from transferring', async function () {
2020
await shouldFail.reverting(this.ownable.transferOwnership(anyone, { from: anyone }));
2121
});
2222

test/ownership/Secondary.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ contract('Secondary', function ([_, primary, newPrimary, anyone]) {
2929
(await this.secondary.primary()).should.equal(newPrimary);
3030
});
3131

32-
it('reverts when transfering to the null address', async function () {
32+
it('reverts when transferring to the null address', async function () {
3333
await shouldFail.reverting(this.secondary.transferPrimary(ZERO_ADDRESS, { from: primary }));
3434
});
3535

test/payment/PaymentSplitter.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ contract('PaymentSplitter', function ([_, owner, payee1, payee2, payee3, nonpaye
8484
const initAmount1 = await balance.current(payee1);
8585
const { logs: logs1 } = await this.contract.release(payee1, { gasPrice: 0 });
8686
const profit1 = (await balance.current(payee1)).sub(initAmount1);
87-
profit1.should.be.bignumber.equal(ether('0.20', 'ether'));
87+
profit1.should.be.bignumber.equal(ether('0.20'));
8888
expectEvent.inLogs(logs1, 'PaymentReleased', { to: payee1, amount: profit1 });
8989

9090
const initAmount2 = await balance.current(payee2);
9191
const { logs: logs2 } = await this.contract.release(payee2, { gasPrice: 0 });
9292
const profit2 = (await balance.current(payee2)).sub(initAmount2);
93-
profit2.should.be.bignumber.equal(ether('0.10', 'ether'));
93+
profit2.should.be.bignumber.equal(ether('0.10'));
9494
expectEvent.inLogs(logs2, 'PaymentReleased', { to: payee2, amount: profit2 });
9595

9696
const initAmount3 = await balance.current(payee3);
9797
const { logs: logs3 } = await this.contract.release(payee3, { gasPrice: 0 });
9898
const profit3 = (await balance.current(payee3)).sub(initAmount3);
99-
profit3.should.be.bignumber.equal(ether('0.70', 'ether'));
99+
profit3.should.be.bignumber.equal(ether('0.70'));
100100
expectEvent.inLogs(logs3, 'PaymentReleased', { to: payee3, amount: profit3 });
101101

102102
// end balance should be zero

test/token/ERC721/ERC721PausedToken.behavior.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function shouldBehaveLikeERC721PausedToken (owner, [recipient, operator]) {
5555
});
5656

5757
describe('exists', function () {
58-
it('should return token existance', async function () {
58+
it('should return token existence', async function () {
5959
(await this.token.exists(firstTokenId)).should.equal(true);
6060
});
6161
});

0 commit comments

Comments
 (0)