-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Fix/improve revert reason #1727 #2018
Fix/improve revert reason #1727 #2018
Conversation
Thanks @alant! I left a few comments. |
Co-Authored-By: Francisco Giordano <[email protected]>
…alant/openzeppelin-solidity into fix/improve-revert-reason-#1727
…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.
Co-Authored-By: Francisco Giordano <[email protected]>
Co-Authored-By: Francisco Giordano <[email protected]>
…alant/openzeppelin-solidity into fix/improve-revert-reason-#1727
…alant/openzeppelin-solidity into fix/improve-revert-reason-#1727
In f279bec I've fixed the bit of assembly code that was wrong. With this fix things should be finally working correctly now, and you should be able to change the Sorry you had to endure so much back and forth on this! |
Also, I've noticed |
Done. |
No worries. I was not able to change the test to |
|
Thank you for your contribution @alanarvelo! |
* adding mock contacts, test code * adding changes to ERC721.sol per @frangio's comments on original PR OpenZeppelin#1943 * fix solhint warnings * Update contracts/token/ERC721/ERC721.sol Co-Authored-By: Francisco Giordano <[email protected]> * 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 <[email protected]> * Update contracts/token/ERC721/ERC721.sol Co-Authored-By: Francisco Giordano <[email protected]> * 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 <[email protected]> Co-authored-by: Nicolás Venturo <[email protected]>
Fixes #1727