Are there any devs here that have experience in the ERC721HolderUpgradeable and ERC72ReceiverUpgradeable implementations? For some reason, my _checkOnERC721Received function in my ERC721 contract fails when I call safeTransferFrom and send an ERC 721 to a different smart contract (HoldingContract). The HoldingContract initializes the __ERC721Holder_init() and calls _registerInterface(IERC721RecieverUpgradeable.onERC721Received.seletor)
Feb 17, 2021, 11:24 PM
try switching onERC721Received.seletor for onERC721Received.selector
that should work
Feb 17, 2021, 11:40 PM
When you see it.. 😅
Feb 17, 2021, 11:49 PM
sorry, typed fast, its def not typed wrong lol
_registerInterface(IERC721ReceiverUpgradeable.onERC721Received.selector);
It's really weird. The call to the .to here:
https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/c4edd76504b3ad95d11bbef8d558c171d6492922/contracts/token/ERC721/ERC721Upgradeable.sol#L448
fails no matter what.
If I comment that out, the safeTransferFrom works just fine.
https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/c4edd76504b3ad95d11bbef8d558c171d6492922/contracts/token/ERC721/ERC721Upgradeable.sol#L448
fails no matter what.
If I comment that out, the safeTransferFrom works just fine.
My HoldingContract implements the ERC721HolderUpgradeable. The initialize function calls eatch init in this order:
__ERC165_init();
__ERC721Holder_init();
_registerInterface(IERC721ReceiverUpgradeable.onERC721Received.selector);
__ERC165_init();
__ERC721Holder_init();
_registerInterface(IERC721ReceiverUpgradeable.onERC721Received.selector);
weird... I just tried using ganache and it worked (parity was failing). is this a known issue?
Feb 18, 2021, 12:47 AM