# Truffle Box Tutorial Token on Git Hub Error

**URL:** <https://forum.openzeppelin.com/t/truffle-box-tutorial-token-on-git-hub-error/4289>\
**Category:** Contracts\
**Tags:** tutorial\
**Created:** [October 29, 2020, 6:35am UTC](https://forum.openzeppelin.com/t/truffle-box-tutorial-token-on-git-hub-error/4289 "2020-10-29T06:35:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![herschell](https://avatars.discourse-cdn.com/v4/letter/h/90db22/32.png) [@herschell](https://forum.openzeppelin.com/u/herschell)\
**Post date:** [October 29, 2020, 6:35am UTC](https://forum.openzeppelin.com/t/truffle-box-tutorial-token-on-git-hub-error/4289/1 "2020-10-29T06:35:38Z")

</div>

**💻 Environment**

**📝Details**

**🔢 Code to reproduce**

The token is not linked and I can’t access it on metta mask lastly nothing happens when I transfer the token. Note that I am using windows 10 please help! IDK It could be Ganache also.[TutorialToken - Wallet - Google Chrome 10\_22\_2020 2\_29\_17 AM|690x367](https://forum.openzeppelin.com/uploads/short-url/xG2mbredBeGPrKTkjHhJKgfqFwr.png)

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [October 30, 2020, 2:06am UTC](https://forum.openzeppelin.com/t/truffle-box-tutorial-token-on-git-hub-error/4289/2 "2020-10-30T02:06:39Z")

</div>

Hi @herschell,

Unfortunately the Truffle TutorialToken is outdated so may take some effort to get working.  
I mostly used [https://www.trufflesuite.com/tutorials/robust-smart-contracts-with-openzeppelin](https://www.trufflesuite.com/tutorials/robust-smart-contracts-with-openzeppelin) with some additions.

You could look at the following tutorials:

- [Deploy a simple ERC20 token in Remix](https://forum.openzeppelin.com/t/deploy-a-simple-erc20-token-in-remix/1203)
- [Create an ERC20 using Remix, without writing Solidity](https://forum.openzeppelin.com/t/create-an-erc20-using-remix-without-writing-solidity/2908)
- [Create an ERC20 using Truffle, without writing Solidity](https://forum.openzeppelin.com/t/create-an-erc20-using-truffle-without-writing-solidity/2713)

* * *

I installed the current version of OpenZeppelin Contracts (openzeppelin-solidity is the old package name)

```auto
npm install @openzeppelin/contracts

```

I created a simple Tutorial Token contract

```auto
// contracts/TutorialToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;

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

contract TutorialToken is ERC20 {

    constructor () public ERC20("TutorialToken", "TT") {
        _setupDecimals(2);
        _mint(msg.sender, 120 * (10 ** uint256(decimals())));
    }
}

```

I had to update Migrations.sol to a current version

```auto
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.8.0;

contract Migrations {
  address public owner = msg.sender;
  uint public last_completed_migration;

  modifier restricted() {
    require(
      msg.sender == owner,
      "This function is restricted to the contract's owner"
    );
    _;
  }

  function setCompleted(uint completed) public restricted {
    last_completed_migration = completed;
  }
}

```

I used `ganache-cli` as my local blockchain network (though you could use Ganache).

> **[Deploying and interacting with smart contracts - OpenZeppelin Docs](https://docs.openzeppelin.com/learn/deploying-and-interacting#local-blockchain)**

I updated my truffle config to use `ganache-cli` (port 8545) and a later Solidity version 0.6.12.

```auto
module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // for more about customizing your Truffle configuration!
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*" // Match any network id
    }
  },
  compilers: {
    solc: {
      version: "0.6.12", // Fetch exact version from solc-bin (default: truffle's version)
      // docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
      // settings: { // See the solidity docs for advice about optimization and evmVersion
      // optimizer: {
      // enabled: false,
      // runs: 200
      // },
      // evmVersion: "byzantium"
      // }
    },
  },
};

```

In `app.js` I changed the port of the local blockchain to 8545.

```auto
      App.web3Provider = new Web3.providers.HttpProvider('http://127.0.0.1:8545');

```

I used the Truffle Console to transfer tokens to a test account I already had setup on MetaMask, though if you import the private key of the account that deploys the contract you won’t need to do this.

```auto
$ npx truffle console
truffle(development)> token = await TutorialToken.deployed()
undefined
truffle(development)> await token.transfer('0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0', 200)
{ tx: ...
truffle(development)> (await token.balanceOf('0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0')).toString()
'200'

```

The app then displayed my token balance and I could transfer tokens to other accounts.

Feel free to ask any questions so I can help you get up and running.

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [November 2, 2020, 1:31am UTC](https://forum.openzeppelin.com/t/truffle-box-tutorial-token-on-git-hub-error/4289/3 "2020-11-02T01:31:06Z")

</div>

Hi @herschell,

I wanted to check if you were able to get it up and running?
