Creating our Token Discussion

@CryptoTitan

Hello, probably you have to change something with Atom’s configuration, tweak something related to the linter package (the package may be already obsolete). Not familiar with Atom’s configuration, sorry, since commonly one use VS Code for Solidity development instead because of its more robust environment.

Hope the information is helpful.
With kind regards

2 Likes

There is an error on that application, just check the URL, you will receive an app error "message": "Application error".

I suggest to start using VS Code for all our programming courses, atom is nice but it does not have that many extensions or features like VS Code, also most of our courses are using VS Code.

Carlos Z

2 Likes

Thank you. I decided to move over to vscode

issue when deploying Token

When migrating the contract i have the following error;

type or paste code here
truffle(develop)> migrate
Could not connect to your Ethereum client. Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle.js)

i have installed ganache
i have installed testrpc

but i still have this error of connection

this is my truffle-config.js file:

  networks: {
    // Useful for testing. The `development` name is special - truffle uses it by default
    // if it's defined here and no other network is specified at the command line.
    // You should run a client (like ganache-cli, geth or parity) in a separate terminal
    // tab if you use this network and you must also set the `host`, `port` and `network_id`
    // options below to some value.
    //
      development: {
         host: "127.0.0.1",     // Localhost (default: none)
         port: 8545,            // Standard Ethereum port (default: none)
        network_id: "*",       // Any network (default: none)
     }

Hello @patgeek

There are two approaches to proceed:

  1. in the course, Ganache was not used but rather a testnet (Ropsten), try configuring your truffle to use Ropsten
  2. if you really want to use Ganache, you have to setup your web3 wallet (i.e. Metamask) by adding a network to a localhost to communicate with the local dev blockchain spun by Ganache.

Hope the information is helpful to you
With kind regards

hello

i have configured truffle to use Ropsten:

  ropsten: {
      provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${projectId}`),

      network_id: 3,       // Ropsten's id
      //gas: 5500000,        // Ropsten has a lower block limit than mainnet
      gas: 0000005,        // Ropsten has a lower block limit than mainnet
     confirmations: 2,    // # of confs to wait between deployments. (default: 0)
    timeoutBlocks: 200,  // # of blocks before a deployment times out  (minimum/default: 50)https://ropsten.infura.io/v3/9ccc3ae01b3b4c96b32110738f5654dd
    skipDryRun: true     // Skip dry run before migrations? (default: false for public nets )
   },

when i try to migrate my project to ropsten i have an out of “Ran out of GAs” error:

type or paste"Migrations" ran out of gas (using a value you set in your network config or deployment parameters.)
   * Block limit:  8000000
   * Gas sent:     5500000 code here

what can i do to solve this ran out of gas issue?

1 Like

no remove the gas param you have in your tufflecConfig.js file, re u tryinh to deply to ropstent yes. its jst trial and eeror might take afew times but get rid of thr gas param in yout truffle config

1 Like

Hello @patgeek
simple tagging for notification, see mcgrane5’s remark above.

With kind regards

1 Like

For some reason the GameToken will not compile for me. Here is the error that I am getting.

1 Like

Hello @tricia2321

It’s a compilation error regarding the syntax of the constructor.
You need to remove the ; at the end of line 7 and line 8 because essentially should be one block of code all together. By putting ‘;’ between them makes them separate blocks of code.

Hope that clear things up for you
With kind regards

1 Like

your syntax is the issue. you have a semi colon at the end of your constructor, but ERC20Detailed is extending your constructor so that you can simultaneously fill the constructor of the erc20detailed contract. so change to,

constructor(string memory _name, string memory _symbol) ERC20Detailed(_name, _symbol, _decimals) public {} 
1 Like

ahhh sorry @alp257 only saw your reply after i posted. brillaint. yeah @tricia2321 its exactly as @alp257says

Hi guys,

There is no ERC20Detailed.sol in the openzeppelin 's folder, is it a problem for the course or I can following it ?

Hello @Mis0u,

better use the latest version of Openzeppelin’s ERC20, though you have to keep this in mind and make adjustments to the code moving forward with the course. if I remember it right, the version used in the course is outdated, using the latest version already will help you get use to what is already being used by everyone.

more or less this should be how your code looks like:

pragma solidity ^0.8.0;

import "../node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract GameToken is ERC20 {

    constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) public {}

    function mint(address to, uint256 amount) public virtual {
        _mint(to, amount);
    }
}
1 Like

ok I will do this thx @alp257