diff --git a/.gitignore b/.gitignore index a93fffc04..651103706 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,6 @@ build/ # truffle .node-xmlhttprequest-* + +# IntelliJ IDE +.idea diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index be0af7060..6b1c0a642 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -11,8 +11,8 @@ import "../utils/ReentrancyGuard.sol"; * allowing investors to purchase tokens with ether. This contract implements * such functionality in its most fundamental form and can be extended to provide additional * functionality and/or custom behavior. - * The external interface represents the basic interface for purchasing tokens, and conform - * the base architecture for crowdsales. They are *not* intended to be modified / overridden. + * The external interface represents the basic interface for purchasing tokens, and conforms + * the base architecture for crowdsales. It is *not* intended to be modified / overridden. * The internal interface conforms the extensible and modifiable surface of crowdsales. Override * the methods to add functionality. Consider using 'super' where appropriate to concatenate * behavior. @@ -65,7 +65,7 @@ contract Crowdsale is ReentrancyGuard { /** * @dev fallback function ***DO NOT OVERRIDE*** - * Note that other contracts will transfer fund with a base gas stipend + * Note that other contracts will transfer funds with a base gas stipend * of 2300, which is not enough to call buyTokens. Consider calling * buyTokens directly when purchasing tokens from a contract. */ diff --git a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol index 72249dbbb..9058f70ad 100644 --- a/contracts/crowdsale/distribution/FinalizableCrowdsale.sol +++ b/contracts/crowdsale/distribution/FinalizableCrowdsale.sol @@ -5,7 +5,7 @@ import "../validation/TimedCrowdsale.sol"; /** * @title FinalizableCrowdsale - * @dev Extension of Crowdsale with a one-off finalization action, where one + * @dev Extension of TimedCrowdsale with a one-off finalization action, where one * can do extra work after finishing. */ contract FinalizableCrowdsale is TimedCrowdsale { diff --git a/contracts/crowdsale/distribution/RefundableCrowdsale.sol b/contracts/crowdsale/distribution/RefundableCrowdsale.sol index 637bc24fb..21e736fde 100644 --- a/contracts/crowdsale/distribution/RefundableCrowdsale.sol +++ b/contracts/crowdsale/distribution/RefundableCrowdsale.sol @@ -6,8 +6,8 @@ import "../../payment/escrow/RefundEscrow.sol"; /** * @title RefundableCrowdsale - * @dev Extension of Crowdsale contract that adds a funding goal, and the possibility of users getting a refund - * if goal is not met. + * @dev Extension of FinalizableCrowdsale contract that adds a funding goal, and the possibility of users + * getting a refund if goal is not met. * * Deprecated, use RefundablePostDeliveryCrowdsale instead. Note that if you allow tokens to be traded before the goal * is met, then an attack is possible in which the attacker purchases tokens from the crowdsale and when they sees that diff --git a/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol b/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol index 647b532fc..446b41d2e 100644 --- a/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol +++ b/contracts/crowdsale/price/IncreasingPriceCrowdsale.sol @@ -28,7 +28,7 @@ contract IncreasingPriceCrowdsale is TimedCrowdsale { } /** - * The base rate function is overridden to revert, since this crowdsale doens't use it, and + * The base rate function is overridden to revert, since this crowdsale doesn't use it, and * all calls to it are a mistake. */ function rate() public view returns (uint256) { diff --git a/contracts/drafts/Counters.sol b/contracts/drafts/Counters.sol index 7a68039cc..5af417f18 100644 --- a/contracts/drafts/Counters.sol +++ b/contracts/drafts/Counters.sol @@ -8,7 +8,7 @@ import "../math/SafeMath.sol"; * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids * - * Include with `using Counter for Counter.Counter;` + * Include with `using Counters for Counters.Counter;` * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the SafeMath * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never * directly accessed. diff --git a/contracts/drafts/ERC20Migrator.sol b/contracts/drafts/ERC20Migrator.sol index 6553b3d99..3a311383a 100644 --- a/contracts/drafts/ERC20Migrator.sol +++ b/contracts/drafts/ERC20Migrator.sol @@ -17,7 +17,7 @@ import "../math/Math.sol"; * OpenZeppelin's ERC20Mintable, but the only functions that are needed are * `isMinter(address)` and `mint(address, amount)`. The migrator will check * that it is a minter for the token. - * The balance from the legacy token will be transfered to the migrator, as it + * The balance from the legacy token will be transferred to the migrator, as it * is migrated, and remain there forever. * Although this contract can be used in many different scenarios, the main * motivation was to provide a way to migrate ERC20 tokens into an upgradeable diff --git a/contracts/drafts/SignatureBouncer.sol b/contracts/drafts/SignatureBouncer.sol index 89f1f17ae..1fee25764 100644 --- a/contracts/drafts/SignatureBouncer.sol +++ b/contracts/drafts/SignatureBouncer.sol @@ -29,7 +29,7 @@ import "../cryptography/ECDSA.sol"; * @notice A method that uses the `onlyValidSignatureAndData` modifier must make * the _signature parameter the "last" parameter. You cannot sign a message that * has its own signature in it so the last 128 bytes of msg.data (which - * represents the length of the _signature data and the _signaature data itself) + * represents the length of the _signature data and the _signature data itself) * is ignored when validating. Also non fixed sized parameters make constructing * the data in the signature much more complex. * See https://ethereum.stackexchange.com/a/50616 for more details. @@ -56,7 +56,7 @@ contract SignatureBouncer is SignerRole { } /** - * @dev requires that a valid signature with a specifed method of a signer was provided + * @dev requires that a valid signature with a specified method of a signer was provided */ modifier onlyValidSignatureAndMethod(bytes memory signature) { require(_isValidSignatureAndMethod(msg.sender, signature)); @@ -64,7 +64,7 @@ contract SignatureBouncer is SignerRole { } /** - * @dev requires that a valid signature with a specifed method and params of a signer was provided + * @dev requires that a valid signature with a specified method and params of a signer was provided */ modifier onlyValidSignatureAndData(bytes memory signature) { require(_isValidSignatureAndData(msg.sender, signature)); @@ -72,7 +72,7 @@ contract SignatureBouncer is SignerRole { } /** - * @dev is the signature of `this + sender` from a signer? + * @dev is the signature of `this + account` from a signer? * @return bool */ function _isValidSignature(address account, bytes memory signature) internal view returns (bool) { @@ -80,7 +80,7 @@ contract SignatureBouncer is SignerRole { } /** - * @dev is the signature of `this + sender + methodId` from a signer? + * @dev is the signature of `this + account + methodId` from a signer? * @return bool */ function _isValidSignatureAndMethod(address account, bytes memory signature) internal view returns (bool) { @@ -92,7 +92,7 @@ contract SignatureBouncer is SignerRole { } /** - * @dev is the signature of `this + sender + methodId + params(s)` from a signer? + * @dev is the signature of `this + account + methodId + params(s)` from a signer? * @notice the signature parameter of the method being validated must be the "last" parameter * @return bool */ diff --git a/contracts/drafts/TokenVesting.sol b/contracts/drafts/TokenVesting.sol index 7bd4e02cf..636f94bf1 100644 --- a/contracts/drafts/TokenVesting.sol +++ b/contracts/drafts/TokenVesting.sol @@ -12,7 +12,7 @@ import "../math/SafeMath.sol"; */ contract TokenVesting is Ownable { // The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and is - // therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree).Therefore, + // therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree). Therefore, // it is recommended to avoid using short time durations (less than a minute). Typical vesting schemes, with a // cliff period of a year and a duration of four years, are safe to use. // solhint-disable not-rely-on-time diff --git a/contracts/ownership/Ownable.sol b/contracts/ownership/Ownable.sol index 4acc0cbab..9780c07fd 100644 --- a/contracts/ownership/Ownable.sol +++ b/contracts/ownership/Ownable.sol @@ -43,9 +43,10 @@ contract Ownable { /** * @dev Allows the current owner to relinquish control of the contract. - * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. + * @notice Renouncing ownership will leave the contract without an owner, + * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); diff --git a/contracts/payment/escrow/RefundEscrow.sol b/contracts/payment/escrow/RefundEscrow.sol index 22c08075f..8c3904779 100644 --- a/contracts/payment/escrow/RefundEscrow.sol +++ b/contracts/payment/escrow/RefundEscrow.sol @@ -83,7 +83,7 @@ contract RefundEscrow is ConditionalEscrow { } /** - * @dev Returns whether refundees can withdraw their deposits (be refunded). The overriden function receives a + * @dev Returns whether refundees can withdraw their deposits (be refunded). The overridden function receives a * 'payee' argument, but we ignore it here since the condition is global, not per-payee. */ function withdrawalAllowed(address) public view returns (bool) { diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 55277a8df..1d697525e 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -51,7 +51,7 @@ contract ERC20 is IERC20 { } /** - * @dev Transfer token for a specified address + * @dev Transfer token to a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ @@ -90,7 +90,7 @@ contract ERC20 is IERC20 { /** * @dev Increase the amount of tokens that an owner allowed to a spender. - * approve should be called when allowed_[_spender] == 0. To increment + * approve should be called when _allowed[msg.sender][spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol @@ -105,7 +105,7 @@ contract ERC20 is IERC20 { /** * @dev Decrease the amount of tokens that an owner allowed to a spender. - * approve should be called when allowed_[_spender] == 0. To decrement + * approve should be called when _allowed[msg.sender][spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol diff --git a/contracts/token/ERC721/ERC721Enumerable.sol b/contracts/token/ERC721/ERC721Enumerable.sol index 773437791..0b5fd9c09 100644 --- a/contracts/token/ERC721/ERC721Enumerable.sol +++ b/contracts/token/ERC721/ERC721Enumerable.sol @@ -33,7 +33,7 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable { * @dev Constructor function */ constructor () public { - // register the supported interface to conform to ERC721 via ERC165 + // register the supported interface to conform to ERC721Enumerable via ERC165 _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE); } @@ -167,8 +167,8 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable { // This also deletes the contents at the last position of the array _ownedTokens[from].length--; - // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occcupied by - // lasTokenId, or just over the end of the array if the token was the last one). + // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by + // lastTokenId, or just over the end of the array if the token was the last one). } /** diff --git a/contracts/utils/Arrays.sol b/contracts/utils/Arrays.sol index 1957802b1..90f9e88d1 100644 --- a/contracts/utils/Arrays.sol +++ b/contracts/utils/Arrays.sol @@ -9,8 +9,8 @@ import "../math/Math.sol"; */ library Arrays { /** - * @dev Upper bound search function which is kind of binary search algoritm. It searches sorted - * array to find index of the element value. If element is found then returns it's index otherwise + * @dev Upper bound search function which is kind of binary search algorithm. It searches sorted + * array to find index of the element value. If element is found then returns its index otherwise * it returns index of first element which is greater than searched value. If searched element is * bigger than any array element function then returns first index after last element (i.e. all * values inside the array are smaller than the target). Complexity O(log n). diff --git a/test/crowdsale/AllowanceCrowdsale.test.js b/test/crowdsale/AllowanceCrowdsale.test.js index d6bec5b78..c05badb34 100644 --- a/test/crowdsale/AllowanceCrowdsale.test.js +++ b/test/crowdsale/AllowanceCrowdsale.test.js @@ -54,7 +54,7 @@ contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenW }); describe('check remaining allowance', function () { - it('should report correct allowace left', async function () { + it('should report correct allowance left', async function () { const remainingAllowance = tokenAllowance.sub(expectedTokenAmount); await this.crowdsale.buyTokens(investor, { value: value, from: purchaser }); (await this.crowdsale.remainingTokens()).should.be.bignumber.equal(remainingAllowance); @@ -72,7 +72,7 @@ contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenW }); }); - describe('when token wallet is different from token address', function () { + describe('when token wallet is the zero address', function () { it('creation reverts', async function () { this.token = await SimpleToken.new({ from: tokenWallet }); await shouldFail.reverting(AllowanceCrowdsaleImpl.new(rate, wallet, this.token.address, ZERO_ADDRESS)); diff --git a/test/crowdsale/IncreasingPriceCrowdsale.test.js b/test/crowdsale/IncreasingPriceCrowdsale.test.js index 376c1ccfb..387e3ff6f 100644 --- a/test/crowdsale/IncreasingPriceCrowdsale.test.js +++ b/test/crowdsale/IncreasingPriceCrowdsale.test.js @@ -31,7 +31,7 @@ contract('IncreasingPriceCrowdsale', function ([_, investor, wallet, purchaser]) )); }); - it('reverts with a final equal to the initial rate', async function () { + it('reverts with a final rate equal to the initial rate', async function () { await shouldFail.reverting(IncreasingPriceCrowdsaleImpl.new( this.startTime, this.closingTime, wallet, this.token.address, initialRate, initialRate )); diff --git a/test/drafts/SignedSafeMath.test.js b/test/drafts/SignedSafeMath.test.js index 59157a1e3..b40adf6e6 100644 --- a/test/drafts/SignedSafeMath.test.js +++ b/test/drafts/SignedSafeMath.test.js @@ -19,7 +19,7 @@ contract('SignedSafeMath', function () { } describe('add', function () { - it('adds correctly if it does not overflow and the result is positve', async function () { + it('adds correctly if it does not overflow and the result is positive', async function () { const a = new BN('1234'); const b = new BN('5678'); diff --git a/test/lifecycle/Pausable.test.js b/test/lifecycle/Pausable.test.js index 337adcfc7..fc9371b4b 100644 --- a/test/lifecycle/Pausable.test.js +++ b/test/lifecycle/Pausable.test.js @@ -17,7 +17,7 @@ contract('Pausable', function ([_, pauser, otherPauser, anyone, ...otherAccounts shouldBehaveLikePublicRole(pauser, otherPauser, otherAccounts, 'pauser'); }); - context('when unapused', function () { + context('when unpaused', function () { beforeEach(async function () { (await this.pausable.paused()).should.equal(false); }); diff --git a/test/ownership/Ownable.behavior.js b/test/ownership/Ownable.behavior.js index 5e90222f2..6cfd61d8a 100644 --- a/test/ownership/Ownable.behavior.js +++ b/test/ownership/Ownable.behavior.js @@ -16,7 +16,7 @@ function shouldBehaveLikeOwnable (owner, [anyone]) { (await this.ownable.isOwner({ from: anyone })).should.be.equal(true); }); - it('should prevent non-owners from transfering', async function () { + it('should prevent non-owners from transferring', async function () { await shouldFail.reverting(this.ownable.transferOwnership(anyone, { from: anyone })); }); diff --git a/test/ownership/Secondary.test.js b/test/ownership/Secondary.test.js index e46784a15..8e55dc12e 100644 --- a/test/ownership/Secondary.test.js +++ b/test/ownership/Secondary.test.js @@ -29,7 +29,7 @@ contract('Secondary', function ([_, primary, newPrimary, anyone]) { (await this.secondary.primary()).should.equal(newPrimary); }); - it('reverts when transfering to the null address', async function () { + it('reverts when transferring to the null address', async function () { await shouldFail.reverting(this.secondary.transferPrimary(ZERO_ADDRESS, { from: primary })); }); diff --git a/test/payment/PaymentSplitter.test.js b/test/payment/PaymentSplitter.test.js index 4eeaff329..b9f097e76 100644 --- a/test/payment/PaymentSplitter.test.js +++ b/test/payment/PaymentSplitter.test.js @@ -84,19 +84,19 @@ contract('PaymentSplitter', function ([_, owner, payee1, payee2, payee3, nonpaye const initAmount1 = await balance.current(payee1); const { logs: logs1 } = await this.contract.release(payee1, { gasPrice: 0 }); const profit1 = (await balance.current(payee1)).sub(initAmount1); - profit1.should.be.bignumber.equal(ether('0.20', 'ether')); + profit1.should.be.bignumber.equal(ether('0.20')); expectEvent.inLogs(logs1, 'PaymentReleased', { to: payee1, amount: profit1 }); const initAmount2 = await balance.current(payee2); const { logs: logs2 } = await this.contract.release(payee2, { gasPrice: 0 }); const profit2 = (await balance.current(payee2)).sub(initAmount2); - profit2.should.be.bignumber.equal(ether('0.10', 'ether')); + profit2.should.be.bignumber.equal(ether('0.10')); expectEvent.inLogs(logs2, 'PaymentReleased', { to: payee2, amount: profit2 }); const initAmount3 = await balance.current(payee3); const { logs: logs3 } = await this.contract.release(payee3, { gasPrice: 0 }); const profit3 = (await balance.current(payee3)).sub(initAmount3); - profit3.should.be.bignumber.equal(ether('0.70', 'ether')); + profit3.should.be.bignumber.equal(ether('0.70')); expectEvent.inLogs(logs3, 'PaymentReleased', { to: payee3, amount: profit3 }); // end balance should be zero diff --git a/test/token/ERC721/ERC721PausedToken.behavior.js b/test/token/ERC721/ERC721PausedToken.behavior.js index 59ed060c1..a116c8394 100644 --- a/test/token/ERC721/ERC721PausedToken.behavior.js +++ b/test/token/ERC721/ERC721PausedToken.behavior.js @@ -55,7 +55,7 @@ function shouldBehaveLikeERC721PausedToken (owner, [recipient, operator]) { }); describe('exists', function () { - it('should return token existance', async function () { + it('should return token existence', async function () { (await this.token.exists(firstTokenId)).should.equal(true); }); });