Skip to content

truedeckdev/starter-kit

 
 

Repository files navigation

OpenZeppelin Starter Kit

An OpenZeppelin Starter Kit containing React, OpenZeppelin SDK, OpenZeppelin Contracts, Truffle and Infura.

This kit comes with everything you need to start using upgradeable Smart contracts inside your applications. It also includes all the configuration required to deploy to different networks.

Requirements

Install OpenZeppelin SDK, Ganache, and Truffle

npm install -g truffle@5.0.2 ganache-cli@6.3.0 @openzeppelin/cli@2.5.0

Installation

Ensure you are in a new and empty directory, and run the unpack command with starter to create a starter project:

zos unpack starter

Run

In a new terminal window, run your local blockchain:

ganache-cli --deterministic

In your original terminal window, at the top level of your folder, initialize the project and follow the prompts:

openzeppelin init

In a new terminal window, in the client directory, run the React app:

cd client
npm run start

Interact

You can interact directly with your smart contracts from the openzeppelin cli.

openzeppelin transfer

send funds to a given address.

openzeppelin balance [address]

query the ETH balance of the specified account, also supports ERC20s.

openzeppelin send-tx

sends a transaction to your contract and returns the events.

openzeppelin call

execute a constant method and receive back the value.

Type openzeppelin to see a complete list of availible commands.

Test

Truffle can run tests written in Solidity or JavaScript against your smart contracts. Note the command varies slightly if you're in or outside of the truffle development console.

// inside the development console.
test

// outside the development console..
truffle test

Jest is included for testing React components. Compile your contracts before running Jest, or you may receive some file not found errors.

// ensure you are inside the client directory when running this
npm run test

Build

To build the application for production, use the build script. A production build will be in the client/build folder.

// ensure you are inside the client directory when running this
npm run build

FAQ

About

An OpenZeppelin starter kit containing React, OpenZeppelin SDK & OpenZeppelin Contracts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 72.8%
  • CSS 21.9%
  • HTML 4.4%
  • Shell 0.9%