Skip to content
/ dipc Public

Dipc is a compiler that compile Dipperin C++ smart contract code to WebAssembly program.

License

Notifications You must be signed in to change notification settings

dipperin/dipc

Repository files navigation

Dipc (Dipperin Contract Compiler)

Dipc is a compiler that compile Dipperin C++ smart contract code to WebAssembly program.

Build

Required

  • GCC 5.4+ or Clang 4.0+
  • CMake 3.5+
  • Git
  • Python

Ubuntu

Required: 16.04+

  • Install Dependencies
sudo apt install build-essential cmake libz-dev libtinfo-dev
  • Get Source Code
git clone https://github.com/dipperin/dipc.git
cd dipc
git submodule update --init --recursive
  • Build Code
cd dipc
mkdir build && cd build
cmake .. 
make && make install

Windows

Required: MinGW-W64 GCC-8.1.0

NOTES: MinGW and CMake must be installed in a directory without space.

  • Get Source Code
git clone https://github.com/dipperin/dipc.git
cd dipc
git submodule update --init --recursive
  • Build Code
cd dipc
mkdir build && cd build
cmake -G "MinGW Makefiles" .. -DCMAKE_INSTALL_PREFIX="C:/dipc.cdt" -DCMAKE_MAKE_PROGRAM=mingw32-make
mingw32-make && mingw32-make install

Usage

Skeleton Smart Contract Without CMake Support

  • Init a project
dipc-init -project example -bare
  • Build contract
cd example
dipc-cpp -o example.wasm example.cpp -abigen

Skeleton Smart Contract With CMake Support

  • Init CMake project
dipc-init -project cmake_example
  • Build contract

    • Linux
    cd cmake_example/build
    cmake ..
    
    • Windows

    Required:

    cd cmake_example/build
    cmake .. -G "MinGW Makefiles" -DCMAKE_PREFIX_PATH=<cdt_install_dir>

contract instruction

You can find more guidelines for contract writing and deploying in the contract instruction.

License

GNU General Public License v3.0, see LICENSE

About

Dipc is a compiler that compile Dipperin C++ smart contract code to WebAssembly program.

Resources

License

Stars

Watchers

Forks

Packages

No packages published