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.
Instead of using a single proxy contract this PR propose changes for creating and destroying a proxy contract for each extra call executed by the ERC827 token. This has another advantage, allowing the receiver contract to verify that the proxy was created by the original msg.sender of the tokens.
The computation of the proxy address receives as input the original msg.sender, the address of the contract to be called by the proxy and a nonce.
ERC827 contract keep tracks of nonces mapped by senders that increment each time a call is executed successfully.
Since the Create2 opcode also takes in count the address of the contract that deploys the contract it allow the token receiver to verify that the call is coming from a proxy that was created by the msg.sender.
For this the receiver contract would need the token and sender address
Note in the ERC827Receiver test fiel I execute tests proving how the sender verification works.