hey @jelle_van_der_meer , no worries at all, My pleasure. Glad you find them helpful!!
Hello everyone, I am trying to deploy a erc-1155. I am encountering 2 issues. I want to deploy a erc-1155 with a uri, is there any good docs about implementing that ? Secondly, I am following the walkthrough and I am encountering a problem when I do a truffle migrate, It seems that .create is deprecated, anyone knows the new function that is implemented , Here is the problem : Thanks in advance for your help
Hey @Tumbleur, hope you are well.
Based on the console message, there could be an issue in your 4_create_tokens_migrations.js
file at code line 13. maybe you have a simple typo error.
Carlos Z
Okay, so hereās the latest issue/problem Iāve encountered: When I try to compile and migrate my files (creating and deploying the 1155 token) I get the following error message:
Error: Cannot find module ā@babel/registerā
I can see that I pulled in āBabelrcā when I cloned the ERC1155 github repository (see screenshot below) . . . so my guess is that I need to install Babel, or something like that.
How do I do that? I found something via Google that told me to run the following code:
npm install babel-register --save-dev
I tried it but that didnāt work. Any ideas?
Hello @CaliCrypto22 ,
Unfortunately, I did not experience the same error. Only now I realize I also pulled in ā.babelrcā which is also included with the code we need to clone for the course. I donāt remember it will be used in any part in the course. My guess it is just part of the ERC1155 standard that was proposed 2 years before it got finalized by Ethereum.
Hope this is helpful.
With kind regards,
Hey @CaliCrypto22, hope you are well.
Could you please share the link of the github repo that you cloned?
Maybe you just have to install all the packages with npm install
You can also delete the package-lock.json
to try to download a new version of the dependencies.
Carlos Z
Thanks . . . I went back and started from scratch, using all of Filipās code at the following link: https://github.com/filipmartinsson/Ethereum-Game-Programming-Course/tree/master/Building-our-ERC1155-Token/Setting%20Up%20the%20Environment
I cloned all the github files using this link: https://github.com/filipmartinsson/erc-1155
It seems to be working now (I was able to migrate the files). I have no idea why, but my best guess is that the code (via the link above) got updated while the code in the video did not (my original code, which did not work, was created by following Filip in the video).
I donāt quite understand the part about the 3_marketplace_migration.js from āBuilding Migrations Part 2ā
If the constructor of the Marketplace Contract takes āIERC1155 tokenā as an input why do we need to specify the address of GameToken instead? What is the connection there?
Hello @Konzaih
In this case, since GameToken is already deployed (thereās already an instance of it) and you need that instance to be used in the marketplace, you can simply pass the address of that contract instance. And, you only have to use āIERC1155ā since GameToken (can be other ERC1155 token as well) is expected to support the ERC1155 standard so the functions stated in the interface is callable within the marketplace contract.
Hope this makes it a bit more clear for you.
With kind regards
In case someone struggles with the .balanceOf call, execute the command with square brackets around the tokenId unlike the code in the video.
(await GameToken.at(āGameTokenContractAddressā)).balanceOf(āMarketplaceContractAddressā, [TokenId]).then(bn=> bn.toNumber())
Hello @Scott815,
For further analysis, can you share your code?
Could be one of the ff:
- āTokenā in the migration script should be the name of the smart contract (not the file name)
- Check if the smart contract (*.sol) has compile errors before running the migration
- Truffle configuration
With kind regards
What does it seem like is going wrong here? May it be something with my truffle-config file? Itās a problem with the minting functionality.
Hello @limitlessandrew
Try separating minting the 3 different tokens. Do the mint one at a time like you did with .create
. mint and await
Token1 first then proceed to mint Token2.
Hope that helps.
With kind regards
Hello @limitlessandrew
Commonly, such error is network-related (blockchain to node interaction). What testnet are you deploying? Have you tried using a different wallet? or, redeploying your smart contracts.
With kind regards
I figured it out. I think I was missing an await somewhere. I could use some help on my post in the Unity Blockchain Programming course though. Iām not seeing my script show up in the Components drop down. Which TA is assigned to that course?
Hello @limitlessandrew
Great work, you managed to figure it out. I think thecil
or maybe someone else is checking that course, not sure. Iāll try to check it out.
With kind regards
i am stucked when interacting with GameToken in truffle:
Error: Cannot create instance of GameToken; no code at address 0xD899196527bE27e48D86631b05BB61C2695d49dF
Here is my GameToken contract:
pragma solidity >=0.4.22 <0.9.0;
import "../lib/ERC1155.sol";
import "../lib/ERC1155Mintable.sol";
contract GameToken is ERC1155, ERC1155Mintable{
constructor() public{
}
}
when i interact with GameToken:
truffle(develop)> (await GameToken.at("0xD899196527bE27e48D86631b05BB61C2695d49dF")).balanceOf("0xcdb92A6f4DCa0A69e6EB0C118a6F70BD50e869c5",1).then(bn => bn.toNumber())
i have this error:
Error: Cannot create instance of GameToken; no code at address 0xD899196527bE27e48D86631b05BB61C2695d49dF
0xD899196527bE27e48D86631b05BB61C2695d49dF is the contract address of GameToken
Hello @patgeek, greetings
Have you deployed the contract using a migration script in Truffle?
Where have you deployed the contract, in testnet or locally?
With kind regards