dapp-scratch is a command line interface (CLI) that helps you build Decentralized Apps (dApps/DApps/dapps) from Solidity contracts. It takes a contract’s Application Binary Interface (ABI) and outputs a Javascript module that handles all the basic interaction for use in your project. It’s called dapp-scratch because it helps you build your dapp from scratch. (Github Repo)

Here’s how it works:

$ npm install -g dapp-scratch

$ dapp-scratch -h Usage: dapp-scratch build [options] Options: -V, --version output the version number

-c, --contract [contract] Contract name or location

-b, --abi [abi] ABI name or location

-a, --address [address] Address of deployed contract

-h, --help output usage information Commands: build Build a module from Contract or ABI

test Generate a contract for testing

Running dapp-scratch on a Contract’s ABI will generate a module inside a directory called dapp-module in your project’s root. After importing that module into your app you’ll be able to access your contract right away.

$ dapp-scratch build FeverContract

Contract found at ./build/contracts/FeverContract.sol

web3 installed

web3-provider-engine installed

@aeternity/id-manager-provider installed

Module Created at ./dapp-module/FeverContract/index.js /*

* To use FeverContract just import it into your project:

*/ const FeverContract = require('./dapp-module/FeverContract')

let feverContract = new FeverContract()

feverContract.helloWorld() /*

* Have Fun : )

*/

The module connects to any available instance of Web3—whether via Metamask, Mist, AE Identity Manager, Status, Cipher, Toshi, Ethers.io or any other injected Web3Provider. It polls the currently unlocked account and network to watch for changes. And it has wrapper functions for each of the methods found in the contract’s ABI. These are the features I’ve found myself building over and over again, so I figured automating that process and settling on best practices might be useful. The project is brand new and I’m not 100% confident in any of the conventions, so if you have an opinion on best practices please fork the project and submit a PR. I’d love to know how you prefer interacting with your contracts 📡