Code Monkey home page Code Monkey logo

solc_web3_compile_deploy_interact's Introduction

solc_web3_compile_deploy_interact

A simple repository to compile, deploy and interact with smart contracts. Plus some extra usefule scripts.

INSTRUCTIONS:

  1. npm install --save solc

  2. npm list solc // To see the installed solc.js version

  3. If required, modify the pragma solidity^<solc_version> line of the .sol file accordingly.

  4. npm install fs-extra

  5. create the /bin/ folder

  6. node compile.js

  7. For proper usage of the sendEth.js file, modify the privateKey and the receiverAddress variables accordingly.

CONTENT:

*Folders:

  • /bin/ folder := The compiled bytecodes and ABIs are saved herein.

  • /contract/ folder := The smart contract files are saved in here.

  • /extra/ folder := Contains additional web3.js-based or ethers.js-based scripts to interact with smart contracts or simply transact in the blockchain from the backend.

*Scripts:

  • compile_singleContract.js := Compiles the Inbox contract of the Inbox.sol file and saves the ABI and the Bytecode into the /bin/ folder. NOTE: Better not to execute this script, which is included mostly for the purpose of illustrating how to compile a single contract.

  • compile.js := Compiles all the contracts (Inbox & Forum) under the Inbox.sol umbrella, so that both ABIs are stored in /bin/ABI.json file, both bytecodes are saved in /bin/Bytecode.json file, and the order of compilation in both json files is stored into the /bin/Contracts.js .

  • deploy.js := Deploys the smart contracts onto a blockchain.

  • Inbox.sol := A solidity file containing two simple self-explanatory smart contracts not even interrelated among them.

  • sendEth.js := A script for sending ETH from a wallet (for which the private key is known) to another wallet. The vanilla network is Rinkeby Ethereum testnet but you may configure it to work on another network variable.

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.