This repo contains starter code to develop a ethereum project on local machine. It also contains simple local environment to test solidity contracts using mocha and to deploy those contracts using infura.
- Clone the repo
$ git clone https://github.com/suhasranganath/Ethereum-Dev-Starter-Code.git
- Install node packages
$ npm install
- Update the current simple contract code( contracts/Inbox.sol ) with your contract code
- Update compile.js so that it exports 'Interface' and 'Bytecode' of your new contract
Eg: Replace ':Inbox' with ':Contract_Name'. - Compile your contract
$ node compile.js
- Add your test code to Inbox.test.js file.
- Test your contract
$ npm run test
- Update Mnemonic Words(12 words) and Infura api in deploy.js
- Deploy your code to test/mainnet
$ node deploy.js
- contracts/Index.sol - Simple solidity contract code
- test/Index.test.sol - Mocha test code for the contract code
- compile.js - Uses solidity compiler solc to compile and exports Interface and Bytecode of the contract.
- deploy.js - Deployment code. Uses Infura api to connect and deploy contract to test/mainnet ethereum networks
Below is the folder structure of the repo.