Building Migrations for 1155 Discussion

#1

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

0 Likes

#2

I am not having the build folder.

0 Likes

#3

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

1 Like

#4

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

#5

Thank you, I will correct that.

1 Like

#6

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.

0 Likes

#7

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

#8

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:

0 Likes

#9

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.

0 Likes

#10

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.

0 Likes

#11

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

0 Likes

#12

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

0 Likes

#13

@filip I found my problem :tada:

Fabrice.happy=true; :stuck_out_tongue_winking_eye:

2 Likes

#14

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

#15

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

0 Likes

#16

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

#17

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

0 Likes

#18

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

0 Likes

#19

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

0 Likes

#20

Marketplace is the name of the contract

0 Likes