Co-authored-by: Alan Lu <alanlu1023@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
* Initial ERC1155 implementation with some tests (#1803)
* Initial ERC1155 implementation with some tests
* Remove mocked isERC1155TokenReceiver
* Revert reason edit nit
* Remove parameters associated with isERC1155TokenReceiver call
* Add tests for approvals and single transfers
* Add tests for transferring to contracts
* Add tests for batch transfers
* Make expectEvent.inTransaction tests async
* Renamed "owner" to "account" and "holder"
* Document unspecified balanceOfBatch reversion on zero behavior
* Ensure accounts can't set their own operator status
* Specify descriptive messages for underflow errors
* Bring SafeMath.add calls in line with OZ style
* Explicitly prevent _burn on the zero account
* Implement batch minting/burning
* Refactored operator approval check into isApprovedForAll calls
* Renamed ERC1155TokenReceiver to ERC1155Receiver
* Added ERC1155Holder
* Fix lint issues
* Migrate tests to @openzeppelin/test-environment
* port ERC1155 to Solidity 0.6
* make ERC1155 constructor more similar to ERC721 one
* also migrate mock contracts to Solidity 0.6
* mark all non-view functions as virtual
* add simple catch-all implementation for the metadata URI interface
* include an internal function to set the URI so users can implement functionality to switch URIs
* add tests for ERC1155 metadata URI
* fix nits, mostly pointed out by linter
* convert ERC1155 metadata URI work to Solidity 0.6
* mark all non-view functions as virtual
* Port ERC 1155 branch to Solidity 0.6 (and current master) (#2130)
* port ERC1155 to Solidity 0.6
* make ERC1155 constructor more similar to ERC721 one
* also migrate mock contracts to Solidity 0.6
* mark all non-view functions as virtual
* Update contracts/token/ERC1155/IERC1155MetadataURI.sol
Starting on Solidity v0.6.2, interfaces can now inherit. \o/
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* Fix compile errors
* Remove URI event
* Merge MetadataCatchAll into ERC1155
* Improve documentation.
* Simplify tests
* Move tests into ERC1155 tests
* Update documentation
* Bump minimum compiler version for inteface inheritance
* Fix holder tests
* Improve setUri docs
* Fix docs generation
Co-authored-by: Alan Lu <alanlu1023@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
* update test-helpers to 0.5.6-rc.0
* remove comment that no longer applies
* fix uses of expectEvent.notEmitted
* remove mocha only
* update to final version
* Update test/token/ERC777/ERC777.test.js
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* Initial ERC1155 implementation with some tests (#1803)
* Initial ERC1155 implementation with some tests
* Remove mocked isERC1155TokenReceiver
* Revert reason edit nit
* Remove parameters associated with isERC1155TokenReceiver call
* Add tests for approvals and single transfers
* Add tests for transferring to contracts
* Add tests for batch transfers
* Make expectEvent.inTransaction tests async
* Renamed "owner" to "account" and "holder"
* Document unspecified balanceOfBatch reversion on zero behavior
* Ensure accounts can't set their own operator status
* Specify descriptive messages for underflow errors
* Bring SafeMath.add calls in line with OZ style
* Explicitly prevent _burn on the zero account
* Implement batch minting/burning
* Refactored operator approval check into isApprovedForAll calls
* Renamed ERC1155TokenReceiver to ERC1155Receiver
* Added ERC1155Holder
* Fix lint issues
* Migrate tests to @openzeppelin/test-environment
* Port ERC 1155 branch to Solidity 0.6 (and current master) (#2130)
* port ERC1155 to Solidity 0.6
* make ERC1155 constructor more similar to ERC721 one
* also migrate mock contracts to Solidity 0.6
* mark all non-view functions as virtual
Co-authored-by: Alan Lu <alanlu1023@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Robert Kaiser <kairo@kairo.at>
* Improve ERC20/721 Pausable docs
* Add ERC20Pausable mint and burn tests
* Add ERC721Pausable mint and burn tests
* Add _beforeTransfer hook in ERC777 to mint and burn
* provide 'automatic' token URI by appending the token ID to the base URI, if a base is set but no token-specific URI is available
* make the three cases more explicit, avoid else after return
* adjust comments to reflect reality
* 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