0

We have created a proxy contract that mints an NFT on our existing contract, as no to parameter was originally provided.

Everything works fine, however, once done and the NFT is shown on Crossmint we cannot transfer the NFT into another wallet. The following error is shown: enter image description here

The successful mint transaction was this one: https://rinkeby.etherscan.io/tx/0x700cd7572303770232587ad04c65bb8b8d56f33e00ccd6d8df0980710380bd60

The proxy contract is this one: https://rinkeby.etherscan.io/address/0xC36DB9076D0F662c9945fbd005Ea260B5259521c

Any idea what is going wrong here?

ph1lb4
  • 1,982
  • 17
  • 24
  • Would be helpful to see the existing contract, so that we may understand why the transfer method is not working. – Michael May 20 '22 at 20:19
  • Hi @Michael - just standard ERC721A, you can see the original contract here: https://rinkeby.etherscan.io/address/0x2e78232c7b7a3258cfb392085d1ac71f7f2a6b27#code – ph1lb4 May 23 '22 at 07:12

1 Answers1

0

Something that might be worth looking into is your crossmint method as I think there may be an issue with how the logic is layed out in here.

One thing you might look at is the line where you attempt to transfer your token. Your from parameter is using address(this) which is actually referring to your proxy address and not your oefbContract address. I would change this to your original contract address and see if this makes a difference.

    function crossmint(address to, uint8 amount) external payable {
        uint256 total = oefbContract.totalSupply();
        oefbContract.mintNFT{value: msg.value}(amount);

        for (uint256 i = 0; i < amount; i++) {
            oefbContract.transferFrom(address(this), to, total + i);
        }
    }
Michael
  • 1,454
  • 3
  • 19
  • 45
  • Thanks for your answer. This behaviour is of course correct form the ERC721A standard, but it minted on the parent contract on which already 10 tokens have been minted. Hence, minting token #11 was in fact correct, as there were already 10 other tokens minted before, directly from the contract. Or am I missing something? – ph1lb4 May 24 '22 at 11:03
  • @ph1lb4 sorry, you are correct. I have looked into it a little deeper and have updated my answer. – Michael May 24 '22 at 14:28
  • thanks for the updated answer. I think `address(this)` is also correct, as the mintNFT function transfers the NFT to the proxy contract. But your answer gave me an idea, I think I need to call one of the setApproval methods before as well. – ph1lb4 May 31 '22 at 15:11
  • @ph1lb4 yes you're proxy contract will need to have approval to transfer the NFT. This could also be a factor. You can use setApprovalForAll in this case. – Michael May 31 '22 at 16:00