This is my first of many tutorials on EOSIO smart contract development. In hope to help grow eos ecosystem I’ll try to share as many tips, tricks and examples as I can.

Tutorial 1


– Linux OS

– ( with little work should work on Mac and Windows )

– Visual Studio Code

– ( enabled IntelliSense )

– cmake

– clang 4.0 lldb-4.0

– python3

I will not go trough installation and basics of using cleos and nodeos, which you can check here, rather I’ll cover basics of writing scripts and show development setup example.

There are couple of ways to script eosio block-chain. It is needed for development and testing purposes. Most basic way to script would be to write bash scripts, but there are already libraries like

EOS.IO Go API library

and there is

EOSFactory  which is Python-based EOS smart-contract development & unit testing framework.

In real world scenario it’s much better to use something like eos-bios for security reasons.

We’ll use EOSFactory because it is cross platform and it’s python based. is my git repository:

If you want to build environment from scratch, I forked eos and eosfactory from tokenika and added my forks via git submodule add.

File structure looks like this:

templates  <- shortcut to eosfactory/templates


git clone –recursive


sudo ./

Install script will automatically create genesis file and start first (required) nodeos run.

After nodeos starts prducing blocks press Ctrl + C to stop nodeos to continue

Test EOSFactory

cd eosfactory

source ~/.profile

python3 ./tests/

python3 ./tests/

python3 ./tests/

cd ..

In eosfactory/templates are template contracts. We can now generate new projects from templates like this.

cd contracts

python3 hello

How to use

python3 -name -template

Check project structure in eos-contracts/contracts/



src <- contract files

There are several ways you can build your contracts

Visual Studio Code will automatically build contract by opening your contract folder. You can rebuild it by pressing Ctrl + Shift + B.

You can check eosfactory documentation here

Word of advice. When building contract with EOSFactory, for example like this

contract = eosf.Contract(john, “eosio.token”)


If you use above code and if you haven’t generated eosio.token contract it will look for it in eos-contracts/eos/build/contracts/eosio.token

I found bug which deletes contents of abi file in eos-contracts/eos/build/contracts/eosio.token when you do, so you don’t have to build every contract you deploy

To run script locate to eos-contracts/contracts/ and

source ~/.profile


To run without exit use

python3 -i


Hope you find it useful 🙂

Your Remaining Votes (within 24hrs) : 10 of 10
13 votes, average: 4.77 out of 513 votes, average: 4.77 out of 513 votes, average: 4.77 out of 513 votes, average: 4.77 out of 513 votes, average: 4.77 out of 5 (13 votes, average: 4.77 out of 5)
You need to be a registered member to rate this.
(558 total tokens earned)