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

feat(erc777): <- add custom function call when minting #69

Conversation

oliviera9
Copy link

Since ERC777 hooks have been removed, it's impossible to have a contract called when minting the pToken.

This PR adds a IPReceiver interface which exposes a receiveUserData() function that is called when minting the pToken.

@oliviera9 oliviera9 changed the title feat(erc777): add custom function call when minting feat(erc777): <- add custom function call when minting Jan 29, 2024
@@ -76,6 +77,11 @@ contract PToken is
"Recipient cannot be the token contract address!"
);
_mint(recipient, value, userData, operatorData);
if (userData.length > 0) {
// TODO: check if this is needed, and, eventually, replace .code with a function
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it required? Right now there's an exception thrown, i.e.

Transaction reverted: function call to a non-contract account

(check the added test).

@oliviera9 oliviera9 closed this Jan 29, 2024
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.

1 participant