I install OpenZeppelin's contracts npm install @openzeppelin/contracts

Create a contract:

pragma solidity ^0.5.0;

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

contract NewCoin is ERC20Mintable {

  constructor() public {


truffle compile (successful)

When I load Ganache it imports every single node_module contract into the "Contracts" tab and the program rapidly starts OOMing.

truffle migrate then kills it completely.

What am I doing wrong here? I'm using VS Code with Truffle version:

Truffle v5.1.12 (core: 5.1.12)
Solidity - ^0.5.0 (solc-js)
Node v8.17.0
Web3.js v1.2.1
  • Did you somehow end up with your node_modules folder inside your project contracts folder? – Rob Hitchens Feb 14 '20 at 0:03
  • Nope, I think my folder structure is all fine - i.imgur.com/C1Ezzfu.png – Nick Feb 14 '20 at 7:51
  • 1
    OK this was a silly mistake. My build folder was full of artefacts from a previous test. – Nick Feb 14 '20 at 8:16

If anyone new to Truffle experiences something similar; build folder was full of old artefacts. Deleted them and compiled again to resolve.

Alternatively, run truffle migrate --reset to force the update.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.