Nicolás Venturo
eb34ae67ff
Make IERC721 contracts interfaces instead ( #2113 )
...
* Make IERC721 contracts interfaces instead
* Bump minimum compiler version for IERC721
5 years ago
Nicolás Venturo
f1db30955d
Remove deprecated functions and contracts ( #2125 )
...
* Remove ERC721.burn(owner, tokenId)
* Remove ERC721._checkOnERC721Received from the contract's API
* Fix linter error
* Remove Escrow and PullPayment withdrawWithGas, replace for withdraw
* Add changelog entry
* Add reentrancy notice
5 years ago
Nicolás Venturo
c173392e15
Revamped Access Control ( #2112 )
...
* 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
5 years ago
Nicolás Venturo
c9630526e2
Draft and lifecycles directories cleanup ( #2122 )
...
* Move Pausable into utils
* Move Strings into utils
* Move Counters into utils
* Move SignedSafeMath into math
* Remove ERC1046
* Make ERC20Snapshot.snapshot internal
* Move ERC20Snapshot into ERC20
* Add drafts deprecation notice
* Remove drafts directory
* Add changelog entry
* Apply suggestions from code review
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
5 years ago
Nicolás Venturo
8176a901a9
Cleanup of Ownership directory ( #2120 )
...
* Remove Ownable.isOwner.
* Remove ownable behavior from tests
* Make Escrow use Ownable instead of Secondary
* Migrate GSNRecipientERC20Fee to Ownable
* Remove Secondary
* Move Ownable to access directory
* Remove mentions of Secondary
* Add changelog entry
* Move Ownable tests to access
* Remove unused mock
5 years ago
Nicolás Venturo
baaadde3c5
Remove ERC20._burnFrom ( #2119 )
...
* Remove ERC20._burnFrom
* Add changelog entry
5 years ago
Nicolás Venturo
7acd60d152
Add notice about deprecated Crowdsales ( #2116 )
...
* Remove crowdsales from sidebar documentation, add links to old version
* Remove mentions of Crowdsales from the documentation
5 years ago
Nicolás Venturo
65e4ffde58
Make ECDSA.recover revert on error. ( #2114 )
...
* Make ECDSA.recover revert on error
* Removed unused test
* Remove duplicate line
* Add tests for invalid signatures
* Fix linter errors
* Add changelog entry
5 years ago
Anton Bukov
e2813df879
Use bytes32 explicitly for Create2.computeAddress() ( #2088 )
...
* Use bytes32 explicitly for Create2.computeAddress(), to force users cache hash of the bytecode
* Remove only from test :)
5 years ago
Nicolás Venturo
3296ca7219
Rearrange erc721metadata layout to mimic eth-pkg ( #2098 )
...
In https://github.com/OpenZeppelin/openzeppelin-contracts-ethereum-package/pull/76 , we are rearranging the erc721metadata contract storage layout, so the new variable is added at the end. This commit applies the same change to the vanilla contracts repository, so migration from 2.5 to 3.0 is easier for users using the transpiler.
5 years ago
Francisco Giordano
62065cf043
add prepare-docs script to subpackage
5 years ago
Luca Daniel
08cea10aa7
Fix `operatorBurn` description typo. ( #2091 )
5 years ago
Anton Bukov
19417c7cd5
Rename CREATE2 argument from bytecodeHash to bytecode and add new method for precomputed bytecode hash ( #2087 )
...
* Rename CREATE2 argument from bytecodeHash to bytecode and add new method for precomputed bytecode hash
* Remove only from test
* Fix linter error
5 years ago
Nicolás Venturo
5dfe7215a9
Migrate Contracts to Solidity v0.6 ( #2080 )
...
* Initial migration to Solidity 0.6.x - v3.0 first steps (#2063 )
* Initial migration, missing GSN, 721, 777 and Crowdsales.
* Add _beforeTokenOperation and _afterTokenOperation.
* Add documentation for hooks.
* Add hooks doc
* Add missing drafts
* Add back ERC721 with hooks
* Bring back ERC777
* Notes on hooks
* Bring back GSN
* Make functions virtual
* Make GSN overrides explicit
* Fix ERC20Pausable tests
* Remove virtual from some view functions
* Update linter
* Delete examples
* Remove unnecessary virtual
* Remove roles from Pausable
* Remove roles
* Remove users of roles
* Adapt ERC20 tests
* Fix ERC721 tests
* Add all ERC721 hooks
* Add ERC777 hooks
* Fix remaining tests
* Bump compiler version
* Move 721BurnableMock into mocks directory
* Remove _before hooks
* Fix tests
* Upgrade linter
* Put modifiers last
* Remove _beforeTokenApproval and _beforeOperatorApproval hooks
5 years ago
Nicolás Venturo
f905a14f5f
Fix docsite link
5 years ago
Nicolás Venturo
58a3368215
2.5.0
5 years ago
Nicolás Venturo
941d305044
Update docs
5 years ago
Nicolás Venturo
1b938e39a8
EnumerableSet improvements ( #2077 )
...
* Remove newAddressSet
* Add count and get functions.
* Fix lint
(cherry picked from commit 7988c044e0
)
5 years ago
Nicolás Venturo
7988c044e0
EnumerableSet improvements ( #2077 )
...
* Remove newAddressSet
* Add count and get functions.
* Fix lint
5 years ago
Alberto Cuesta Cañada
0ac83ce289
Fix EnumerableSetMock for 2.5.rc1 ( #2069 )
...
* Drafted Enumerable.sol.
* Drafted test framework.
* Tweaked the tests to follow oz structure.
* Coded EnumerableSet.
* Moved EnumerableSet to `utils`.
* Fixed linting.
* Improved comments.
* Tweaked contract description.
* Renamed struct to AddressSet.
* Relaxed version pragma to 0.5.0
* Removed events.
* Revert on useless operations.
* Small comment.
* Created AddressSet factory method.
* Failed transactions return false.
* Transactions now return false on failure.
* Remove comments from mock
* Rename mock functions
* Adapt tests to code style, use test-helpers
* Fix bug in remove, improve tests.
* Add changelog entry
* Add entry on Utils doc
* Add optimization for removal of last slot
* Update docs
* Fix headings of utilities documentation
* Simplified mock.
* Fixed comment.
* Revert "Fixed comment."
This reverts commit 39627f9a6f
.
* Revert "Simplified mock."
This reverts commit 67468e464b
.
* Simplified mock.
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
(cherry picked from commit 8975289c6b
)
5 years ago
Alberto Cuesta Cañada
8975289c6b
Fix EnumerableSetMock for 2.5.rc1 ( #2069 )
...
* Drafted Enumerable.sol.
* Drafted test framework.
* Tweaked the tests to follow oz structure.
* Coded EnumerableSet.
* Moved EnumerableSet to `utils`.
* Fixed linting.
* Improved comments.
* Tweaked contract description.
* Renamed struct to AddressSet.
* Relaxed version pragma to 0.5.0
* Removed events.
* Revert on useless operations.
* Small comment.
* Created AddressSet factory method.
* Failed transactions return false.
* Transactions now return false on failure.
* Remove comments from mock
* Rename mock functions
* Adapt tests to code style, use test-helpers
* Fix bug in remove, improve tests.
* Add changelog entry
* Add entry on Utils doc
* Add optimization for removal of last slot
* Update docs
* Fix headings of utilities documentation
* Simplified mock.
* Fixed comment.
* Revert "Fixed comment."
This reverts commit 39627f9a6f
.
* Revert "Simplified mock."
This reverts commit 67468e464b
.
* Simplified mock.
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
5 years ago
Nicolás Venturo
d775e315cc
Update package homepage.
5 years ago
Nicolás Venturo
e4a8a5533e
2.5.0-rc.0
5 years ago
Nicolás Venturo
88dc1ca6fc
Reorder functions to prevent shadowing warning
5 years ago
Alberto Cuesta Cañada
1e0f07751e
Implementation of an address Enumerable Set ( #2061 )
...
* Drafted Enumerable.sol.
* Drafted test framework.
* Tweaked the tests to follow oz structure.
* Coded EnumerableSet.
* Moved EnumerableSet to `utils`.
* Fixed linting.
* Improved comments.
* Tweaked contract description.
* Renamed struct to AddressSet.
* Relaxed version pragma to 0.5.0
* Removed events.
* Revert on useless operations.
* Small comment.
* Created AddressSet factory method.
* Failed transactions return false.
* Transactions now return false on failure.
* Remove comments from mock
* Rename mock functions
* Adapt tests to code style, use test-helpers
* Fix bug in remove, improve tests.
* Add changelog entry
* Add entry on Utils doc
* Add optimization for removal of last slot
* Update docs
* Fix headings of utilities documentation
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
5 years ago
Mick de Graaf
73abd54cbe
Made private methods internal to allow for overriding ( #2027 )
...
* Made private methods internal to allow for overriding
* Revert package.lock changes.
* Make _move private again
* Expose the ERC1820 registry address
* Add changelog entry
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
5 years ago
Hao (Alan) Tang
7d7cbcad14
Fix/improve revert reason #1727 ( #2018 )
...
* 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>
5 years ago
Nicolás Venturo
e493fb3e95
Add 'available since' notes. Fixes #2054
5 years ago
Francisco Giordano
8c40a5b275
Create2 feature pending tasks ( #2013 )
...
* Add Create2 library (#1744 )
* feat(contracts): Add Create2 library to use create2 evm opcode
* Upgrade sol-coverage
* Add changelog entry
* Update comments and code style
* Remove create2 helper
* Fix linter error
* Fix truffle dependency
* Fix linter error
* refactor(Create2): Remove _deploy internal function
* test(Create2): test Create2 with inline assembly code
* fix(Create2): Check address returned form create2 instead of codesize of created contract
* refactor(Create2):Add revert reason when Create2 deploy fails (#2062 )
* fix merge with master
* fix test
Co-authored-by: Augusto Lemble <me@augustol.com>
5 years ago
Francisco Giordano
06983a2075
add note suggesting reentrancy post ( #2059 )
5 years ago
Nicolás Venturo
410e4f8ab9
Fix link to GSN overview ( #2053 )
...
* Fix link to GSN overview
* Update contracts/GSN/README.adoc
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
5 years ago
Peter
54d2aec232
issue#1980 ( #2038 )
...
* issue#1980
* fix public to external
5 years ago
Gabriel Cardona
f9650b4cb8
Remove .gitkeep as it's not needed. ( #2046 )
5 years ago
William Entriken
fbddf5ba5b
Test common case first ( #2023 )
5 years ago
Nicolás Venturo
73a5903789
Update README.adoc
5 years ago
William Entriken
5d47aa85bc
Correct documentation for isContract check ( #2017 )
...
* Correct documentation for isContract check
* Update Address.sol
* Update Address.sol
* add missing newline before asciidoc list
5 years ago
Arindam Ghosh
ca6a5dc8a2
Changes ERC777 external functions to public for allowing overrides #1994 ( #2001 )
...
* Changes ERC777 external functions to public for allowing overrides #1994
* Changes ERC777 external functions to public for allowing overrides (#1994 )
5 years ago
Nicolás Venturo
28b95ef5be
ReentrancyGuard gas optimization ( #1996 )
...
* Improve gas efficiency of reentrancyGuard
* Add changelog entry
* Fix ReentrancyGuard test
5 years ago
William Entriken
95e54173e9
Update MerkleProof.sol ( #1997 )
5 years ago
Francisco Giordano
8e980480aa
Fix broken crossreference links ( #2005 )
...
* Bump solidity-docgen from 0.3.11 to 0.3.13
Bumps solidity-docgen from 0.3.11 to 0.3.13.
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
* fix broken crossreference links
5 years ago
Ignacio Mazzara
49042f2b1a
feat: add baseTokenURI to ERC721Metadata ( #1970 )
...
* feat: add baseTokenURI
* fix: tests
* chore: dev notation
* chore: changelog
* chore: typo
* Remove extra getters, return empty URI by default
* Update docs
* Rename baseTokenURI to baseURI
* Roll back visibility change of tokenURI
* Update changelog entry
* Version setBaseURI docs
* Improve internal names and comments
* Fix compilation errors
* Add an external getter for baseURI
5 years ago
ericDeCourcy
33047ffddc
Update ReentrancyGuard for Istanbul Hard Fork ( #1992 )
...
* Update ReentrancyGuard for Istanbul Hard Fork
Changes:
Added L37, `_guardCounter = 1;`
Rationale:
The planned _Istanbul Hard Fork_ will implement [EIP 2200](e4d4ea348e/EIPS/eip-2200.md
), which implements "net gas metering" for `sstore` operations. If the final value of `_guardCounter` is unchanged relative to the original value of it, a gas refund will be applied and charges for changing the value of `_guardCounter` will effectively not exist. This ends up being cheaper than the current implementation ONLY AFTER Istanbul. Before Istanbul, the added line actually ends up costing more gas.
Note that if `_guardCounter` is `0` initially, the initial cost and subsequent refund will both be larger than if `_guardCounter` is `1` initially. Although in both cases, the net gas cost (`gasCost - gasRefund`) are equal, it's better in terms of cost to have both the gas cost and refund smaller, as there is some limit to the percentage of a gas refund that can actually be realized.
* Update CHANGELOG.md
Added note for change to ReentrancyGuard.sol
* Update ReentrancyGuard.sol
* Update CHANGELOG.md
5 years ago
Francisco Giordano
f90700f3f1
add detail to deprecation notice
5 years ago
Mick de Graaf
5b2de262fd
Made _burn internal instead of private ( #1908 )
5 years ago
Francisco Giordano
8e3563968f
add explanation of drafts category
5 years ago
Francisco Giordano
cdf655f770
2.4.0
5 years ago
Francisco Giordano
c4bb7b7bb9
remove beta notice
5 years ago
Francisco Giordano
feaf051fef
added feature availability info to documentation
...
(cherry picked from commit 9113335cb3
)
5 years ago
Francisco Giordano
4c997ea09e
make PullPayment.withdrawPaymentsWithGas external
...
(cherry picked from commit 76a1d7a3cd
)
5 years ago
Nicolás Venturo
1c220e175d
Forward all gas on PullPayment withdrawal ( #1976 )
...
* Add withdrawWithGas
* Improve docs
* Add changelog entry
* Update contracts/payment/PullPayment.sol
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* Remove repeated comment
* Update changelog entry
* Fix inline docs
* Fix changelog formatting
(cherry picked from commit d6e10ab786
)
5 years ago