# 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:** 1\
**Showing post:** 2

<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.

---

_[View the full topic](https://forum.openzeppelin.com/t/truffle-box-tutorial-token-on-git-hub-error/4289)._
