-
Notifications
You must be signed in to change notification settings - Fork 841
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
onERC721Received #443
Comments
Can you share your code? |
contract NftMinterA is IERC721Receiver{
} |
Why are you calling |
its a subcontract bro! it will be deployed by facotory contract but my question is all about onERC721Received how can i work it to be true? |
Need to see the code of your NFT contract too. |
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /**
interface IERC721AMock { interface IERC165 { // File: @openzeppelin/contracts/token/ERC721/IERC721.sol // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; /**
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /**
// File: contracts/nft_minter.sol pragma solidity ^0.8.0; contract NftMinter is ERC721A__IERC721Receiver{
function onERC721Received(
function Givescon() pure public returns (bytes4) { } contract NftMinterA is IERC721Receiver{
} // File: contracts/factory.sol pragma solidity ^0.8.0; contract Factory is IERC721Receiver{
function _mintBySubContract(
} |
I can't find anything that is subclassing ERC721A. |
how can implement thar if i do that the function onERC721Received( |
I think you should just make a single contract inherited from ERC721A that also contains the minting function. |
okey i will try then i will update you ! |
not working! same its not updaing tokenIdsByContract[msg.sender].push(_tokenId); on onERC721Received |
Use |
Some general advice: For the best results, you should just copy the code of an established project if you need it up ASAP with minimum hassle. It seems that you are trying to implement something beyond your current Solidity level, or trying to over-engineer things, when a simple all-in-one mintable NFT contract will do the job. You might want to consider the using the OpenZeppelin wizard instead of ERC721A. As much as I would like, issues should not be used as a step by step tutorial. There are better resources for that. |
thanks! actually its my client requirement only |
when i try to rcv my erc721 from null address on my contract onERC721Received its not working
The text was updated successfully, but these errors were encountered: