EOSIO.CDT - Simplifying the Development Kit Commands


If you're a developer you may have come across this daunting piece of software. This toolkit has actually made compiling contracts extremely simple.

Let's say we've created our contract and it's located in a directory called mycontract. Inside of this directory it contains two files.

mycontract.cpp
mycontract.hpp

We need three additional files to properly upload a contract to an EOS Account.

Here's what you do with the new command line tools for compiling your contracts.


Basic Command Line Compiling


Creating the .WASM File

eosio-cpp mycontract.cpp -o mycontract.wasm

Creating the .WAST File

eosio-wasm2wast mycontract.wasm -o mycontract.wast

Creating the .ABI File

eosio-abigen mycontract.cpp -output=mycontract.abi

OR

eosio-cpp mycontract.cpp -o mycontract.wasm --abigen

Basic CPP Formatting for .ABI


Actions

This is the cleanest method in my opinion.

[[eosio::action]]
void dostuff( account_name account, string memo);

Tables

This is the cleanest method in my opinion.

struct [[eosio::table]] tablename {
    // Your Table Code
}


Go Back

Social

Made by Stuyk