* Implement AddressSet in terms of a generic Set
* Add Uint256Set
* Add EnumerableMap
* Fix wording on EnumerableSet docs and tests
* Refactor ERC721 using EnumerableSet and EnumerableMap
* Fix tests
* Fix linter error
* Gas optimization for EnumerableMap
* Gas optimization for EnumerableSet
* Remove often not-taken if from Enumerable data structures
* Fix failing test
* Gas optimization for EnumerableMap
* Fix linter errors
* Add comment for clarification
* Improve test naming
* Rename EnumerableMap.add to set
* Add overload for EnumerableMap.get with custom error message
* Improve Enumerable docs
* Rename Uint256Set to UintSet
* Add changelog entry
* adding mock contacts, test code
* adding changes to ERC721.sol per @frangio's comments on original PR #1943
* fix solhint warnings
* Update contracts/token/ERC721/ERC721.sol
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* same revert wording per @frangio's review suggestion
* per @frangio's feedback, changing the inline assembly to accomplish: we want to ignore the first 4 bytes of content, so we should read the length and decrease it by 4, then take the memory location and add 4 to it, then store the new length at the new memory location, then that is the new byte array that we want.
* change revert msg assembly per PR comment by @frangio
* unify revert msg in test code
* fix some failed tests, wording change
* Update contracts/token/ERC721/ERC721.sol
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* Update contracts/token/ERC721/ERC721.sol
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* fix test case, revert without reason
* fix 'ERC721ReceiverRevertsMock: Transaction rejected by receiver'
* style change per review by @frangio
* fix revert reason forwarding
* remove duplicate contracts/mocks/ERC721ReceiverRevertsMock.sol per review https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2018\#issuecomment-574381034
* Add changelog entry
* Fix tests
* Make tests more clear
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* added _safeTransferFrom function
* added safeMint functions
* added package-lock.json for consistency, don't know why it changes
* added initial suggestions/modifications
* change _safeTransferFrom to internal, reverted package-lock.json to original, and changed ERC721Pausable to override _transferFrom instead of transferFrom
* included tests for safeMint functions
* modified safeMint tests to be on ERC721Mock contract
* added safeMint to ERC721Mintable & respective test to ERC721MintBurn.behavior.js
* replacing all instances of from: anyone with from: other
* replacing all instances of from: anyone with from: other
* replacing all instances of from: anyone with from: other
* changing anyone to other
* changing anyone to other
* 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.
* Now only swapping when needed.
* Removed _addTokenTo and _removeTokenFrom
* Removed removeTokenFrom test.
* Added tests for ERC721 _mint and _burn
* _burn now uses the same swap and pop mechanism as _removeFromOwner
* Gas optimization on burn
* transferFrom now emits an Approval event, indicating the updated allowance.
* Updated burnFrom to also emit Approval.
* Added notices about the extra Approval events.
* Added inTransaction tests.
* Added expectEvent.inConstructor.
* Changed inTransaction, removed decodeLogs.
* Flipped comparison to improve the error message.
* Improved expectEvent tests.
* Migrated tests to use expectEvent.
* Added roles constructor tests.
* Fixed linter errors.
* Made lodash a dev dependency.
* Added more inLogs tests.
* Update expectEvent.test.js
* Removed lodash.
* Moved role constructor tests to public role behavior.
* Revert "Flipped comparison to improve the error message."
This reverts commit 438c57833d.
* Replaced chai-as-promised with shouldFail.
Small change in test description, should be "allows to approve..." instead of "allow to transfer..." in approve section, where test actualy try to approve, not to transfer.
* Replaced assertJump, assertRevert and expectThrow with shouldFail.
* Fixed linter errors.
* Fixed typo.
* Made the helpers async.
(cherry picked from commit b0da0fded0)
* Add BigNumber support to expectEvent/inLogs (#1026)
* switched direct logs array check to expectEvent method in AllowanceCrowdsale.test.js
* Refactor expectEvent.inLogs function to use simple value number check
* Introduced should.be.bignumber method to compare BigNumber values
* Use expectEvent to test logs (#1232)
* Removed trailing space
(cherry picked from commit 536262f2ec)