safeTransferFrom on ERC1155 contracts always sets the to address as the contract address #3283
-
I'm trying to use Ethers to interact with an ERC1155 contract. I'm trying to initiate a transfer but the 'to' address is always ignored and instead in the receipt I see that the 'to' address is the contract address. This is killing me! Any idea why this is happening. I have tried multiple contracts including minting directly on opensea so it's not using a contract I wrote and it doesn't seem to make any difference. My code is as follows:
which returns the receipt:
Am I doing something wrong? I can't see an issue but it refuses to play ball! Thanks for any suggestions. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
That's how Ethereal works. When you interact with a contract, you send the transaction to that contract, along with data that describes what to do. If you look in the data, you will see your to address. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help - in the end I found the issue, it was actually multiple issues. Kind of like an episode of House. :) But the key was adding tx.wait() to actually see the outcome of the transaction. It was also compounded by the fact that transfers were taking around 10 minutes on the testnet so I thought they had failed when in fact they were just stupidly slow. Again the tx.wait() made that clear. Blockchain dev is a new world for sure. |
Beta Was this translation helpful? Give feedback.
Thanks for the help - in the end I found the issue, it was actually multiple issues. Kind of like an episode of House. :) But the key was adding tx.wait() to actually see the outcome of the transaction. It was also compounded by the fact that transfers were taking around 10 minutes on the testnet so I thought they had failed when in fact they were just stupidly slow. Again the tx.wait() made that clear. Blockchain dev is a new world for sure.