Hadrien Croubois
98716177ae
Inherit ERC20Wrapper decimals from the underlying ( #3259 )
3 years ago
Hadrien Croubois
f8bfa560e9
Use _spendAllowance in ERC20FlashMint ( #3226 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
3 years ago
Hadrien Croubois
c5a6cae898
Add a _spendAllowance function to ERC20 & ERC777 ( #3170 )
3 years ago
0xclaudeshannon
80d8da0564
Do not reduce approval on transferFrom if current allowance is type(uint256).max ( #3085 )
...
* add feature request #3084
* Update contracts/token/ERC20/ERC20.sol
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
* Add changelog note
* add documentation
* test unlimitted allowance and add ERC777 unlimitted allowance
* reference PR in changelog
* documentation IERC20 -> ERC20
* use asciidoc note syntax
* use asciidoc note syntax
* typo
* typos
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
3 years ago
Francisco Giordano
a9f994f063
Reduce ERC20 allowance before triggering transfer ( #3056 )
...
* Reduce ERC20 allowance before triggering transfer
* adapt ERC777 to reduce allowance before transfer
* fix test for ERC777
* use smaller number to reduce balance
* simplify test description
* don't use deprecated expectEvents.inLogs
* fix test
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
3 years ago
Hadrien Croubois
15b92e4097
Add missing "await" in tests ( #2749 )
...
* add missing await in tests
* fix test description
4 years ago
Hadrien Croubois
6842518b1b
Wrapper extension for ERC20 token ( #2633 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Hadrien Croubois
8a775cd8d4
Emit DelegateVotesChanged events after Transfer ( #2733 )
4 years ago
Hadrien Croubois
e3661abe84
Split ERC20Votes and ERC20VotesComp ( #2706 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Francisco Giordano
adc50d465c
Tweak ERC20Votes revert reasons and documentation ( #2696 )
...
* adapt revert reason convention
* add whitespace
* tweak documentation
* fix tests
4 years ago
Hadrien Croubois
f6efd8aced
Add totalSupply checkpoints to ER20Votes ( #2695 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Hadrien Croubois
100ca0b8a2
ERC20 extension for governance tokens (vote delegation and snapshots) ( #2632 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Nader Dabit
3157aff844
Update docs for setting ERC20 decimals ( #2629 )
4 years ago
Hadrien Croubois
5bd798c6e1
Add ERC3156 extension of ERC20 (flash minting and lending) ( #2543 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Hadrien Croubois
cd443f0d5b
Add tests to extend code coverage ( #2586 )
4 years ago
Hadrien Croubois
24a0bc23cf
Reorganize the repo structure ( #2503 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Hadrien Croubois
5db7413827
re-enabling safemath revert reasons in ERC20, ERC777 and ERC1155 ( #2491 )
...
* re-enabling safemath revert reasons in ERC20 and ERC1155
* adding revert messages to ERC777
* removing uncheck block
4 years ago
Andre Korol
974c534210
Update contracts to support Solidity 0.8.x ( #2442 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Francisco Giordano
f06738828b
Migrate to Hardhat ( #2397 )
4 years ago
Francisco Giordano
ace35fdeda
Update all dependencies transitively ( #2363 )
4 years ago
dibi91
0b489f4d79
Improve test descriptions #1157 ( #2334 )
...
Co-authored-by: Paolo Dibitonto <p.dibitonto@almaviva.it>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
5 years ago
Julian M. Rodriguez
b1ea59e814
Improve testing for ERC20Snapshot ( #2331 )
5 years ago
Julian M. Rodriguez
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>
5 years ago
Nicolás Venturo
c7705712ba
Remove in-constructor requirements ( #2195 )
...
* Remove isConstructor requirement from _setupRole
* Remove isConstructor requirement from _setupDecimals
* Update contracts/access/AccessControl.sol
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
5 years ago
Nicolás Venturo
3e139baa50
Add missing hook to ERC777, fix relevant documentation ( #2191 )
...
* 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
5 years ago
Nicolás Venturo
0408e51ae6
Bundle ERC20Detailed ( #2161 )
...
* Merge ERC20Detailed into ERC20, make derived contracts abstract
* Fix Create2 tests
* Fix failing test
* Default decimals to 18
* Add tests for setupDecimals
* Add changelog entry
* Update CHANGELOG.md
* Update CHANGELOG.md
* Replace isConstructor for !isContract
* Update CHANGELOG.md
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
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
baaadde3c5
Remove ERC20._burnFrom ( #2119 )
...
* Remove ERC20._burnFrom
* Add changelog entry
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
5f92adc2e7
Migrate from truffle to test-environment ( #2007 )
...
* Sketch
* Migrate all tests to test-env
* Finish migration to test-env
* Add config
* Work on GSN tests
* Migrate to newer test-env version and loader syntax
* Add GSN setup
* Finish test-env migration
* Setup coverage using test-env
* Migrate to npm package
* Fix package.json
* Add compile step to CI
* Add comment on coverage setup
* Remove dependency on @truffle/contract
* Fix package-lock merge
* Fix linter errors
* Upgrade test-environment, depend locally on ganche-coverage
* Improve coverage script
* Improve sign.js API
* Move accounts destructuring to describe block
* Switch to prebuilt ethereumjs-vm package
* Upgrade test-enviroment version
* use workspace in circleci config
* remove unnecessary npx
5 years ago
Nicolás Venturo
3274d9db00
Upgrade to @openzeppelin/test-helpers@0.5.1 ( #1942 )
5 years ago
Aram Elchyan
5d34dbecea
Functions in SafeMath contract overloaded to accept custom error messages ( #1828 )
...
* Imporvement: functions in SafeMath contract overloaded to accept custom error messages.
* CHANGELOG updated, custom error messages added to ERC20, ERC721 and ERC777 for subtraction related exceptions.
* SafeMath overloads for 'add' and 'mul' removed.
* Error messages modified.
* Update CHANGELOG.md
6 years ago
Yohann Pereira
489d2e85f1
Replace chai.should with chai.expect ( #1780 )
...
* changed exxpect to expect wherever applicable
* Merged with latest branch
* Updated merkleTree helper to latest master branch
* Made linting fixes
* Fix for test build
* updated for Coverage
* Updated Address.test.js
* Undo package-lock changes.
6 years ago
Nicolás Venturo
a71c3bce32
Update test-helpers to v0.4.0. ( #1770 )
6 years ago
Nicolás Venturo
f7ff3e7e67
Disallow ERC20._transfer from the zero address. ( #1752 )
...
* Add requirement of non-zero from to ERC20 transfer.
* Add test for transferFrom zero address to behavior.
* Create ERC20.transfer behavior.
* Add tests for _transfer.
* Add changelog entry.
* Fix linter error.
* Delete repeated test.
* Fix hardcoded error prefix.
* Update CHANGELOG.md
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* Address review comments.
(cherry picked from commit ad18098d65
)
6 years ago
Nicolás Venturo
ad18098d65
Disallow ERC20._transfer from the zero address. ( #1752 )
...
* Add requirement of non-zero from to ERC20 transfer.
* Add test for transferFrom zero address to behavior.
* Create ERC20.transfer behavior.
* Add tests for _transfer.
* Add changelog entry.
* Fix linter error.
* Delete repeated test.
* Fix hardcoded error prefix.
* Update CHANGELOG.md
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
* Address review comments.
6 years ago
Nicolás Venturo
6c2b7c260d
Add ERC20 compatibility to ERC777. ( #1735 )
...
* Add ERC20 compatibility.
* Reusing ERC20 tests for ERC777.
* Improve documentation.
* Add changelog entry.
* Improved ERC20 behavior tests.
* Add revert reasons to ERC777.
* ERC20 methods allow sending tokens to contracts with no interface.
* Register ERC20 interface.
* Add comment about avoidLockingTokens.
* Improve revert reason string.
* Make ERC777 implement IERC20.
* Fix test revert string.
* Remove unnecesary require.
* Add private _transfer.
* Update contracts/drafts/ERC777/ERC777.sol
Co-Authored-By: nventuro <nicolas.venturo@gmail.com>
* Update private helper names.
(cherry picked from commit aa4c9feabd
)
6 years ago
Nicolás Venturo
aa4c9feabd
Add ERC20 compatibility to ERC777. ( #1735 )
...
* Add ERC20 compatibility.
* Reusing ERC20 tests for ERC777.
* Improve documentation.
* Add changelog entry.
* Improved ERC20 behavior tests.
* Add revert reasons to ERC777.
* ERC20 methods allow sending tokens to contracts with no interface.
* Register ERC20 interface.
* Add comment about avoidLockingTokens.
* Improve revert reason string.
* Make ERC777 implement IERC20.
* Fix test revert string.
* Remove unnecesary require.
* Add private _transfer.
* Update contracts/drafts/ERC777/ERC777.sol
Co-Authored-By: nventuro <nicolas.venturo@gmail.com>
* Update private helper names.
6 years ago
Nicolás Venturo
2f8e844514
Fix remaining revert reasons.
6 years ago
Balaji Pachai
3682c6575c
Added message string for require() ( #1704 )
...
* Error handling in ERC20 and ERC721
* Added message string for require.
* Fixed solhint errors.
* Updated PR as per issue #1709
* changes as per #1709 and openzeppelin forum.
* Changes in require statement
* Changes in require statement
* build pipeline fix
* Changes as per @nventuro's comment.
* Update revert reason strings.
* Fianal update of revert reason strings.
* WIP: Updating reason strings in test cases
* WIP: Added changes to ERC20 and ERC721
* Fixes linting errors in *.tes.js files
* Achieved 100% code coverage
* Updated the test cases with shouldFail.reverting.withMessage()
* Fix package-lock.
* address review comments
* fix linter issues
* fix remaining revert reasons
6 years ago
Prince Sinha
963f1eb35b
removed unnecessary require and renaming of null to zero ( #1717 )
...
* removed unnecessary require
* build pipeline fix
* kept as it is
* Added require
6 years ago
ckshei
19c705d928
Fix/rename anyone account #1357 ( #1718 )
...
* 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
6 years ago
Nicolás Venturo
547a5f242a
Add extcodesize check to SafeERC20. ( #1662 )
...
* Add extcodesize check to SafeERC20.
* Clarify some comments.
* Replace inline assembly with Address.sol.
6 years ago
Nicolás Venturo
41aa39afbc
Add no-return-data ERC20 support to SafeERC20. ( #1655 )
...
* Add no-return-data ERC20 support to SafeERC20.
* Add changelog entry.
* Replace abi.encodeWithSignature for encodeWithSelector.
* Remove SafeERC20 test code duplication.
* Replace assembly for abi.decode.
* Fix linter errors.
6 years ago
Nicolás Venturo
3a5da75876
ERC20._approve ( #1609 )
...
* Add ERC20._approve.
* Add ERC20._approve tests.
* Fix linter error.
* Require owner in _approve to be non-zero.
6 years ago
Nicolás Venturo
96432bf28e
Renamed test/behavior to test/behaviors.
6 years ago
Nicolás Venturo
6a658f2ac8
Move PublicRole.behavior to behavior directory.
6 years ago
Nicolás Venturo
3e82db2f6f
Migration to truffle 5 (and web3 1.0 (and BN)) ( #1601 )
...
* Now compiling using truffle 5.
* Migrated some test files, missing BN scientific notation usage.
* Now using BN time values.
* Migrate ERC20 tests.
* Migrate all ERC20 tests.
* Migrate utils, payment and ownership tests.
* All tests save ERC721 migrated.
* Migrated ERC721 tests.
* Fix lint errors.
* Delete old test helpers.
* Fix remaining crowdsale tests.
* Fix signature bouncer tests.
* Update how constants is used.
* Compile script pre-removes the build dir.
* Fix SafeMath tests.
* Revert "Compile script pre-removes the build dir."
This reverts commit 247e745113
.
* Fix linter errors.
* Upgrade openzeppelin-test-helpers dependency.
* Update openzeppelin-test-helpers dependency.
* Define math constants globally.
* Remove unnecessary ether unit.
* Roll back reduced ether amounts in tests.
* Remove unnecessary toNumber conversions.
* Delete compile script.
* Fixed failing test.
6 years ago
Aniket
70fd243e3b
Test setup helper added ( #1482 )
...
* signing prefix added
* Minor improvement
* Tests changed
* Successfully tested
* Minor improvements
* Minor improvements
* Revert "Dangling commas are now required. (#1359 )"
This reverts commit a6889776f4
.
* updates
* fixes #1404
* approve failing test
* suggested changes done
* ISafeERC20 removed
* conflict fixes
* fixes #1205
* minor change
* suggested changes
* reviewed changes
* final update
6 years ago
Nicolás Venturo
7ef2730506
Approval events on transferFrom and burnFrom ( #1524 )
...
* transferFrom now emits an Approval event, indicating the updated allowance.
* Updated burnFrom to also emit Approval.
* Added notices about the extra Approval events.
6 years ago