Skip to content

feat(tokens-received-whitelisting): <- adds logic for that#68

Open
gskapka wants to merge 13 commits intomasterfrom
add-whitelisting-to-hooks
Open

feat(tokens-received-whitelisting): <- adds logic for that#68
gskapka wants to merge 13 commits intomasterfrom
add-whitelisting-to-hooks

Conversation

@gskapka
Copy link
Collaborator

@gskapka gskapka commented Dec 16, 2022

NOTE: A smart-contract which is registered as an ERC777 token recipient but is not whitelisted in this pToken contract will have not have its tokensReceivedHook called, however mints & transfers will succeed.

NOTE: A smart-contract that is whitelisted for having it's tokensReceived hook called in this pToken contract, but which is not registered as an ERC777 recipient, will not have the hook called, whether present or not, however transfers & mints will succeed.

NOTE: A smart-contract that is whitelisted for having its tokensReceived hook called and is registered as an ERC777 token recipient, but which does not implement the tokensReceived function will not be able to receive the pTokens, either by mints or transfers, because the hook function calls will revert since it doesn't exist.

The various permutations of the above cases are tested in ./test/tokens-received-whitelist.test.js.

@gskapka gskapka force-pushed the add-whitelisting-to-hooks branch from 675dee4 to b6e69fb Compare December 16, 2022 16:42
@gskapka gskapka requested a review from allemanfredi December 16, 2022 16:42
@gskapka gskapka force-pushed the add-whitelisting-to-hooks branch from b6e69fb to 17e9d2b Compare December 16, 2022 16:49
Copy link
Collaborator

@allemanfredi allemanfredi left a comment

Choose a reason for hiding this comment

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

LGTM! Just one mini question!

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.

2 participants