Building Migrations for 1155 Discussion

Welcome to the discussion about this section. Here you can ask questions or post feedback about this specific section.

I am not having the build folder.

1 Like

Run truffle compile in your truffle directory. Then the build folder will be created.

1 Like

Just as a warning, I originally copied the git files as a git clone from enjin but at the time of doing so their files had been updated to pragma solidity 0.5.3 so when I tried to compile these with the other files we have created I truffle did not want to compile with two different versions 0.5.0 & 0.5.3. I simply went back through and changed the cloned files to the 0.5.0 version of solidity. Works fine now. :slight_smile:

1 Like

Thank you, I will correct that.

1 Like

I would like to know why we are not using
artifacts.require("./token.sol") but using
artifacts.require("./GameToken.sol")
in the second migration file? thanks.

1 Like

We always want to use the name of the contract, not the name of the contract file. So if you look in the token contract file you will se that we declare the contract name with

contract GameToken {…}.

That’s the name we use when importing.

1 Like

you named our contract: ‘‘token.sol’’ and later you imported GameToken.sol in our migrations.
I needed to change couple things in order to get it to work.
also I needed to change the solidity version.
Greetz :v:

damn, I don’t have a balance on the Marketplace contract. I always get Zero with all 3 id’s. I will debug tomorrow if I have some time. I need to work. Probably an issue in createToken.js or something.

Yes that was unclear of me. I should have explained it in the video. Truffle always uses the name of the contract, not the file name.

But it’s a dot SOL file ?? So better always name your contract the same as the filename?

@filip
Today I’m trying to debug and when I re-compile I get this…
Let The search begin… :face_with_monocle:

@filip I found my problem :tada:

Fabrice.happy=true; :stuck_out_tongue_winking_eye:

2 Likes

Can you please explain what your issue was and how you solved it for future reference? :slight_smile:

I’m sure there will be someone else with exactly the same issue and mistake you had in the future.

1 Like

Hi

When I try to deploy the erc-1155 contract i get following error

even after using exactly your code for the 4 Migrations i receive the same error
https://github.com/filipmartinsson/Ethereum-Game-Programming-Course/tree/master/Migrations

It can’t find your compiled contract files. You need to make sure that your import statement in the migrations file has the right file name. Truffle requires you to put the name of the contract, not the contract file name. So if your contract name is GameToken and your file name is Token.sol you still need to put GameToken.sol in your import statement.

1 Like

still not working - i changed now everything to GameToken.sol and still get the same error

ok I fixed the issue with - GameToken.sol- i changed everything to GameToken.sol

now I have an error in 3_marketplace_migrate.sol

I get now following error

I have changed marketplace.sol - Marketplace.sol but i still get this error

It’s the same error but for Marketplace. What’s the contract name for the marketplace contract? Not the file name.

Marketplace is the name of the contract