-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Fix/improve revert reason #1727 #2018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nventuro
merged 24 commits into
OpenZeppelin:master
from
alant:fix/improve-revert-reason-#1727
Jan 23, 2020
Merged
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
839b6bf
adding mock contacts, test code
alant bcb3125
adding changes to ERC721.sol per @frangio's comments on original PR #…
alant 2ee16ec
fix solhint warnings
alant 027822d
Update contracts/token/ERC721/ERC721.sol
alant 07dcbd3
same revert wording per @frangio's review suggestion
alant 1755395
Merge branch 'fix/improve-revert-reason-#1727' of https://github.com/…
alant be4d51d
per @frangio's feedback, changing the inline assembly to accomplish: …
alant f0a90f6
change revert msg assembly per PR comment by @frangio
alant ab1fb60
unify revert msg in test code
alant 59cba42
Merge branch 'master' into fix/improve-revert-reason-#1727
alant cd436a6
fix some failed tests, wording change
alant ee84cda
Update contracts/token/ERC721/ERC721.sol
alant 829032d
Update contracts/token/ERC721/ERC721.sol
alant f5a6a95
Merge branch 'fix/improve-revert-reason-#1727' of https://github.com/…
alant 1162b59
fix test case, revert without reason
alant 6aec945
fix 'ERC721ReceiverRevertsMock: Transaction rejected by receiver'
alant 604f88b
Merge branch 'master' into fix/improve-revert-reason-#1727
alant 9668a49
style change per review by @frangio
alant cf5c2b8
Merge branch 'fix/improve-revert-reason-#1727' of https://github.com/…
alant f279bec
fix revert reason forwarding
frangio 6f33362
remove duplicate contracts/mocks/ERC721ReceiverRevertsMock.sol per re…
alant 4c2930d
Add changelog entry
nventuro 2538e97
Fix tests
nventuro f3e382a
Make tests more clear
nventuro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| pragma solidity ^0.5.0; | ||
|
|
||
| contract ERC721ReceiverNotImplementedMock{ | ||
|
|
||
| event Received(address operator, address from, uint256 tokenId, bytes data, uint256 gas); | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| pragma solidity ^0.5.0; | ||
|
|
||
| import "../token/ERC721/IERC721Receiver.sol"; | ||
|
|
||
| contract ERC721ReceiverRevertsMock is IERC721Receiver { | ||
| bytes4 private _retval; | ||
| bool private _reverts; | ||
|
|
||
| event Received(address operator, address from, uint256 tokenId, bytes data, uint256 gas); | ||
|
|
||
| constructor (bytes4 retval, bool reverts) public { | ||
| _retval = retval; | ||
| _reverts = reverts; | ||
| } | ||
|
|
||
| function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) | ||
| public returns (bytes4) | ||
| { | ||
| require(!_reverts, "ERC721ReceiverRevertsMock: Transaction rejected by receiver"); | ||
| emit Received(operator, from, tokenId, data, gasleft()); | ||
| return _retval; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.