Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Refine EOS standard C++ library
Browse files Browse the repository at this point in the history
- implement a large part of example exchange contract
  • Loading branch information
bytemaster committed Jul 11, 2017
1 parent ba22200 commit c5dba14
Show file tree
Hide file tree
Showing 15 changed files with 974 additions and 1,024 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ INCLUDE( VersionMacros )
INCLUDE( SetupTargetMacros )

set( BLOCKCHAIN_NAME "Eos" )
set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD 17 )

set( CLI_CLIENT_EXECUTABLE_NAME eos_client )
set( GUI_CLIENT_EXECUTABLE_NAME eos )
Expand Down
5 changes: 3 additions & 2 deletions contracts/currency/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
currency.wast: currency.cpp Makefile eos.hpp currency.hpp
/usr/local/Cellar/llvm/4.0.0_1/bin/clang-4.0 -emit-llvm --std=c++14 --target=wasm32 -nostdinc -c currency.cpp -I.. -fno-threadsafe-statics -fno-rtti -fno-exceptions -o .currency.bc
currency.wast: currency.cpp Makefile ../eoslib/eos.hpp currency.hpp
/usr/local/Cellar/llvm/4.0.0_1/bin/clang-4.0 -emit-llvm -O3 --std=c++14 --target=wasm32 -c currency.cpp -I.. -fno-threadsafe-statics -fno-rtti -fno-exceptions -o .currency.bc -I /usr/local/Cellar/llvm/4.0.0_1/include/c++/v1/
/Users/dlarimer/Downloads/llvm/build/bin/llc -asm-verbose=false .currency.bc
/Users/dlarimer/eos/libraries/binaryen/bin/s2wasm -s 1024 .currency.s > currency.wast
wc -l currency.wast
Expand All @@ -9,6 +9,7 @@ currency.wast: currency.cpp Makefile eos.hpp currency.hpp
echo ')=====";' >> currency.wast.hpp

# /usr/local/Cellar/llvm/4.0.0_1/bin/clang-4.0 -emit-llvm -O3 --std=c++14 --target=wasm32 -nostdinc -c currency.cpp -I.. -fno-threadsafe-statics -fno-rtti -fno-exceptions -o .currency.bc
# /usr/local/Cellar/llvm/4.0.0_1/bin/clang-4.0 -emit-llvm --std=c++14 --target=wasm32 -nostdinc -c currency.cpp -I.. -fno-threadsafe-statics -fno-rtti -fno-exceptions -o .currency.bc

test.wast: test.cpp Makefile eos.hpp
/usr/local/Cellar/llvm/4.0.0_1/bin/clang-4.0 -emit-llvm -O3 --std=c++14 --target=wasm32 -nostdinc -c test.cpp -I.. -fno-threadsafe-statics -fno-rtti -fno-exceptions
Expand Down
4 changes: 2 additions & 2 deletions contracts/currency/currency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ void apply_currency_transfer() {
requireNotice( transfer.to, transfer.from );
requireAuth( transfer.from );

static CurrencyAccount from_account;
static CurrencyAccount to_account;
CurrencyAccount from_account;
CurrencyAccount to_account;
Db::get( transfer.from, NAME("account"), from_account );
Db::get( transfer.to, NAME("account"), to_account );

Expand Down
2 changes: 1 addition & 1 deletion contracts/currency/currency.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "eos.hpp"
#include <eoslib/eos.hpp>

/**
* Transfer requires that the sender and receiver be the first two
Expand Down
Loading

0 comments on commit c5dba14

Please sign in to comment.