GithubHelp home page GithubHelp logo

babydex's Introduction

To setup an Ethereum smart contract project:


Tools you will need:

Install node

  • %> brew install node (This will give you the npm command)

Install the project tools for Ethereum development

%> npm install truffle -g
%> npm install -g ganache-cli

Regarding Ganache for a nicer UI install the tool from the Ganache site


Now, set up your project (Here are the commands….)

%> mkdir <project>
%> cd <project>
%> cp ~/.gitignore_truffle ./.gitignore
%> cp ~/.header_6thcolumn ./.header
%> git init
%> npm init
%> truffle init
%> npm install @openzeppelin/contracts
%> emacs truffle-config (change “solc:” stanza “version” to “0.8.0”)
%> git add .
%> git commit -am “initial commit”

(note: we are ignoring all the openzeppelin code under node_modules)

Now you are ready to start writing your smart contract!

Edit/create the appropriate migrations file(s), compile and run:

%> truffle compile
%> truffle develop

The last command will launch a local faux Ethereum node and give you an interactive prompt to hold context for the locally deployed contract. At the prompt you can run "migrate" to build and (re)deploy your contract (Use the --reset flag with migrate when you want to force a clean rebuild)

In the interactive environment you can run migrate and then get a handle to the deployed contract and make calls against it

let instance myContract = await MyContract.deployed();
myContract.foo();

Remember that you can't let more than once.


We will write our own DEX!

Final Project

Notes:

babydex's People

Contributors

maxgfaraday avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.