* Removing the storage associated with decimals
* changelog entry
* changelog link to new issue number
* Update contracts/token/ERC20/ERC20.sol
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
* Update contracts/token/ERC20/ERC20.sol
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
* Update CHANGELOG.md
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
* Clean code
- using type().interfaceId to improve readeability of ERC165 registration
- hardcoding some keccak256 that are otherwise computed at construction.
* hardcode keccak256 result
* Improve code readeability using try/catch
* Remove hardcoded hash
tests show that solc 0.8.0 does the optimization as expected
* Use try/catch to improve readability
* ERC165Checker: Do not revert when returndata is empty + new test
* Address PR comments
* improve testing of ERC721Receiver errors
* put back comment about invalid interface id
* coverage does not support 0.8.1. Reverting back to 0.8.0
* bubble all data with length > 0 if onERC721Receive fails.
* Fix test: revert without message trigger is bubble with the default message
* using enum object to improve readability
* Fix unnamed return variable warning
This commit fixes warnings thrown by the solc 0.7.4 compiler:
"Warning: Unnamed return variable can remain unassigned. Add an explicit
return with value to all non-reverting code paths or name the variable."
* Fix function state mutability warning
This commit fixes warnings thrown by the solc 0.7.4 compiler:
"Warning: Function state mutability can be restricted to pure"
* Fix shadows an existing declaration warning
This commit fixes warnings thrown by the solc 0.7.4 compiler:
"Warning: This declaration shadows an existing declaration."
1. Arguments by default are not underscored.
2. If the name isn't available due to shadowing, use prefix underscore.
3. If prefix underscore isn't available due to shadowing, use suffix underscore.
* 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