Do you have a file called Marketplace.json in your build folder?
no i dont have that file in my built/contract folder
how would i get this file?
Build is where you compiled contracts end up. But where is your marketplace contract? I donāt see it in you contracts directory either?
my Marketplace contract is safed as Marketplace.sol in /test/helpers?? i think thats where the problem si let me test it
now I moved my Marketplace.sol file to /lib/
i ran truffel develop- which works and migrate --reset throws the same error as before
ok dude i figuered it out
I now moved Marketplace.sol to /contracts/ and it works
so the solution was the path that I had to change to
/contracts/Marketplace.sol
Yes all your contracts need to be in /contracts
I encountered the same issue. Thanks for this clarification!
Iām going through the āBuilding Migrations Part 4ā; Iāve copied everything and it compiles, migrates but when I run the balanceOf command, I get 0 no matter the id. So it spawned a couple of questions as I was trying to troubleshoot:
-
The 4_ migration file for creating the tokens, it calls the create and mint functions multiple times, shouldnāt these be transactions on the blockchain resulting in a cost? When I look at that part 4 video, the migrate for the 4_ā¦ migration file shows āTotal cost: 0 ETHā as does mine. The other migration files show a cost and transaction details. So that makes me think the last one didnāt really mint the tokens?
-
This makes wonder how do I troubleshoot/debug something like this? No errors or warnings were spawned to my knowledge. But possibly the tokens didnāt get created, but I have no ability to see why.
-
Finally, I tried to āmintā a token manually through the truffle console. I verified the gametoken contract address and the marketplace recepient address but it gives me an error āVM Exception while processing transaction: revertā. Are we able to manually call this command if everything was run correctly? Is there something Iām missing?
(await GameToken.at(ā0x0c6f3E65C46E0e9B192d2da91B90C10f90f21097ā)).mint(4,[ā0x11f7D6c5F1231Ae900E83A566F0eCe4E4342f769ā], [10])
Thank you!
Itās difficult to debug. I would start by checking so that you are minting and running balanceOf with the same address, because otherwise the balance would be 0 regardless of the ID. So when you are running balanceOf in the terminal, are you sure you are using the Marketplace contract address?
-
Thatās normal. Iām not 100% sure actually, but I would assume itās because truffle is rounding down. But it happens to me as well and is not a problem.
-
Itās difficult to debug. You have to think through step by step and try to go through in your head what might have gone wrong. The first check to make is what I suggested above. Then another way after that could be to run the same thing to ropsten and then checking through a block explorer to see whatās going on.
-
Seems like you get the error because you are sending the address as a string. Should not have the quotes.
Thanks Filip;
I will look into that and let you know!
Awesome job on the content btw!
FYI for anyone interested having this problem; the ERC1155 standard was/is still changing. The receiver requirement is what was causing my inability to mint tokens.
In the version with the videos, the receiver kekkak return value appears to be different? So I took the āmock receiverā code from the ERC-1155 page and incorporated it in place of our receiver function in the marketplace contract. Once I did that the minting of tokens were able to be performed.
Iām obviously a noob and would love a detailed walk through of this process myself. But for the new students this should be noted.
It also sucks that truffle does not provide adequate errors when performing a migrate. This is proof/reason to ensure proper code testing is done prior to any actual deployment.
I will check this out, thanks
would like to know how you solved this. having the same warnings too, thanku
Always getting 0 balance from all 3 tokens when i fetch balanceOf I feel like the problem lies in the function onERC1155Received in the Marketplace contract but not sure. Anybody else having this problem?
also would like to add when I compile, 4_create_tokens migration spends 0 eth. I would assume it would consume some if it is minting tokens?
Those warnings are normal since the function parameters are not used. Donāt worry about that.
I had the same problem with getting 0 for the balance of tokens created in the marketplace for all tokenId. For me the problem lied with the space after the commas in the string given as the argument of the function keccak256 in the method onERC1155Received defined in the marketplace.sol file. There should be no spaces in that string!
I had the same problem with getting 0 for the balance of tokens created in the marketplace for all tokenId. For me the problem lied with the space after the commas in the string given as the argument of the function keccak256 in the method onERC1155Received defined in the marketplace.sol file. There should be no spaces in that string!
I had the same problem with getting 0 for the balance of tokens created in the marketplace for all tokenId. For me the problem lied with the space after the commas in the string given as the argument of the function keccak256 in the method onERC1155Received defined in the marketplace.sol file. There should be no spaces in that string!