6d202894b6
Merge branch 'master'
2021-01-26 18:58:15 +01:00
18c7efe800
Make view and pure functions virtual ( #2473 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2021-01-26 13:23:23 -03:00
c34211417c
Refactor SafeMath to avoid memory leaks ( #2462 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2021-01-18 18:06:27 -03:00
974c534210
Update contracts to support Solidity 0.8.x ( #2442 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2021-01-14 19:38:53 -03:00
318c4b44ea
Move Context from GSN to utils directory ( #2453 )
...
Co-authored-by: Hadrien Croubois <hadrien@openzeppelin.com >
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2021-01-07 13:04:13 -03:00
6be0b410dc
Use explicit conversions between addresses and numbers ( #2439 )
...
Co-authored-by: hrkrshnn <webmail.hari@gmail.com >
Co-authored-by: cameel <cameel2@gmail.com >
2020-12-17 22:51:48 -03:00
051d340171
Use bytes1 and avoid using the obsolete byte type ( #2438 )
2020-12-14 16:42:01 -03:00
90ed1af972
Support compiling with solc 0.7 ( #2408 )
2020-11-17 21:29:39 -03:00
4972bf4f23
Merge branch 'master' into solc-0.7
2020-11-16 14:11:46 -03:00
fcdf8f4618
Add BytesSet ( #2395 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2020-11-04 16:57:48 -03:00
7650210ad6
Make contracts abstract if they had internal constructors ( #2383 )
2020-10-20 12:24:46 -03:00
87326f7313
Add functionStaticCall and functionDelegateCall methods to Address library ( #2333 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2020-09-17 16:19:11 -03:00
22de765f3c
Merge branch 'release-v3.2.0' into release-v3.2.0-solc-0.7
2020-09-08 20:14:42 -03:00
ae4e9845de
Fix a grammatical error in a comment ( #2352 )
...
changed a comment in the isContract function to make it grammatically right.
2020-09-08 14:50:12 -03:00
aaa5ef81cf
Fix typos ( #2343 )
2020-09-01 14:57:40 -03:00
4eb8d2bb10
Revert "feat: use extcodesize for isContract to reduce gas ( #2311 )"
...
This reverts commit c801c8d2bb .
2020-07-30 16:53:44 -03:00
04fc35707d
Migrate contracts to Solidity 0.7 ( #2319 )
...
* Update contract pragmas to solidity 0.7
* Remove internal declaration on constructors
* Reference SafeMath explicitely
* Remove public constructor declaration from abstract contracts
* Remove public constructor declaration from non-abstract contracts
2020-07-29 18:11:32 -03:00
c801c8d2bb
feat: use extcodesize for isContract to reduce gas ( #2311 )
...
* feat: use extcodesize for isContract to reduce gas
* feat: add changelog entry
2020-07-14 17:08:41 -03:00
ef3bbbcf40
Add readme notices with link to docs site ( #2300 )
...
* add readme notices
* remove period after url
2020-06-29 17:23:53 -03:00
242400e9ea
Update functionCall docs
2020-06-12 13:22:52 -03:00
7f62c8e145
Fix docs links to overloaded functions ( #2275 )
...
* fix links to overloaded functions
* fix Address xrefs
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com >
2020-06-11 16:50:00 -03:00
b72088a90a
Add 'available since' notices
2020-06-11 16:46:33 -03:00
8b58fc7191
feat: add wrapper function for low level calls ( #2264 )
...
* feat: add wrapper function for low level calls
* add error message parameter
* adding unit tests and required mocks
* implement error message on SafeERC20
* fixed variable name in tests
* Add missing tests
* Improve docs.
* Add functionCallWithValue
* Add functionCallWithValue
* Skip balance check on non-value functionCall variants
* Increase out of gas test timeout
* Fix compile errors
* Apply suggestions from code review
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
* Add missing tests
* Add changelog entry
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com >
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2020-06-11 16:25:46 -03:00
d418da6b91
Decrease CREATE2 address computation gas usage from 623 to 539 ( #2244 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2020-05-28 20:47:45 -03:00
5513dfd3cf
Adding SafeCast variants for signed integers ( #2243 )
...
* feat: Adding SafeCast variants for signed integers
* Add newline at EOF
* Update CHANGELOG.md
* Update contracts/utils/SafeCast.sol
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com >
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com >
2020-05-26 19:17:34 -03:00
56de324afe
Add SPX license identifier ( #2235 )
2020-05-14 21:58:11 -03:00
cfa9ad9943
Fix ReentrancyGuard for Proxy Pattern ( #2171 )
...
* Fix ReentrancyGuard for Proxy Pattern
* Update ReentrancyGuard.sol
* Change constant values
* Add changelog entry
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com >
2020-05-12 20:23:28 -03:00
c20e620a06
Improve Pausable docs
2020-05-04 16:37:05 -03:00
5bb8d0245b
Improve Hooks documentation ( #2199 )
...
* Improve Hooks docs
* Improve Utils docs
* Apply suggestions from code review
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com >
* Add enumerable code samples
* Remove import statement from example
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2020-04-20 16:43:05 -03:00
cca71ab709
Fix deprecation warnings ( #2115 )
...
* Fix deprecation warnings
* Workaround linter bug
2020-04-16 12:13:49 -03:00
8b10cb38d8
Rename Strings.fromUint256 to Strings.toString ( #2188 )
...
* rename Strings.fromUint256 to Strings.toString
* add changelog entry
* fix conflict with js toString method
2020-04-15 18:04:00 -03:00
c4e5daff86
Fix Pausable docs
2020-04-03 17:06:33 -03:00
402c6ab4cc
Update docs ( #2168 )
...
* Update docs for ERC20 and ERC721
* Add EnumerableMap to docs
* Update misc guides
* Apply suggestions from code review
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com >
Co-authored-by: Francisco Giordano <frangio.1@gmail.com >
2020-04-03 13:17:24 -03:00
bd0778461d
Add EnumerableMap, refactor ERC721 ( #2160 )
...
* 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
2020-04-02 15:43:06 -03:00
feb7ead005
Add revert if the bytecode length is zero ( #2117 )
...
* 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 >
2020-03-28 12:55:13 -03:00
7415ebe8bc
API improvements for EnumerableSet ( #2151 )
...
* 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
2020-03-27 18:39:18 -03:00
4476a2d531
Unsigned conversion #2111 ( #2123 )
...
* 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 >
2020-03-27 10:56:30 -03:00
a8d6f13c94
Remove all 'available since' notices
2020-03-16 20:44:56 -03:00
9975a1a0c2
Remove Address.toPayable ( #2133 )
...
* Remove Address.toPayable
* Add changelog entry
2020-03-16 18:22:02 -03:00
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 >
2020-03-16 16:27:15 -03:00
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 :)
2020-03-09 13:02:14 -03:00
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
2020-02-14 11:29:38 -03:00
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
2020-02-14 11:12:32 -03:00
941d305044
Update docs
2020-02-04 19:35:31 -03:00
1b938e39a8
EnumerableSet improvements ( #2077 )
...
* Remove newAddressSet
* Add count and get functions.
* Fix lint
(cherry picked from commit 7988c044e0 )
2020-02-04 19:33:57 -03:00
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 >
2020-01-24 14:50:24 -03:00
e493fb3e95
Add 'available since' notes. Fixes #2054
2020-01-23 15:26:25 -03:00
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 >
2020-01-23 15:08:54 -03:00
06983a2075
add note suggesting reentrancy post ( #2059 )
2020-01-20 16:02:49 -03:00
fbddf5ba5b
Test common case first ( #2023 )
2019-12-16 16:21:06 -03:00