Skip to content
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

Add ERC721 and ERC1155 receiver support in Governor, Timelock #3230

Conversation

ashwinYardi
Copy link
Contributor

@ashwinYardi ashwinYardi commented Mar 1, 2022

Fixes #3174

The main purpose of the PR is to add support for receiving ERC721 and ERC1155 tokens in Governor, Timelock and MinimalForwarder contract. These contracts are responsible for sending transactions to and hence interacting with a lot of protocols.

I have added all the hooks in the main implementation contracts. I was thinking of creating a dedicated contracts and inherting them in the main implementation. However as per @Amxx 's comment, this might break the storage compatibility with respect to upgradable contracts. Please let me know if there is any better way to handle this. :)

PR Checklist

  • Tests
  • Documentation
  • Changelog entry

@ashwinYardi ashwinYardi changed the title add ERC721 and ERC1155 receiver support in Governor, Timelock and MinimalForwarder (#3174) add ERC721 and ERC1155 receiver support in Governor, Timelock (#3174) Mar 6, 2022
@Amxx
Copy link
Collaborator

Amxx commented Mar 21, 2022

Hello @ashwinYardi

I've done some modification, particularly adding the interface inheritance and adding ERC165 support for the ERC1155Receiver (as requested by the ERC)

Notes for @frangio: the code would be simple if we added inheritance from the ERC721Holder & ERC1155Holder, but that would break the storage layout for the upgradeable version. We should do that properly in 5.0.

@frangio frangio changed the title add ERC721 and ERC1155 receiver support in Governor, Timelock (#3174) Add ERC721 and ERC1155 receiver support in Governor, Timelock Mar 22, 2022
Amxx
Amxx previously approved these changes Mar 24, 2022
@Amxx Amxx enabled auto-merge (squash) March 24, 2022 00:13
@Amxx Amxx merged commit 76fca3a into OpenZeppelin:master Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Governor, TimelockController, and similar, should be ERC721Holder
2 participants