* feature: setting sublevel test scenario for AddressSet
* feat: adding tests for EnumerableSet.UintSet
* feat: adding Behavior and AddressSet and UintSet tests
* 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>
* 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
* 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
* Remove _grantRole and _revokeRole, replace with _setupRole
* Make all external AccessControl functions public
* Remove Ownable._transferOwnership
* Rename ERC721's _safeTransferFrom and _transferFrom to _safeTransfer and _transfer
* Make all ERC721 external functions public
* Make all miscelaneous external functions public instead
* Add changelog entry
* Move calldata arguments to memory
* Update contracts/access/AccessControl.sol
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* Restrict setupRole to the constructor
* Replace isConstructor for !isContract
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
* Add revert if the bytecode length is not greater than zero
* Add value parameter to create2 deploy function
Add tests for contract balance revert and depositing funds
* Change parameter name to amount for clarity
* Fix test for value sending
* Fix linter error
* Change revert reason
* Improve Create2.deploy documentation
* Slight test improvement
* Add changelog entry
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* Add revert reason to EnumerableSet.get.
* Rename EnumerableSet values to keys
* Rename get to at
* Add changelog entry
* Rename keys to values
* Add leading underscore to struct members
* Add signed to unsigned conversion to SafeCast
* Update SafeCast exception message
* Add test for SafeCast int to uint conversion
- Update SafeCastMock
- Add tests for SafeCast int256 to uint256
* Update SafeCast int to uint definition
Apply suggestions from code review.
Co-Authored-By: Nicolás Venturo <nicolas.venturo@gmail.com>
* Update test for SafeCast int to uint conversion
* Update SafeCast test after code review
- Change "downcasts" to "casts"
- Move test closer to its function
* Fix error in SafeCast toUint256 description
* Fix breaking error in SafeCast
* Add uint256 to int256 conversion to SafeCast
- Add function
- Add mock
- Add test
* Update SafeCast unsigned to signed conversion
- Update error in conversion to be more clear
- Update constants in test to be powers of 2 instead of shifts
* Add changelog entry
* Update SafeCast tests
- Add minus in INT256_MIN for clarity
Co-Authored-By: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* Remove Roles
* Add AccessControl and tests
* Removed IAccessControl
* Add RoleGranted and RoleRevoked events
* Make roles grantable and revokable regardless of their previous status
* Fix typo
* Add documentation
* Cleanup tests
* Add enumeration tests
* Add _setRoleAdmin tests
* Fix lint error
* Fix AccessControl link in docs
* WIP on access control guide
* Rename getRoleMembersCount
* Add tests for new role admin
* Make AccessControl GSN compatible
* Update access control guide
* Rename admin to adminRole
* Rename roleIds to roles
* Add 'operator' to RoleGranted and RoleRevoked events.
* Only emit events if the roles were not previously granted/revoked
* Uncomment expectEvent.not tests
* Rename operator to sender
* Add changelog entry
* Merge GSNBouncerBase into GSNRecipient
* Remove emtpy implementations for _pre and _post
* Rename bouncers to recipients
* Rename bouncers documentation to strategies
* Rewrite guides and docstrings to use the strategy naming scheme
* Address review comments
* Apply suggestions from code review
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* change wording of docs
(cherry picked from commit aae95db4e0)