Skip to content

NFhbar/Token-Deployer

Repository files navigation

Token Deployer

Build Status Coverage Status contributions welcome

A factory contract that deploys an erc20 token and assigns the initial balance to the sender. Built using Truffle Drizzle and zeppelin-solidity.

Dapp (Rinkeby) can be found here.

Medium article here.

To run locally

Install: Metamask & Ganache.

Create a .env file in root directory and add your private key:

RINKEBY_PRIVATE_KEY="MY_PRIVATE_KEY_HERE"
  1. Run Ganache
  2. Deploy MyTokenFactory to ganache: truffle deploy --network ganache
  3. Run local front-end: npm run start
  4. Using Metamask Custom RPC option connect to Private Ganache Network:
  5. RPC Server: HTTP://127.0.0.1:7545
  6. Network ID: 5777
  7. Import your Ganache account into Metamask using private key
  8. Ready to deploy! Fill in token name and symbol and click.

Serves the front-end on http://localhost:3000

npm run start

Run Jest outside of the development console for front-end component tests.

npm run test

Production build

npm run build

Deploy

To deploy:

truffle deploy --network [network]

Truffle Tests and Coverage:

$ npm run test:truffle
$ npm run coverage

Rinkeby Factory Instance

Rinkeby Instance

MyTokenFactory: 0xc922efc865436117055608b7a908e23e75da48f0

Issues

Wrong Contract Address

When migrating

Error: Attempting to run transaction which calls a contract function, but recipient address 0x8cdaf0cd259887258bc13a92c0a6da92698644c0 is not a contract address

Solution: delete contents of /build/contracts and recompile.

Jest test failing 872

reactstrap/reactstrap#872

Quick fix: revert to "reactstrap": "5.0.0-beta". It has older react-popper version.

Metamask does not support WS - Web1.0 Support

Error: The current provider doesn't support subscriptions: MetamaskInpageProvider

MetaMask/metamask-extension#2350

Solidity Coverage testrpc ghost process

After running solidity-coverage, testrpc remains a ghost process. Solution: kill it with:

$ npm run stop

and run coverage again:

$ npm run coverage

License

MIT