From 143ee690a9c693d800cb8a2a03204c6f1e252259 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 8 Aug 2018 12:18:47 -0400 Subject: [PATCH 01/38] fixed available memory equals 0, check submodule staleness --- build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.sh b/build.sh index 6317f237c19..dc82c4798d4 100755 --- a/build.sh +++ b/build.sh @@ -68,8 +68,16 @@ fi CORES_AVAIL=`getconf _NPROCESSORS_ONLN` MEM_CORES=$(( ${FREE_MEM}/4000000 )) # 4 gigabytes per core +MEM_CORES=$(( $MEM_CORES > 0 ? $MEM_CORES : 1 )) CORES=$(( $CORES_AVAIL < $MEM_CORES ? $CORES_AVAIL : $MEM_CORES )) +#check submodules +if [ $(( $(git submodule status | grep -c "^[+\-]") )) -gt 0 ]; then + printf "\\n\\tgit submodules are not up to date.\\n" + printf "\\tPlease run the command 'git submodule update --init --recursive'.\\n" + exit 1 +fi + mkdir -p build pushd build &> /dev/null cmake -DCMAKE_INSTALL_PREFIX=/usr/local/eosio.wasmsdk -DBOOST_ROOT="${BOOST}" -DCORE_SYMBOL_NAME="${CORE_SYMBOL}" ../ From a94ca1c44183b7a5dad95a82b30b44f9a665150f Mon Sep 17 00:00:00 2001 From: Todd Fleming Date: Thu, 9 Aug 2018 11:47:23 -0400 Subject: [PATCH 02/38] _n literal operator --- libraries/eosiolib/types.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libraries/eosiolib/types.hpp b/libraries/eosiolib/types.hpp index e2776a3292f..556bfd5c3a5 100644 --- a/libraries/eosiolib/types.hpp +++ b/libraries/eosiolib/types.hpp @@ -119,7 +119,7 @@ namespace eosio { * @brief Conversion Operator * @return uint64_t - Converted result */ - operator uint64_t()const { return value; } + constexpr operator uint64_t()const { return value; } // keep in sync with name::operator string() in eosio source code definition for name std::string to_string() const { @@ -218,3 +218,12 @@ inline bool operator==(const checksum160& lhs, const checksum160& rhs) { inline bool operator!=(const checksum160& lhs, const checksum160& rhs) { return memcmp(&lhs, &rhs, sizeof(lhs)) != 0; } + +/** + * name literal operator + * + * @brief "foo"_n is a shortcut for name{eosio::string_to_name("foo")} + */ +inline constexpr eosio::name operator""_n(const char* s, std::size_t) { + return {eosio::string_to_name(s)}; +} From 6c8fd84495fb1ca14c7a56960a02e53bbcc53dc0 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 9 Aug 2018 13:35:07 -0400 Subject: [PATCH 03/38] added fcolor-diagnostics --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index 0cfb48ff090..d96b484e2ff 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit 0cfb48ff090fc6c4c45f09ad37afcbc89f14a1ae +Subproject commit d96b484e2ffae6b8e94d3a8fa32a8b133815be23 From e94addc16bc2292ebc488847d66250e6f22a3fca Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 9 Aug 2018 13:40:15 -0400 Subject: [PATCH 04/38] submodules, I hate them. --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index d96b484e2ff..d433ad3f818 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit d96b484e2ffae6b8e94d3a8fa32a8b133815be23 +Subproject commit d433ad3f8184031e3cadf823e8bc015fe8aff7bc From 7a5a543c7f58f1638202751b6074423fce2abb13 Mon Sep 17 00:00:00 2001 From: Todd Fleming Date: Fri, 10 Aug 2018 17:06:56 -0400 Subject: [PATCH 05/38] extended_symbol and extended_asset no longer inherit --- libraries/eosiolib/asset.hpp | 28 +++++++++++++++------------- libraries/eosiolib/symbol.hpp | 21 ++++++++++++--------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/libraries/eosiolib/asset.hpp b/libraries/eosiolib/asset.hpp index c4168966bda..6b47faeea2e 100644 --- a/libraries/eosiolib/asset.hpp +++ b/libraries/eosiolib/asset.hpp @@ -378,13 +378,18 @@ namespace eosio { * * @brief Extended asset which stores the information of the owner of the asset */ - struct extended_asset : public asset { + struct extended_asset { + /** + * The asset + */ + asset quantity; + /** * The owner of the asset * * @brief The owner of the asset */ - account_name contract; + name contract; /** * Get the extended symbol of the asset @@ -392,7 +397,7 @@ namespace eosio { * @brief Get the extended symbol of the asset * @return extended_symbol - The extended symbol of the asset */ - extended_symbol get_extended_symbol()const { return extended_symbol( symbol, contract ); } + extended_symbol get_extended_symbol()const { return extended_symbol{ quantity.symbol, contract }; } /** * Default constructor @@ -406,13 +411,13 @@ namespace eosio { * * @brief Construct a new extended asset object */ - extended_asset( int64_t v, extended_symbol s ):asset(v,s),contract(s.contract){} + extended_asset( int64_t v, extended_symbol s ):quantity(v,s.symbol),contract(s.contract){} /** * Construct a new extended asset given the asset and owner name * * @brief Construct a new extended asset object */ - extended_asset( asset a, account_name c ):asset(a),contract(c){} + extended_asset( asset a, name c ):quantity(a),contract(c){} /** * %Print the extended asset @@ -420,7 +425,7 @@ namespace eosio { * @brief %Print the extended asset */ void print()const { - asset::print(); + quantity.print(); prints("@"); printn(contract); } @@ -432,8 +437,7 @@ namespace eosio { * @return extended_asset - New extended asset with its amount is the negative amount of this extended asset */ extended_asset operator-()const { - asset r = this->asset::operator-(); - return {r, contract}; + return {-quantity, contract}; } /** @@ -447,8 +451,7 @@ namespace eosio { */ friend extended_asset operator - ( const extended_asset& a, const extended_asset& b ) { eosio_assert( a.contract == b.contract, "type mismatch" ); - asset r = static_cast(a) - static_cast(b); - return {r, a.contract}; + return {a.quantity - b.quantity, a.contract}; } /** @@ -462,11 +465,10 @@ namespace eosio { */ friend extended_asset operator + ( const extended_asset& a, const extended_asset& b ) { eosio_assert( a.contract == b.contract, "type mismatch" ); - asset r = static_cast(a) + static_cast(b); - return {r, a.contract}; + return {a.quantity + b.quantity, a.contract}; } - EOSLIB_SERIALIZE( extended_asset, (amount)(symbol)(contract) ) + EOSLIB_SERIALIZE( extended_asset, (quantity)(contract) ) }; /// @} asset type diff --git a/libraries/eosiolib/symbol.hpp b/libraries/eosiolib/symbol.hpp index 8e63a0f18e5..443cf10bf94 100644 --- a/libraries/eosiolib/symbol.hpp +++ b/libraries/eosiolib/symbol.hpp @@ -168,16 +168,19 @@ namespace eosio { * \struct Extended asset which stores the information of the owner of the symbol * */ - struct extended_symbol : public symbol_type + struct extended_symbol { + /** + * The symbol + */ + symbol_type symbol; + /** * The owner of the symbol * * @brief The owner of the symbol */ - account_name contract; - - extended_symbol( symbol_name sym = 0, account_name acc = 0 ):symbol_type{sym},contract(acc){} + name contract; /** * %Print the extended symbol @@ -185,7 +188,7 @@ namespace eosio { * @brief %Print the extended symbol */ void print()const { - symbol_type::print(); + symbol.print(); prints("@"); printn( contract ); } @@ -200,7 +203,7 @@ namespace eosio { * @return boolean - true if both provided symbols are the same */ friend bool operator == ( const extended_symbol& a, const extended_symbol& b ) { - return std::tie( a.value, a.contract ) == std::tie( b.value, b.contract ); + return std::tie( a.symbol, a.contract ) == std::tie( b.symbol, b.contract ); } /** @@ -212,14 +215,14 @@ namespace eosio { * @return boolean - true if both provided symbols are the same */ friend bool operator != ( const extended_symbol& a, const extended_symbol& b ) { - return std::tie( a.value, a.contract ) != std::tie( b.value, b.contract ); + return std::tie( a.symbol, a.contract ) != std::tie( b.symbol, b.contract ); } friend bool operator < ( const extended_symbol& a, const extended_symbol& b ) { - return std::tie( a.value, a.contract ) < std::tie( b.value, b.contract ); + return std::tie( a.symbol, a.contract ) < std::tie( b.symbol, b.contract ); } - EOSLIB_SERIALIZE( extended_symbol, (value)(contract) ) + EOSLIB_SERIALIZE( extended_symbol, (symbol)(contract) ) }; // }@ symbolapi From c3aed5c5104bc18a2301bc8762d85cd5fff847d8 Mon Sep 17 00:00:00 2001 From: Todd Fleming Date: Fri, 10 Aug 2018 17:53:06 -0400 Subject: [PATCH 06/38] Add missing comparisons --- libraries/eosiolib/asset.hpp | 43 +++++++++++++++++++++++++++++++++ libraries/eosiolib/currency.hpp | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/libraries/eosiolib/asset.hpp b/libraries/eosiolib/asset.hpp index 6b47faeea2e..e6a1f656fea 100644 --- a/libraries/eosiolib/asset.hpp +++ b/libraries/eosiolib/asset.hpp @@ -468,6 +468,49 @@ namespace eosio { return {a.quantity + b.quantity, a.contract}; } + /// Addition operator. + friend extended_asset& operator+=( extended_asset& a, const extended_asset& b ) { + eosio_assert( a.contract == b.contract, "type mismatch" ); + a.quantity += b.quantity; + return a; + } + + /// Subtraction operator. + friend extended_asset& operator-=( extended_asset& a, const extended_asset& b ) { + eosio_assert( a.contract == b.contract, "type mismatch" ); + a.quantity -= b.quantity; + return a; + } + + /// Less than operator + friend bool operator<( const extended_asset& a, const extended_asset& b ) { + eosio_assert( a.contract == b.contract, "type mismatch" ); + return a.quantity < b.quantity; + } + + + /// Comparison operator + friend bool operator==( const extended_asset& a, const extended_asset& b ) { + return std::tie(a.quantity, a.contract) == std::tie(b.quantity, b.contract); + } + + /// Comparison operator + friend bool operator!=( const extended_asset& a, const extended_asset& b ) { + return std::tie(a.quantity, a.contract) != std::tie(b.quantity, b.contract); + } + + /// Comparison operator + friend bool operator<=( const extended_asset& a, const extended_asset& b ) { + eosio_assert( a.contract == b.contract, "type mismatch" ); + return a.quantity <= b.quantity; + } + + /// Comparison operator + friend bool operator>=( const extended_asset& a, const extended_asset& b ) { + eosio_assert( a.contract == b.contract, "type mismatch" ); + return a.quantity >= b.quantity; + } + EOSLIB_SERIALIZE( extended_asset, (quantity)(contract) ) }; diff --git a/libraries/eosiolib/currency.hpp b/libraries/eosiolib/currency.hpp index 1328c493876..d71268d2584 100644 --- a/libraries/eosiolib/currency.hpp +++ b/libraries/eosiolib/currency.hpp @@ -94,7 +94,7 @@ namespace eosio { } static void inline_transfer( account_name from, account_name to, extended_asset amount, string memo = string(), permission_name perm = N(active) ) { - action act( permission_level( from, perm ), amount.contract, N(transfer), transfer{from,to,amount,memo} ); + action act( permission_level( from, perm ), amount.contract, N(transfer), transfer{from,to,amount.quantity,memo} ); act.send(); } From a029fd8ce29b005462182ad596513ce3fbb1ac87 Mon Sep 17 00:00:00 2001 From: Xus Date: Sat, 11 Aug 2018 01:14:41 +0200 Subject: [PATCH 07/38] fix: FREE_MEM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FREE_MEM gets wrong value if LOCALE is distinct of English. In spanish I get this error: ./build.sh: línea 70: /4000000 : error sintáctico: se esperaba un operando (el elemento de error es "/4000000 ") ./build.sh: línea 71: 4 < ? 4 : : error sintáctico: se esperaba un operando (el elemento de error es "? 4 : ") --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 6317f237c19..2ccc7250260 100755 --- a/build.sh +++ b/build.sh @@ -63,7 +63,7 @@ if [[ `uname` == 'Darwin' ]]; then read -ra FREE_MEM <<< "$FREE_MEM" FREE_MEM=$((${FREE_MEM[2]%?}*(4096))) # free pages * page size else - FREE_MEM=`free | grep "Mem:" | awk '{print $4}'` + FREE_MEM=`LANG=C free | grep "Mem:" | awk '{print $4}'` fi CORES_AVAIL=`getconf _NPROCESSORS_ONLN` From e9fc0173fb63d444f4ce15a2c92076c723a67a1f Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 16 Aug 2018 18:01:26 -0400 Subject: [PATCH 08/38] Update build.sh --- build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sh b/build.sh index 6317f237c19..dfb3ee9162d 100755 --- a/build.sh +++ b/build.sh @@ -10,6 +10,8 @@ txtrst=$(tput sgr0) export DISK_MIN=10 export TEMP_DIR="/tmp" +TEMP_DIR='/tmp' +DISK_MIN=10 unamestr=`uname` if [[ "${unamestr}" == 'Darwin' ]]; then From 4a5ef881d6326a0cd2c7c39bace2974151d56a68 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Mon, 20 Aug 2018 10:12:33 -0400 Subject: [PATCH 09/38] added ignored options to aid in better IDE support --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index d433ad3f818..a9409beefa2 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit d433ad3f8184031e3cadf823e8bc015fe8aff7bc +Subproject commit a9409beefa24d727b42ce935938a89cb7b2143a7 From 6ea6f11b1ec1842e983481ec518c77aaf58da39e Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 21 Aug 2018 18:41:16 -0400 Subject: [PATCH 10/38] fixed -x option --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index a9409beefa2..273b689df96 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit a9409beefa24d727b42ce935938a89cb7b2143a7 +Subproject commit 273b689df967a51898520cbfdbda739a8a0099ee From 479ae2ecfe7035ebd2265ca84db00d3b2c631a3b Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 21 Aug 2018 19:30:30 -0400 Subject: [PATCH 11/38] add fpch-prepocess --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index 273b689df96..e2f530ecc33 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit 273b689df967a51898520cbfdbda739a8a0099ee +Subproject commit e2f530ecc3352407fdf85562ed2237ce30f81ebb From 7118f1da03cc7fb298ecfaed6e9975d02fc29418 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 23 Aug 2018 11:12:50 -0400 Subject: [PATCH 12/38] Update multi_index.hpp --- libraries/eosiolib/multi_index.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/eosiolib/multi_index.hpp b/libraries/eosiolib/multi_index.hpp index d7082559059..06455931290 100644 --- a/libraries/eosiolib/multi_index.hpp +++ b/libraries/eosiolib/multi_index.hpp @@ -567,10 +567,6 @@ class multi_index datastream ds( (char*)buffer, uint32_t(size) ); - if ( max_stack_buffer_size < size_t(size) ) { - free(buffer); - } - auto itm = std::make_unique( this, [&]( auto& i ) { T& val = static_cast(i); ds >> val; @@ -588,7 +584,11 @@ class multi_index auto pitr = itm->__primary_itr; _items_vector.emplace_back( std::move(itm), pk, pitr ); - + + if ( max_stack_buffer_size < size_t(size) ) { + free(buffer); + } + return *ptr; } /// load_object_by_primary_iterator From 225df8b51a2dab4c8bb400690dfe6a53ea0aecbd Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 23 Aug 2018 17:14:44 -0400 Subject: [PATCH 13/38] Added ricardeos from main repo --- CMakeLists.txt | 3 + scripts/ricardeos/README.md | 20 ++++ scripts/ricardeos/ricardeos.py | 166 +++++++++++++++++++++++++++++++++ 3 files changed, 189 insertions(+) create mode 100644 scripts/ricardeos/README.md create mode 100755 scripts/ricardeos/ricardeos.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 0530627ab1d..5abfcc3751b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,3 +51,6 @@ configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_B install(FILES ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake) configure_file(${CMAKE_SOURCE_DIR}/eosio.imports.in ${CMAKE_BINARY_DIR}/eosio.imports COPYONLY) install(FILES ${CMAKE_BINARY_DIR}/eosio.imports DESTINATION ${CMAKE_INSTALL_PREFIX}) + +configure_file(${CMAKE_SOURCE_DIR}/scripts/ricardeos/ricardeos.py ${CMAKE_BINARY_DIR}/scripts/ricardeos.py COPYONLY) +install(FILES ${CMAKE_BINARY_DIR}/ricardeos.py DESTINATION ${CMAKE_INSTALL_PREFIX}/scripts) diff --git a/scripts/ricardeos/README.md b/scripts/ricardeos/README.md new file mode 100644 index 00000000000..32ba8205ec4 --- /dev/null +++ b/scripts/ricardeos/README.md @@ -0,0 +1,20 @@ +# Purpose +The `ricardeos.py` imports or exports ricardian contracts to and from a contracts abi + +## Import Example +`$ python3 ricardeos.py import /path/to/sorce-contract.abi /path/to/new-smart-contract-abi.abi` + +Running this will scan the directory of the abi for all rc.md files and add them to their respective actions. All files with a path format of *clause*-rc.md will be added to the ricardian_clauses section. You can provide the same name for the source and new smart contract abi, the script will prompt you before overwriting. + +The script will also notify the user of any actions that the script cannot find rc.md files for. + +## Export Example +`$ python3 ricardeos.py export /path/to/sorce-contract.abi` + +Running this will dump the contents of all ricardian contracts: + +Actions will be exported in the following format: `--rc.md` + +Clauses will be exported in the following format: `-clause--rc.md` + +If a file already exists the user will be asked if they wish to overwrite the file diff --git a/scripts/ricardeos/ricardeos.py b/scripts/ricardeos/ricardeos.py new file mode 100755 index 00000000000..0c98a07b011 --- /dev/null +++ b/scripts/ricardeos/ricardeos.py @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 + +import json +import sys +import os.path +import fnmatch + +def add_ricardian_contracts_to_actions(source_abi_directory, contract_name, abi_actions): + abi_actions_with_ricardian_contracts = [] + + for abi_action in abi_actions: + action_name = abi_action["name"] + contract_action_filename = '{contract_name}-{action_name}-rc.md'.format(contract_name = contract_name, action_name = action_name) + + # check for rc file + rc_contract_path = os.path.join(source_abi_directory, contract_action_filename) + if os.path.exists(rc_contract_path): + print('Importing Contract {contract_action_filename} for {contract_name}:{action_name}'.format( + contract_action_filename = contract_action_filename, + contract_name = contract_name, + action_name = action_name + )) + + with open(rc_contract_path) as contract_file_handle: + contract_contents = contract_file_handle.read() + + abi_action['ricardian_contract'] = contract_contents + else: + print('Did not find ricardian contract file {contract_action_filename} for {contract_name}:{action_name}, skipping inclusion'.format( + contract_action_filename = contract_action_filename, + contract_name = contract_name, + action_name = action_name + )) + + abi_actions_with_ricardian_contracts.append(abi_action) + + return abi_actions_with_ricardian_contracts + +def create_ricardian_clauses_list(source_abi_directory, contract_name): + clause_file_pattern = '*-clause*-rc.md' + clause_files = fnmatch.filter(os.listdir(source_abi_directory), clause_file_pattern) + + clause_prefix = 'clause-' + clause_postfix = '-rc.md' + + abi_ricardian_clauses = [] + + for clause_file_name in clause_files: + rc_contract_path = os.path.join(source_abi_directory, clause_file_name) + with open(rc_contract_path) as contract_file_handle: + contract_contents = contract_file_handle.read() + + start_of_clause_id = clause_file_name.index( clause_prefix ) + len( clause_prefix ) + end_of_clause_id = clause_file_name.rindex(clause_postfix, start_of_clause_id) + + clause_id = clause_file_name[start_of_clause_id:end_of_clause_id] + + abi_ricardian_clauses.append({ + 'id': clause_id, + 'body': contract_contents + }) + + return abi_ricardian_clauses + +def add_ricardian_contracts_to_abi(source_abi, output_abi): + source_abi_directory = os.path.dirname(source_abi) + contract_name = os.path.split(source_abi)[1].rpartition(".")[0] + + print('Creating {output_abi} with ricardian contracts included'.format(output_abi = output_abi)) + + with open(source_abi, 'r') as source_abi_file: + source_abi_json = json.load(source_abi_file) + try: + source_abi_json['actions'] = add_ricardian_contracts_to_actions(source_abi_directory, contract_name, source_abi_json['actions']) + source_abi_json['ricardian_clauses'] = create_ricardian_clauses_list(source_abi_directory, contract_name) + + except: + pass + with open(output_abi, 'w') as output_abi_file: + json.dump(source_abi_json, output_abi_file, indent=2) + +def import_ricardian_to_abi(source_abi, output_abi): + if not os.path.exists(source_abi): + print('Source ABI not found in {source_abi}'.format(source_abi = source_abi)) + sys.exit(0) + + #if os.path.exists(output_abi): + # overwrite_prompt_response = input('Output ABI {output_abi} already exists, do you want to proceed? (y|n): '.format(output_abi = output_abi)) + # if overwrite_prompt_response == 'y': + # print('Overwriting existing output abi') + # add_ricardian_contracts_to_abi(source_abi, output_abi) + # sys.exit(0) + # else: + # print('User aborted, not overwriting existing abi') + # sys.exit(0) + #else: + add_ricardian_contracts_to_abi(source_abi, output_abi) + +def write_rc_file(path, filename, content): + output_filename = os.path.join(path, filename) + write_file = True + + if os.path.exists(output_filename): + overwrite_prompt_response = input('Output rc {output_filename} already exists, do you want to proceed? (y|n): '.format(output_filename = output_filename)) + if overwrite_prompt_response == 'y': + print('Overwriting existing output rc') + elif overwrite_prompt_response == 'n': + print('Skipping overwrite of {output_filename}'.format(output_filename = output_filename)) + write_file = False + + if write_file: + with open(output_filename, 'w') as text_file: + print(content, file=text_file) + + print('Wrote {output_filename}'.format(output_filename = output_filename)) + +def export_ricardian_from_abi(source_abi): + source_abi_directory = os.path.dirname(source_abi) + contract_name = os.path.split(source_abi)[1].rpartition(".")[0] + + if not os.path.exists(source_abi): + print('Source ABI not found in {source_abi}'.format(source_abi = source_abi)) + sys.exit(0) + + with open(source_abi, 'r') as source_abi_file: + source_abi_json = json.load(source_abi_file) + + for abi_action in source_abi_json['actions']: + output_action_rc_file_name = '{contract_name}-{action_name}-rc.md'.format(contract_name = contract_name, action_name = abi_action['name']) + write_rc_file(source_abi_directory, output_action_rc_file_name, abi_action['ricardian_contract']) + + for abi_clause in source_abi_json['ricardian_clauses']: + output_clause_rc_file_name = '{contract_name}-clause-{clause_id}-rc.md'.format(contract_name = contract_name, clause_id = abi_clause['id']) + write_rc_file(source_abi_directory, output_clause_rc_file_name, abi_clause['body']) + +def main(): + if len(sys.argv) == 1: + print('Please specify an operation of export or import: ./ricardeos.py ') + sys.exit(1) + + if sys.argv[1] == 'import': + if len(sys.argv) < 4: + print('Please specify a source and destination abi:') + print('Usage: ./ricardeos.py import /eos/contracts/contract/mycontract.abi /eos/contracts/contract/withricardian-mycontract.abi') + + sys.exit(0) + else: + import_ricardian_to_abi(sys.argv[2], sys.argv[3]) + + sys.exit(0) + elif sys.argv[1] == 'export': + if len(sys.argv) < 3: + print('Please specify a source abi:') + print('Usage: ./ricardeos.py export /eos/contracts/contract/mycontract.abi') + + sys.exit(0) + else: + export_ricardian_from_abi(sys.argv[2]) + + sys.exit(0) + + else: + print('Operation not recognized only import and export operations are supported') + +if __name__ == '__main__': + main() From 54ce368dd3042b1bb4712c91d29ac153be970c29 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 28 Aug 2018 09:38:58 -0400 Subject: [PATCH 14/38] Remove unused declarations. --- libraries/eosiolib/time.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libraries/eosiolib/time.hpp b/libraries/eosiolib/time.hpp index ff9d0e47757..25f7a323ff0 100644 --- a/libraries/eosiolib/time.hpp +++ b/libraries/eosiolib/time.hpp @@ -38,8 +38,6 @@ namespace eosio { class time_point { public: explicit time_point( microseconds e = microseconds() ) :elapsed(e){} - operator std::string()const; - static time_point from_iso_string( const std::string& s ); const microseconds& time_since_epoch()const { return elapsed; } uint32_t sec_since_epoch()const { return uint32_t(elapsed.count() / 1000000); } bool operator > ( const time_point& t )const { return elapsed._count > t.elapsed._count; } From 5e0f0ee7499bd5b2207f74fb04cea393d8a8783f Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 28 Aug 2018 20:25:49 -0400 Subject: [PATCH 15/38] Update README.md --- README.md | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 95 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 349d2cf7bac..152e0781f29 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,97 @@ Finally, install the build $ sudo ./install.sh ``` +### Building your first smart contract +- Navigate to the hello folder in examples (./examples/hello). +- You should then see the hello.cpp file +- Now run the compiler +```sh +$ eosio-cpp hello.cpp -o hello.wasm +``` +- As of this release abi generation is not available. + +#### Optional, if you know cmake +- If you want to test out the CMake system, stay in the same directory as the previous manual build. + - Sorry for the hiccup, but you will need to change one small line in the `CMakeLists.txt` file. Change `set(EOSIO_WASMSDK_ROOT ${CMAKE_INSTALL_PREFIX})` to `set(EOSIO_WASMSDK_ROOT "/usr/local/eosio.wasmsdk")` +- Then create a build directory ```mkdir build``` and cd into that directory ```cd build``` +- Then run ```cmake ../```, this will generate the cache and supporting files for CMake to do it's job. +- Now simply run ```make```. +- You should now have a `hello` file in the build directory, this is the wasm file, if you'd like to change the name to have the .wasm extension that is perfectly fine, or you can change the add_executable target name to ```hello.wasm```, or simply use cleos to set code the ```hello``` file. + +### Writing an ABI +- The sections to the abi are pretty simple to understand and the syntax is purely JSON, so we are going to write our own ABI file. +- Even after ABI generation is available, an important note should be made that the generator will never be completely perfect for every contract written, advanced features of the newest version of the ABI will require manual construction of the ABI, and odd and advanced C++ patterns could capsize the generators type deductions, so having a good knowledge of how to write an ABI should be an essential piece of knowledge of a smart contract writer. +#### The General Structure of An ABI +```json +{ + "version": "eosio::abi/1.0", + "types": [ + { + "new_type_name": "", + "type": "" + } + ], + "structs": [{ + "name": "", + "base": "", + "fields": [{ + "name": "", + "type": "" + } + ] + } + ], + "actions": [{ + "name": "", + "type": "", + "ricardian_contract": "" + } + ], + "tables": [{ + "name": "", + "type": "", + "index_type": "i64", + "key_names": [""], + "key_types": [""] + }], + "ricardian_clauses": [{} + ], + "error_messages": [], + "abi_extensions": [] +} +``` +- Let's unpack what each one these means +##### abi structure :: types +- ```types``` is a JSON array of objects, where each object has two fields (`new_type_name` and `type`) +- If in your smart contract you would like to use a `typedef` of some type to another, simply add those to here. Where `new_type_name` is the new type name and `type` is simply what you are aliasing from. +##### abi structure :: structs +- ```structs``` is a JSON array of objects, where each object has three fields ( `name`, `base` and `fields` ) +- If in your smart contract you create a new structure that is not one supplied by `eosiolib`, we are going to express that here. Some confusion will ultimately arise if using the `EOSIO_ABI` macro and the method style of writing your actions, because they go here too. +- `name` is the stripped name of the struct/class (i.e. no namespaces, just the name of the class), if using the method style, this is the name of the method. +- `base` is what class that class inherits from (same thing only the stripped name), or "" if it doesn't inherit from any class. For the method style this is always "". +- `fields` is a JSON array of objects with two fields (`name` and `type`), these express the fields of the class we are referencing. For the method approach, these will be the arguments to your method. + - `name` is the field name and `type` is the type of said field. +##### abi structure :: actions +- ```actions``` is a JSON array of objects, where each object has three fields (`name`, `type` and `ricardian_contract`) +- `name` is the name of the action, i.e. the name you would use with `push action` +- `type` is the type of that action, if you are using the method style and the `EOSIO_ABI` macro, then this is the name of your action method. If you are using the struct approach, then this is simply the name of the struct. +- `ricardian_contract` is a plain text contract that is cryptographically linked to each action, the full explanation of this is way beyond the scope of this readme. +##### abi structure :: tables +- ```tables``` is a JSON array of objects, where each object has five fields (`name`, `type`, `index_type`, `key_names`, `key_types`) +- `name` is the name of the table that is given the multi_index typedef. +- `type` is the struct/class type name that is being used as the table. +- `index_type` is always "i64", this is a holdover and will be deprecated. +- `key_names` is a JSON array of strings and is the name of the variable of primary key followed by the name any secondary tables (indexed_by name given with mulit_index typedef) +- `key_types` is a JSON array of strings and is the type name associated with each element in `key_names` (the first element should always be uint64, as we only support i64 primary keys). +##### abi structure :: ricardian_clauses +- ```ricardian_clauses``` is a JSON array of objects, where each object has two fields (`id` and `body`) +- `id` is an identifier you would like to use with that clause +- `body` is the main body of the clause +- as with `ricardian_contracts`, any real explanation of these is beyond the scope of this readme. +##### abi structure :: error_messages +##### abi structure :: abi_extensions +- For now you can ignore these two objects + ### Installed Tools --- * [eosio-cpp](#eosio-cpp) @@ -53,13 +144,13 @@ For example: cmake_minimum_required(VERSION 3.5) project(test_example VERSION 1.0.0) -if(WASM_ROOT STREQUAL "" OR NOT WASM_ROOT) - set(WASM_ROOT ${CMAKE_INSTALL_PREFIX}) +if(EOSIO_WASMSDK_ROOT STREQUAL "" OR NOT EOSIO_WASMSDK_ROOT) + set(EOSIO_WASMSDK_ROOT "/usr/local/eosio.wasmsdk") endif() list(APPEND CMAKE_MODULE_PATH ${WASM_ROOT}/lib/cmake) include(EosioWasmToolchain) -add_executable( test test.cpp ) +add_executable( test.wasm test.cpp ) ``` ```test.cpp``` ``` @@ -160,7 +251,7 @@ eosio.ld options: ### Todos --- - - Add ABI generation to eosio-cpp + - Add ABI generation to eosio.wasmsdk License ---- From 6864a64bb989006bec36e9aaea00b01fabb19d02 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 29 Aug 2018 03:34:55 -0400 Subject: [PATCH 16/38] Fix for Centos lib64 and boost include --- eosio_llvm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eosio_llvm b/eosio_llvm index e2f530ecc33..6683cfb8d97 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit e2f530ecc3352407fdf85562ed2237ce30f81ebb +Subproject commit 6683cfb8d97a7fd22eae687a44a48ba4ab7da3ba From 136174c2f99dbba00e81921ae8114db7326522b9 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 29 Aug 2018 11:05:12 -0400 Subject: [PATCH 17/38] removed currency from eosiolib, exchange from examples --- .gitignore | 4 + examples/exchange/CMakeLists.txt | 23 - .../Pegged Derivative Currency Design.md | 120 ---- examples/exchange/exchange.abi | 166 ------ examples/exchange/exchange.cpp | 246 -------- examples/exchange/exchange.hpp | 87 --- examples/exchange/exchange_accounts.cpp | 27 - examples/exchange/exchange_accounts.hpp | 43 -- examples/exchange/exchange_state.cpp | 87 --- examples/exchange/exchange_state.hpp | 89 --- examples/exchange/market_state.cpp | 223 ------- examples/exchange/market_state.hpp | 77 --- examples/exchange/test_exchange.cpp | 518 ----------------- libraries/eosiolib/contracts.dox | 65 --- libraries/eosiolib/currency.hpp | 254 -------- libraries/eosiolib/mainpage.md | 20 - libraries/eosiolib/rpc.dox | 544 ------------------ 17 files changed, 4 insertions(+), 2589 deletions(-) delete mode 100644 examples/exchange/CMakeLists.txt delete mode 100644 examples/exchange/Pegged Derivative Currency Design.md delete mode 100644 examples/exchange/exchange.abi delete mode 100644 examples/exchange/exchange.cpp delete mode 100644 examples/exchange/exchange.hpp delete mode 100644 examples/exchange/exchange_accounts.cpp delete mode 100644 examples/exchange/exchange_accounts.hpp delete mode 100644 examples/exchange/exchange_state.cpp delete mode 100644 examples/exchange/exchange_state.hpp delete mode 100644 examples/exchange/market_state.cpp delete mode 100644 examples/exchange/market_state.hpp delete mode 100644 examples/exchange/test_exchange.cpp delete mode 100644 libraries/eosiolib/contracts.dox delete mode 100644 libraries/eosiolib/currency.hpp delete mode 100644 libraries/eosiolib/mainpage.md delete mode 100644 libraries/eosiolib/rpc.dox diff --git a/.gitignore b/.gitignore index ce341760f3a..30aee9d425f 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,8 @@ *.out *.app +# Mac OS +.DS_Store + +# Build build/* diff --git a/examples/exchange/CMakeLists.txt b/examples/exchange/CMakeLists.txt deleted file mode 100644 index 2e01df4a738..00000000000 --- a/examples/exchange/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(exchange_example VERSION 1.0.0) - -# if no wasm root is given use default path -if(EOSIO_WASMSDK_ROOT STREQUAL "" OR NOT EOSIO_WASMSDK_ROOT) - set(EOSIO_WASMSDK_ROOT ${CMAKE_INSTALL_PREFIX}) -endif() - -# append the path to the module to include -list(APPEND CMAKE_MODULE_PATH ${EOSIO_WASMSDK_ROOT}/lib/cmake) - -#include the toolchain cmake -include(EosioWasmToolchain) - -add_library(exchange_lib - ${CMAKE_SOURCE_DIR}/exchange_accounts.cpp - ${CMAKE_SOURCE_DIR}/exchange_state.cpp - ${CMAKE_SOURCE_DIR}/market_state.cpp) -target_include_directories( exchange_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ) - -add_executable(exchange exchange.cpp ) -target_include_directories( exchange PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ ) -target_link_libraries( exchange exchange_lib) diff --git a/examples/exchange/Pegged Derivative Currency Design.md b/examples/exchange/Pegged Derivative Currency Design.md deleted file mode 100644 index fc819ccd61f..00000000000 --- a/examples/exchange/Pegged Derivative Currency Design.md +++ /dev/null @@ -1,120 +0,0 @@ -# Pegged Derivative Currency Design - -A currency is designed to be a fungible and non-callable asset. A pegged Derivative currency, such as BitUSD, is backed by a cryptocurrency held as collateral. The "issuer" is "short" the dollar and extra-long the cryptocurrency. The buyer is simply long the dollar. - - - -Background ----------- -BitShares created the first working pegged asset system by allowing anyone to take out a short position by posting collateral and issuing BitUSD at a minimum 1.5:1 collateral:debt ratio. The **least collateralized position** was forced to provide liquidity for BitUSD holders -any time the market price fell more than a couple percent below the dollar (if the BitUSD holder opted to use forced liquidation). - -To prevent abuse of the price feed, all forced liquidation was delayed. - -In the event of a "black swan" all shorts have their positions liquidated at the price feed and all holders of BitUSD are only promised a fixed redemption rate. - -There are several problems with this design: - -1. There is very **poor liquidity** in the BitUSD / BitShares market creating **large spreads** -2. The shorts take all the risk and only profit when the price of BitShares rises -3. Blackswans are perpetual and very disruptive. -4. It is "every short for themselves" -5. Due to the risk/reward ratio the supply can be limited -6. The **collateral requirements** limit opportunity for leverage. - -New Approach ------------- -We present a new approach to pegged assets where the short-positions cooperate to provide the -service of a pegged asset with **high liquidity**. They make money by encouraging people to trade -their pegged asset and earning income **from the trading fees rather than seeking heavy leverage** -in a speculative market. They also generate money by earning interest on personal short positions. - -The Setup Process ------------------ -An initial user deposits a Collateral Currency (C) into an smart contract and provides the initial -price feed. A new Debt token (D) is issued based upon the price feed and a 1.5:1 C:D ratio and the -issued tokens are deposited into the **Bancor market maker**. At this point in time there is 0 leverage by -the market maker because no D have been sold. The initial user is also issued exchange tokens (E) in the -market maker. - -At this point people can buy E or D and the Bancor algorithm will provide liquidity between C, E, and D. Due to -the fees charged by the the market maker the value of E will increase in terms of C. - -> Collateral currency = Smart Token/reserve of parent currency -> -> Issued tokens = Bounty Tokens (distributed to early holders / community supporters) -> -> Collateral Ratio (C:D) = reciprocal of Loan-to-Value Ratio (LTV) - -Maintaining the Peg -------------------- -To maximize the utility of the D token, the market maker needs to maintain a **narrow trading range** of D vs the Dollar. -The more **consistant and reliable this trading range** is, the more people (arbitrageur) will be willing to hold and trade D. There are several -situations that can occur: - -1. D is trading above a dollar +5% - - a. Maker is fully collateralized `C:D>1.5` - - - issue new D and deposit into maker such that collateral ratio is 1.5:1 - b. Maker is not fully collateralized `C:D<1.5` - - - adjust the maker weights to lower the redemption prices (defending capital of maker), arbitrageur will probably prevent this reality. - - > Marker Weights = Connector Weights (in Bancor) - > - > Redemption Price: The price at which a bond may be repurchased by the issuer before maturity - -2. D is selling for less than a dollar -5% - - a. Maker is fully collateralized `C:D>1.5` - - - adjust the maker weights to increase redemption prices - b. Maker is under collateralized `C:D<1.5` - ``` - - stop E -> C and E -> D trades. - - offer bonus on C->E and D->E trades. - - on D->E conversions take received D out of circulation rather than add to the market maker - - on C<->D conversion continue as normal - - stop attempting adjusting maker ratio to defend the price feed and let the price rise until above +1% - ``` - -Value of E = C - D where D == all in circulation, so E->C conversions should always assume all outstanding D was **settled at current maker price**. The result of such a conversion will **raise the collateral ratio**, unless they are forced to buy and retire some D at the current ratio. The algorithm must ensure the individual selling E doesn't leave those holding E worse-off from a D/E perspective (doesnot reduce D to a large extent). An individual buying E will create new D to maintain the same D/E ratio. - -This implies that when value of all outstanding D is greater than all C that E cannot be sold until the network -generates **enough in trading fees** to recaptialize the market. This is like a company with more debt than equity not allowing buybacks. In fact, **E should not be sellable any time the collateral ratio falls below 1.5:1**. - -BitShares is typical **margin call** territory, but holders of E have a chance at future liquidity if the situation improves. While E is not sellable, -E can be purchased at a 10% discount to its theoretical value, this will dilute existing holders of E but will raise capital and hopefully move E holders closer to eventual liquidity. - - -Adjusting Bancor Ratios by Price Feed -------------------------------------- -The price feed informs the algorithm of significant deviations between the Bancor effective price and the target peg. The price feed is necessarily a lagging indicator and may also factor in natural spreads between different exchanges. Therefore, the price feed shall have no impact unless there is a significant deviation (5%). When such a deviation occurs, the ratio is automatically adjusted to 4%. - -In other words, the price feed keeps the maker in the "channel" but does not attempt to set the real-time prices. If there is a sudden change and the price feed differs from maker by 50% then after the adjustment it will still differ by 4%. - -> Effective Price = Connected Tokens exchanged / Smart Tokens exchanged - -Summary -------- -Under this model holders of E are short the dollar and make money to recollateralize their positions via market activity. -Anyone selling E must **realize the losses as a result of being short**. -Anyone buying E can get in to take their place at the current collateral ratio. - -The value of E is equal to the value of a **margin postion**. -Anyone can buy E for a combination C and D equal to the current collateral ratio. - -Anyone may sell E for a personal margin position with equal ratio of C and D. -Anyone may buy E with a personal margin position. - -If they only have C, then they must use some of C to buy D first (which will move the price). -If they only have D, then they must use some of D to buy C first (which will also move the price). - -Anyone can buy and sell E based upon Bancor balances of C and (all D), they must sell their E for a combination of D and C at current ratio, then sell the C or D for the other. - - -Anytime collateral level falls below 1.5 selling E is blocked and buying of E is given a 10% bonus. -Anyone can convert D<->C using Bancor maker configured to maintain price within +/- 5% of the price feed. - - diff --git a/examples/exchange/exchange.abi b/examples/exchange/exchange.abi deleted file mode 100644 index b4cde189371..00000000000 --- a/examples/exchange/exchange.abi +++ /dev/null @@ -1,166 +0,0 @@ -{ - "version": "eosio::abi/1.0", - "types": [{ - "new_type_name": "account_name", - "type": "name" - } - ], - "structs": [ - { - "name": "extended_symbol", - "base": "", - "fields": [ - {"name":"sym", "type":"symbol"}, - {"name":"contract", "type":"account_name"} - ] - }, - { - "name": "extended_asset", - "base": "", - "fields": [ - {"name":"quantity", "type":"asset"}, - {"name":"contract", "type":"account_name"} - ] - }, - { - "name": "upmargin", - "base": "", - "fields": [ - {"name":"borrower", "type":"account_name"}, - {"name":"market", "type":"symbol"}, - {"name":"delta_borrow", "type":"extended_asset"}, - {"name":"delta_collateral", "type":"extended_asset"} - ] - }, - { - "name": "covermargin", - "base": "", - "fields": [ - {"name":"borrower", "type":"account_name"}, - {"name":"market", "type":"symbol"}, - {"name":"cover_amount", "type":"extended_asset"} - ] - }, - { - "name": "lend", - "base": "", - "fields": [ - {"name":"lender", "type":"account_name"}, - {"name":"market", "type":"symbol"}, - {"name":"quantity", "type":"extended_asset"} - ] - }, - { - "name": "unlend", - "base": "", - "fields": [ - {"name":"lender", "type":"account_name"}, - {"name":"market", "type":"symbol"}, - {"name":"interest_shares", "type":"float64"}, - {"name":"interest_symbol", "type":"extended_symbol"} - ] - }, - { - "name": "trade", - "base": "", - "fields": [ - {"name":"seller", "type":"account_name"}, - {"name":"market", "type":"symbol"}, - {"name":"sell", "type":"extended_asset"}, - {"name":"min_receive", "type":"extended_asset"}, - {"name":"expire", "type":"uint32"}, - {"name":"fill_or_kill", "type":"uint8"} - ] - }, - { - "name": "createx", - "base": "", - "fields": [ - {"name":"creator", "type":"account_name"}, - {"name":"initial_supply", "type":"asset"}, - {"name":"fee", "type":"uint32"}, - {"name":"base_deposit", "type":"extended_asset"}, - {"name":"quote_deposit", "type":"extended_asset"} - ] - }, - { - "name": "transfer", - "base": "", - "fields": [ - {"name":"from", "type":"account_name"}, - {"name":"to", "type":"account_name"}, - {"name":"quantity", "type":"asset"}, - {"name":"memo", "type":"string"} - ] - }, - { - "name": "deposit", - "base": "", - "fields": [ - {"name":"from", "type":"account_name"}, - {"name":"quantity", "type":"extended_asset"} - ] - }, - { - "name": "create", - "base": "", - "fields": [ - {"name":"issuer", "type":"account_name"}, - {"name":"maximum_supply", "type":"asset"}, - {"name":"can_freeze", "type":"uint8"}, - {"name":"can_recall", "type":"uint8"}, - {"name":"can_whitelist", "type":"uint8"} - ] - },{ - "name": "issue", - "base": "", - "fields": [ - {"name":"to", "type":"account_name"}, - {"name":"quantity", "type":"asset"}, - {"name":"memo", "type":"string"} - ] - },{ - "name": "account", - "base": "", - "fields": [ - {"name":"currency", "type":"uint64"}, - {"name":"balance", "type":"uint64"} - ] - },{ - "name": "currency_stats", - "base": "", - "fields": [ - {"name":"currency", "type":"uint64"}, - {"name":"supply", "type":"uint64"} - ] - } - ], - "actions": [ - { "name": "deposit", "type": "deposit", "ricardian_contract": "" }, - { "name": "transfer", "type": "transfer", "ricardian_contract": "" }, - { "name": "trade", "type": "trade", "ricardian_contract": "" }, - { "name": "createx", "type": "createx", "ricardian_contract": "" }, - { "name": "issue", "type": "issue", "ricardian_contract": "" }, - { "name": "lend", "type": "lend", "ricardian_contract": "" }, - { "name": "unlend", "type": "unlend", "ricardian_contract": "" }, - { "name": "upmargin", "type": "upmargin", "ricardian_contract": "" }, - { "name": "covermargin", "type": "covermargin", "ricardian_contract": "" }, - { "name": "create", "type": "create", "ricardian_contract": "" } - ], - "tables": [{ - "name": "account", - "type": "account", - "index_type": "i64", - "key_names" : ["currency"], - "key_types" : ["uint64"] - },{ - "name": "stat", - "type": "currency_stats", - "index_type": "i64", - "key_names" : ["currency"], - "key_types" : ["uint64"] - } - ], - "ricardian_clauses": [], - "abi_extensions": [] -} diff --git a/examples/exchange/exchange.cpp b/examples/exchange/exchange.cpp deleted file mode 100644 index cd344909816..00000000000 --- a/examples/exchange/exchange.cpp +++ /dev/null @@ -1,246 +0,0 @@ -#include -#include "exchange.hpp" - -#include - -namespace eosio { - - void exchange::deposit( account_name from, extended_asset quantity ) { - eosio_assert( quantity.is_valid(), "invalid quantity" ); - currency::inline_transfer( from, _this_contract, quantity, "deposit" ); - _accounts.adjust_balance( from, quantity, "deposit" ); - } - - void exchange::withdraw( account_name from, extended_asset quantity ) { - require_auth( from ); - eosio_assert( quantity.is_valid(), "invalid quantity" ); - eosio_assert( quantity.amount >= 0, "cannot withdraw negative balance" ); // Redundant? inline_transfer will fail if quantity is not positive. - _accounts.adjust_balance( from, -quantity ); - currency::inline_transfer( _this_contract, from, quantity, "withdraw" ); - } - - void exchange::on( const trade& t ) { - require_auth( t.seller ); - eosio_assert( t.sell.is_valid(), "invalid sell amount" ); - eosio_assert( t.sell.amount > 0, "sell amount must be positive" ); - eosio_assert( t.min_receive.is_valid(), "invalid min receive amount" ); - eosio_assert( t.min_receive.amount >= 0, "min receive amount cannot be negative" ); - - auto receive_symbol = t.min_receive.get_extended_symbol(); - eosio_assert( t.sell.get_extended_symbol() != receive_symbol, "invalid conversion" ); - - market_state market( _this_contract, t.market, _accounts ); - - auto temp = market.exstate; - auto output = temp.convert( t.sell, receive_symbol ); - - while( temp.requires_margin_call() ) { - market.margin_call( receive_symbol ); - temp = market.exstate; - output = temp.convert( t.sell, receive_symbol ); - } - market.exstate = temp; - - print( name{t.seller}, " ", t.sell, " => ", output, "\n" ); - - if( t.min_receive.amount != 0 ) { - eosio_assert( t.min_receive.amount <= output.amount, "unable to fill" ); - } - - _accounts.adjust_balance( t.seller, -t.sell, "sold" ); - _accounts.adjust_balance( t.seller, output, "received" ); - - if( market.exstate.supply.amount != market.initial_state().supply.amount ) { - auto delta = market.exstate.supply - market.initial_state().supply; - - _excurrencies.issue_currency( { .to = _this_contract, - .quantity = delta, - .memo = string("") } ); - } - - /// TODO: if pending order start deferred trx to fill it - - market.save(); - } - - - /** - * This action shall fail if it would result in a margin call - */ - void exchange::on( const upmargin& b ) { - require_auth( b.borrower ); - eosio_assert( b.delta_borrow.is_valid(), "invalid borrow delta" ); - eosio_assert( b.delta_collateral.is_valid(), "invalid collateral delta" ); - - market_state market( _this_contract, b.market, _accounts ); - - eosio_assert( b.delta_borrow.amount != 0 || b.delta_collateral.amount != 0, "no effect" ); - eosio_assert( b.delta_borrow.get_extended_symbol() != b.delta_collateral.get_extended_symbol(), "invalid args" ); - eosio_assert( market.exstate.base.balance.get_extended_symbol() == b.delta_borrow.get_extended_symbol() || - market.exstate.quote.balance.get_extended_symbol() == b.delta_borrow.get_extended_symbol(), - "invalid asset for market" ); - eosio_assert( market.exstate.base.balance.get_extended_symbol() == b.delta_collateral.get_extended_symbol() || - market.exstate.quote.balance.get_extended_symbol() == b.delta_collateral.get_extended_symbol(), - "invalid asset for market" ); - - market.update_margin( b.borrower, b.delta_borrow, b.delta_collateral ); - - /// if this succeeds then the borrower will see their balances adjusted accordingly, - /// if they don't have sufficient balance to either fund the collateral or pay off the - /// debt then this will fail before we go further. - _accounts.adjust_balance( b.borrower, b.delta_borrow, "borrowed" ); - _accounts.adjust_balance( b.borrower, -b.delta_collateral, "collateral" ); - - market.save(); - } - - void exchange::on( const covermargin& c ) { - require_auth( c.borrower ); - eosio_assert( c.cover_amount.is_valid(), "invalid cover amount" ); - eosio_assert( c.cover_amount.amount > 0, "cover amount must be positive" ); - - market_state market( _this_contract, c.market, _accounts ); - - market.cover_margin( c.borrower, c.cover_amount); - - market.save(); - } - - void exchange::createx( account_name creator, - asset initial_supply, - uint32_t /* fee */, - extended_asset base_deposit, - extended_asset quote_deposit - ) { - require_auth( creator ); - eosio_assert( initial_supply.is_valid(), "invalid initial supply" ); - eosio_assert( initial_supply.amount > 0, "initial supply must be positive" ); - eosio_assert( base_deposit.is_valid(), "invalid base deposit" ); - eosio_assert( base_deposit.amount > 0, "base deposit must be positive" ); - eosio_assert( quote_deposit.is_valid(), "invalid quote deposit" ); - eosio_assert( quote_deposit.amount > 0, "quote deposit must be positive" ); - eosio_assert( base_deposit.get_extended_symbol() != quote_deposit.get_extended_symbol(), - "must exchange between two different currencies" ); - - print( "base: ", base_deposit.get_extended_symbol() ); - print( "quote: ",quote_deposit.get_extended_symbol() ); - - auto exchange_symbol = initial_supply.symbol.name(); - print( "marketid: ", exchange_symbol, " \n " ); - - markets exstates( _this_contract, exchange_symbol ); - auto existing = exstates.find( exchange_symbol ); - - eosio_assert( existing == exstates.end(), "market already exists" ); - exstates.emplace( creator, [&]( auto& s ) { - s.manager = creator; - s.supply = extended_asset(initial_supply, _this_contract); - s.base.balance = base_deposit; - s.quote.balance = quote_deposit; - - s.base.peer_margin.total_lent.symbol = base_deposit.symbol; - s.base.peer_margin.total_lent.contract = base_deposit.contract; - s.base.peer_margin.total_lendable.symbol = base_deposit.symbol; - s.base.peer_margin.total_lendable.contract = base_deposit.contract; - - s.quote.peer_margin.total_lent.symbol = quote_deposit.symbol; - s.quote.peer_margin.total_lent.contract = quote_deposit.contract; - s.quote.peer_margin.total_lendable.symbol = quote_deposit.symbol; - s.quote.peer_margin.total_lendable.contract = quote_deposit.contract; - }); - - _excurrencies.create_currency( { .issuer = _this_contract, - // TODO: After currency contract respects maximum supply limits, the maximum supply here needs to be set appropriately. - .maximum_supply = asset( 0, initial_supply.symbol ), - .issuer_can_freeze = false, - .issuer_can_whitelist = false, - .issuer_can_recall = false } ); - - _excurrencies.issue_currency( { .to = _this_contract, - .quantity = initial_supply, - .memo = string("initial exchange tokens") } ); - - _accounts.adjust_balance( creator, extended_asset( initial_supply, _this_contract ), "new exchange issue" ); - _accounts.adjust_balance( creator, -base_deposit, "new exchange deposit" ); - _accounts.adjust_balance( creator, -quote_deposit, "new exchange deposit" ); - } - - void exchange::lend( account_name lender, symbol_type market, extended_asset quantity ) { - require_auth( lender ); - eosio_assert( quantity.is_valid(), "invalid quantity" ); - eosio_assert( quantity.amount > 0, "must lend a positive amount" ); - - market_state m( _this_contract, market, _accounts ); - m.lend( lender, quantity ); - m.save(); - } - - void exchange::unlend( account_name lender, symbol_type market, double interest_shares, extended_symbol interest_symbol ) { - require_auth( lender ); - eosio_assert( interest_shares > 0, "must unlend a positive amount" ); - - market_state m( _this_contract, market, _accounts ); - m.unlend( lender, interest_shares, interest_symbol ); - m.save(); - } - - - void exchange::on( const currency::transfer& t, account_name code ) { - if( code == _this_contract ) - _excurrencies.on( t ); - - if( t.to == _this_contract ) { - auto a = extended_asset(t.quantity, code); - eosio_assert( a.is_valid(), "invalid quantity in transfer" ); - eosio_assert( a.amount != 0, "zero quantity is disallowed in transfer"); - eosio_assert( a.amount > 0 || t.memo == "withdraw", "withdrew tokens without withdraw in memo"); - eosio_assert( a.amount < 0 || t.memo == "deposit", "received tokens without deposit in memo" ); - _accounts.adjust_balance( t.from, a, t.memo ); - } - } - - - #define N(X) ::eosio::string_to_name(#X) - - void exchange::apply( account_name contract, account_name act ) { - - if( act == N(transfer) ) { - on( unpack_action_data(), contract ); - return; - } - - if( contract != _this_contract ) - return; - - auto& thiscontract = *this; - switch( act ) { - EOSIO_API( exchange, (createx)(deposit)(withdraw)(lend)(unlend) ) - }; - - switch( act ) { - case N(trade): - on( unpack_action_data() ); - return; - case N(upmargin): - on( unpack_action_data() ); - return; - case N(covermargin): - on( unpack_action_data() ); - return; - default: - _excurrencies.apply( contract, act ); - return; - } - } - -} /// namespace eosio - - - -extern "C" { - [[noreturn]] void apply( uint64_t receiver, uint64_t code, uint64_t action ) { - eosio::exchange ex( receiver ); - ex.apply( code, action ); - eosio_exit(0); - } -} diff --git a/examples/exchange/exchange.hpp b/examples/exchange/exchange.hpp deleted file mode 100644 index d619c13d65e..00000000000 --- a/examples/exchange/exchange.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include -#include -#include -#include - -namespace eosio { - - /** - * This contract enables users to create an exchange between any pair of - * standard currency types. A new exchange is created by funding it with - * an equal value of both sides of the order book and giving the issuer - * the initial shares in that orderbook. - * - * To prevent exessive rounding errors, the initial deposit should include - * a sizeable quantity of both the base and quote currencies and the exchange - * shares should have a quantity 100x the quantity of the largest initial - * deposit. - * - * Users must deposit funds into the exchange before they can trade on the - * exchange. - * - * Each time an exchange is created a new currency for that exchanges market - * maker is also created. This currencies supply and symbol must be unique and - * it uses the currency contract's tables to manage it. - */ - class exchange { - private: - account_name _this_contract; - currency _excurrencies; - exchange_accounts _accounts; - - public: - exchange( account_name self ) - :_this_contract(self), - _excurrencies(self), - _accounts(self) - {} - - void createx( account_name creator, - asset initial_supply, - uint32_t fee, - extended_asset base_deposit, - extended_asset quote_deposit - ); - - void deposit( account_name from, extended_asset quantity ); - void withdraw( account_name from, extended_asset quantity ); - void lend( account_name lender, symbol_type market, extended_asset quantity ); - - void unlend( - account_name lender, - symbol_type market, - double interest_shares, - extended_symbol interest_symbol - ); - - struct covermargin { - account_name borrower; - symbol_type market; - extended_asset cover_amount; - }; - - struct upmargin { - account_name borrower; - symbol_type market; - extended_asset delta_borrow; - extended_asset delta_collateral; - }; - - struct trade { - account_name seller; - symbol_type market; - extended_asset sell; - extended_asset min_receive; - uint32_t expire = 0; - uint8_t fill_or_kill = true; - }; - - void on( const trade& t ); - void on( const upmargin& b ); - void on( const covermargin& b ); - void on( const currency::transfer& t, account_name code ); - - void apply( account_name contract, account_name act ); - }; -} // namespace eosio diff --git a/examples/exchange/exchange_accounts.cpp b/examples/exchange/exchange_accounts.cpp deleted file mode 100644 index 249b56c3e66..00000000000 --- a/examples/exchange/exchange_accounts.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include - -namespace eosio { - - void exchange_accounts::adjust_balance( account_name owner, extended_asset delta, const string& reason ) { - (void)reason; - - auto table = exaccounts_cache.find( owner ); - if( table == exaccounts_cache.end() ) { - table = exaccounts_cache.emplace( owner, exaccounts(_this_contract, owner ) ).first; - } - auto useraccounts = table->second.find( owner ); - if( useraccounts == table->second.end() ) { - table->second.emplace( owner, [&]( auto& exa ){ - exa.owner = owner; - exa.balances[delta.get_extended_symbol()] = delta.amount; - eosio_assert( delta.amount >= 0, "overdrawn balance 1" ); - }); - } else { - table->second.modify( useraccounts, 0, [&]( auto& exa ) { - const auto& b = exa.balances[delta.get_extended_symbol()] += delta.amount; - eosio_assert( b >= 0, "overdrawn balance 2" ); - }); - } - } - -} /// namespace eosio diff --git a/examples/exchange/exchange_accounts.hpp b/examples/exchange/exchange_accounts.hpp deleted file mode 100644 index 57d9faa24c8..00000000000 --- a/examples/exchange/exchange_accounts.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once -#include -#include - -namespace eosio { - - using boost::container::flat_map; - using namespace std; - /** - * Each user has their own account with the exchange contract that keeps track - * of how much a user has on deposit for each extended asset type. The assumption - * is that storing a single flat map of all balances for a particular user will - * be more practical than breaking this down into a multi-index table sorted by - * the extended_symbol. - */ - struct exaccount { - account_name owner; - flat_map balances; - - uint64_t primary_key() const { return owner; } - EOSLIB_SERIALIZE( exaccount, (owner)(balances) ) - }; - - typedef eosio::multi_index exaccounts; - - - /** - * Provides an abstracted interface around storing balances for users. This class - * caches tables to make multiple accesses effecient. - */ - struct exchange_accounts { - exchange_accounts( account_name code ):_this_contract(code){} - - void adjust_balance( account_name owner, extended_asset delta, const string& reason = string() ); - - private: - account_name _this_contract; - /** - * Keep a cache of all accounts tables we access - */ - flat_map exaccounts_cache; - }; -} /// namespace eosio diff --git a/examples/exchange/exchange_state.cpp b/examples/exchange/exchange_state.cpp deleted file mode 100644 index 7f40fae9641..00000000000 --- a/examples/exchange/exchange_state.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include - -namespace eosio { - extended_asset exchange_state::convert_to_exchange( connector& c, extended_asset in ) { - - real_type R(supply.amount); - real_type C(c.balance.amount+in.amount); - real_type F(c.weight/1000.0); - real_type T(in.amount); - real_type ONE(1.0); - - real_type E = -R * (ONE - std::pow( ONE + T / C, F) ); - int64_t issued = int64_t(E); - - supply.amount += issued; - c.balance.amount += in.amount; - - return extended_asset( issued, supply.get_extended_symbol() ); - } - - extended_asset exchange_state::convert_from_exchange( connector& c, extended_asset in ) { - eosio_assert( in.contract == supply.contract, "unexpected asset contract input" ); - eosio_assert( in.symbol== supply.symbol, "unexpected asset symbol input" ); - - real_type R(supply.amount - in.amount); - real_type C(c.balance.amount); - real_type F(1000.0/c.weight); - real_type E(in.amount); - real_type ONE(1.0); - - - real_type T = C * (std::pow( ONE + E/R, F) - ONE); - int64_t out = int64_t(T); - - supply.amount -= in.amount; - c.balance.amount -= out; - - return extended_asset( out, c.balance.get_extended_symbol() ); - } - - extended_asset exchange_state::convert( extended_asset from, extended_symbol to ) { - auto sell_symbol = from.get_extended_symbol(); - auto ex_symbol = supply.get_extended_symbol(); - auto base_symbol = base.balance.get_extended_symbol(); - auto quote_symbol = quote.balance.get_extended_symbol(); - - if( sell_symbol != ex_symbol ) { - if( sell_symbol == base_symbol ) { - from = convert_to_exchange( base, from ); - } else if( sell_symbol == quote_symbol ) { - from = convert_to_exchange( quote, from ); - } else { - eosio_assert( false, "invalid sell" ); - } - } else { - if( to == base_symbol ) { - from = convert_from_exchange( base, from ); - } else if( to == quote_symbol ) { - from = convert_from_exchange( quote, from ); - } else { - eosio_assert( false, "invalid conversion" ); - } - } - - if( to != from.get_extended_symbol() ) - return convert( from, to ); - - return from; - } - - bool exchange_state::requires_margin_call( const exchange_state::connector& con )const { - if( con.peer_margin.total_lent.amount > 0 ) { - auto tmp = *this; - auto base_total_col = int64_t(con.peer_margin.total_lent.amount * con.peer_margin.least_collateralized); - auto covered = tmp.convert( extended_asset( base_total_col, con.balance.get_extended_symbol()), con.peer_margin.total_lent.get_extended_symbol() ); - if( covered.amount <= con.peer_margin.total_lent.amount ) - return true; - } - return false; - } - - bool exchange_state::requires_margin_call()const { - return requires_margin_call( base ) || requires_margin_call( quote ); - } - - -} /// namespace eosio diff --git a/examples/exchange/exchange_state.hpp b/examples/exchange/exchange_state.hpp deleted file mode 100644 index 42268e5039f..00000000000 --- a/examples/exchange/exchange_state.hpp +++ /dev/null @@ -1,89 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace eosio { - - typedef double real_type; - - struct margin_state { - extended_asset total_lendable; - extended_asset total_lent; - real_type least_collateralized = std::numeric_limits::max(); - - /** - * Total shares allocated to those who have lent, when someone unlends they get - * total_lendable * user_interest_shares / interest_shares and total_lendable is reduced. - * - * When interest is paid, it shows up in total_lendable - */ - real_type interest_shares = 0; - - real_type lend( int64_t new_lendable ) { - if( total_lendable.amount > 0 ) { - real_type new_shares = (interest_shares * new_lendable) / total_lendable.amount; - interest_shares += new_shares; - total_lendable.amount += new_lendable; - } else { - interest_shares += new_lendable; - total_lendable.amount += new_lendable; - } - return new_lendable; - } - - extended_asset unlend( double ishares ) { - extended_asset result = total_lent; - print( "unlend: ", ishares, " existing interest_shares: ", interest_shares, "\n" ); - result.amount = int64_t( (ishares * total_lendable.amount) / interest_shares ); - - total_lendable.amount -= result.amount; - interest_shares -= ishares; - - eosio_assert( interest_shares >= 0, "underflow" ); - eosio_assert( total_lendable.amount >= 0, "underflow" ); - - return result; - } - - EOSLIB_SERIALIZE( margin_state, (total_lendable)(total_lent)(least_collateralized)(interest_shares) ) - }; - - /** - * Uses Bancor math to create a 50/50 relay between two asset types. The state of the - * bancor exchange is entirely contained within this struct. There are no external - * side effects associated with using this API. - */ - struct exchange_state { - account_name manager; - extended_asset supply; - uint32_t fee = 0; - - struct connector { - extended_asset balance; - uint32_t weight = 500; - - margin_state peer_margin; /// peer_connector collateral lending balance - - EOSLIB_SERIALIZE( connector, (balance)(weight)(peer_margin) ) - }; - - connector base; - connector quote; - - uint64_t primary_key()const { return supply.symbol.name(); } - - extended_asset convert_to_exchange( connector& c, extended_asset in ); - extended_asset convert_from_exchange( connector& c, extended_asset in ); - extended_asset convert( extended_asset from, extended_symbol to ); - - bool requires_margin_call( const exchange_state::connector& con )const; - bool requires_margin_call()const; - - EOSLIB_SERIALIZE( exchange_state, (manager)(supply)(fee)(base)(quote) ) - }; - - typedef eosio::multi_index markets; - -} /// namespace eosio diff --git a/examples/exchange/market_state.cpp b/examples/exchange/market_state.cpp deleted file mode 100644 index 78fa7ba9f87..00000000000 --- a/examples/exchange/market_state.cpp +++ /dev/null @@ -1,223 +0,0 @@ -#include -#include - -namespace eosio { - - market_state::market_state( account_name this_contract, symbol_type market_symbol, exchange_accounts& acnts ) - :marketid( market_symbol.name() ), - market_table( this_contract, marketid ), - base_margins( this_contract, (marketid<<4) + 1), - quote_margins( this_contract, (marketid<<4) + 2), - base_loans( this_contract, (marketid<<4) + 1), - quote_loans( this_contract, (marketid<<4) + 2), - _accounts(acnts), - market_state_itr( market_table.find(marketid) ) - { - eosio_assert( market_state_itr != market_table.end(), "unknown market" ); - exstate = *market_state_itr; - } - - void market_state::margin_call( extended_symbol debt_type ) { - if( debt_type == exstate.base.balance.get_extended_symbol() ) - margin_call( exstate.base, base_margins ); - else - margin_call( exstate.quote, quote_margins ); - } - - void market_state::margin_call( exchange_state::connector& c, margins& marginstable ) { - auto price_idx = marginstable.get_index(); - auto pos = price_idx.begin(); - if( pos == price_idx.end() ) - return; - - auto receipt = exstate.convert( pos->collateral, pos->borrowed.get_extended_symbol() ); - eosio_assert( receipt.amount >= pos->borrowed.amount, "programmer error: insufficient collateral to cover" );/// VERY BAD, SHOULD NOT HAPPEN - auto change_debt = receipt - pos->borrowed; - - auto change_collat = exstate.convert( change_debt, pos->collateral.get_extended_symbol() ); - - _accounts.adjust_balance( pos->owner, change_collat ); - - c.peer_margin.total_lent.amount -= pos->borrowed.amount; - price_idx.erase(pos); - - pos = price_idx.begin(); - if( pos != price_idx.end() ) - c.peer_margin.least_collateralized = pos->call_price; - else - c.peer_margin.least_collateralized = double(uint64_t(-1)); - } - - - const exchange_state& market_state::initial_state()const { - return *market_state_itr; - } - - void market_state::lend( account_name lender, const extended_asset& quantity ) { - auto sym = quantity.get_extended_symbol(); - _accounts.adjust_balance( lender, -quantity ); - - if( sym == exstate.base.balance.get_extended_symbol() ) { - double new_shares = exstate.base.peer_margin.lend( quantity.amount ); - adjust_lend_shares( lender, base_loans, new_shares ); - } - else if( sym == exstate.quote.balance.get_extended_symbol() ) { - double new_shares = exstate.quote.peer_margin.lend( quantity.amount ); - adjust_lend_shares( lender, quote_loans, new_shares ); - } - else eosio_assert( false, "unable to lend to this market" ); - } - - void market_state::unlend( account_name lender, double ishares, const extended_symbol& sym ) { - eosio_assert( ishares > 0, "cannot unlend negative balance" ); - adjust_lend_shares( lender, base_loans, -ishares ); - - print( "sym: ", sym ); - - if( sym == exstate.base.balance.get_extended_symbol() ) { - extended_asset unlent = exstate.base.peer_margin.unlend( ishares ); - _accounts.adjust_balance( lender, unlent ); - } - else if( sym == exstate.quote.balance.get_extended_symbol() ) { - extended_asset unlent = exstate.quote.peer_margin.unlend( ishares ); - _accounts.adjust_balance( lender, unlent ); - } - else eosio_assert( false, "unable to lend to this market" ); - } - - - - void market_state::adjust_lend_shares( account_name lender, loans& l, double delta ) { - auto existing = l.find( lender ); - if( existing == l.end() ) { - l.emplace( lender, [&]( auto& obj ) { - obj.owner = lender; - obj.interest_shares = delta; - eosio_assert( delta >= 0, "underflow" ); - }); - } else { - l.modify( existing, 0, [&]( auto& obj ) { - obj.interest_shares += delta; - eosio_assert( obj.interest_shares >= 0, "underflow" ); - }); - } - } - - void market_state::cover_margin( account_name borrower, const extended_asset& cover_amount ) { - if( cover_amount.get_extended_symbol() == exstate.base.balance.get_extended_symbol() ) { - cover_margin( borrower, base_margins, exstate.base, cover_amount ); - } else if( cover_amount.get_extended_symbol() == exstate.quote.balance.get_extended_symbol() ) { - cover_margin( borrower, quote_margins, exstate.quote, cover_amount ); - } else { - eosio_assert( false, "invalid debt asset" ); - } - } - - - /** - * This method will use the collateral to buy the borrowed asset from the market - * with collateral to cancel the debt. - */ - void market_state::cover_margin( account_name borrower, margins& m, exchange_state::connector& c, - const extended_asset& cover_amount ) - { - auto existing = m.find( borrower ); - eosio_assert( existing != m.end(), "no known margin position" ); - eosio_assert( existing->borrowed.amount >= cover_amount.amount, "attempt to cover more than user has" ); - - auto tmp = exstate; - auto estcol = tmp.convert( cover_amount, existing->collateral.get_extended_symbol() ); - auto debpaid = exstate.convert( estcol, cover_amount.get_extended_symbol() ); - eosio_assert( debpaid.amount >= cover_amount.amount, "unable to cover debt" ); - - auto refundcover = debpaid - cover_amount; - - auto refundcol = exstate.convert( refundcover, existing->collateral.get_extended_symbol() ); - estcol.amount -= refundcol.amount; - - if( existing->borrowed.amount == cover_amount.amount ) { - auto freedcollateral = existing->collateral - estcol; - m.erase( existing ); - existing = m.begin(); - _accounts.adjust_balance( borrower, freedcollateral ); - } - else { - m.modify( existing, 0, [&]( auto& obj ) { - obj.collateral.amount -= estcol.amount; - obj.borrowed.amount -= cover_amount.amount; - obj.call_price = double(obj.borrowed.amount) / obj.collateral.amount; - }); - } - c.peer_margin.total_lent.amount -= cover_amount.amount; - - if( existing != m.end() ) { - if( existing->call_price < c.peer_margin.least_collateralized ) - c.peer_margin.least_collateralized = existing->call_price; - } else { - c.peer_margin.least_collateralized = std::numeric_limits::max(); - } - } - - void market_state::update_margin( account_name borrower, const extended_asset& delta_debt, const extended_asset& delta_col ) - { - if( delta_debt.get_extended_symbol() == exstate.base.balance.get_extended_symbol() ) { - adjust_margin( borrower, base_margins, exstate.base, delta_debt, delta_col ); - } else if( delta_debt.get_extended_symbol() == exstate.quote.balance.get_extended_symbol() ) { - adjust_margin( borrower, quote_margins, exstate.quote, delta_debt, delta_col ); - } else { - eosio_assert( false, "invalid debt asset" ); - } - } - - void market_state::adjust_margin( account_name borrower, margins& m, exchange_state::connector& c, - const extended_asset& delta_debt, const extended_asset& delta_col ) - { - auto existing = m.find( borrower ); - if( existing == m.end() ) { - eosio_assert( delta_debt.amount > 0, "cannot borrow neg" ); - eosio_assert( delta_col.amount > 0, "cannot have neg collat" ); - - existing = m.emplace( borrower, [&]( auto& obj ) { - obj.owner = borrower; - obj.borrowed = delta_debt; - obj.collateral = delta_col; - obj.call_price = double(obj.borrowed.amount) / obj.collateral.amount; - }); - } else { - if( existing->borrowed.amount == -delta_debt.amount ) { - eosio_assert( existing->collateral.amount == -delta_col.amount, "user failed to claim all collateral" ); - - m.erase( existing ); - existing = m.begin(); - } else { - m.modify( existing, 0, [&]( auto& obj ) { - obj.borrowed += delta_debt; - obj.collateral += delta_col; - obj.call_price = double(obj.borrowed.amount) / obj.collateral.amount; - }); - } - } - - c.peer_margin.total_lent += delta_debt; - eosio_assert( c.peer_margin.total_lent.amount <= c.peer_margin.total_lendable.amount, "insufficient funds availalbe to borrow" ); - - if( existing != m.end() ) { - if( existing->call_price < c.peer_margin.least_collateralized ) - c.peer_margin.least_collateralized = existing->call_price; - - eosio_assert( !exstate.requires_margin_call( c ), "this update would trigger a margin call" ); - } else { - c.peer_margin.least_collateralized = std::numeric_limits::max(); - } - - } - - - - void market_state::save() { - market_table.modify( market_state_itr, 0, [&]( auto& s ) { - s = exstate; - }); - } - -} diff --git a/examples/exchange/market_state.hpp b/examples/exchange/market_state.hpp deleted file mode 100644 index e145ef61cc1..00000000000 --- a/examples/exchange/market_state.hpp +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once -#include -#include - -namespace eosio { - - /** - * We calculate a unique scope for each market/borrowed_symbol/collateral_symbol and then - * instantiate a table of margin positions... with in this table each user has exactly - * one position and therefore the owner can serve as the primary key. - */ - struct margin_position { - account_name owner; - extended_asset borrowed; - extended_asset collateral; - double call_price = 0; - - uint64_t get_call()const { return uint64_t(1000000*call_price); } - uint64_t primary_key()const { return owner; } - - EOSLIB_SERIALIZE( margin_position, (owner)(borrowed)(collateral)(call_price) ) - }; - - typedef eosio::multi_index > - > margins; - - - struct loan_position { - account_name owner; /// the owner - double interest_shares; /// the number of shares in the total lent pool - - uint64_t primary_key()const { return owner; } - - EOSLIB_SERIALIZE( loan_position, (owner)(interest_shares) ) - }; - - typedef eosio::multi_index loans; - - /** - * Maintains a state along with the cache of margin positions and/or limit orders. - */ - struct market_state { - market_state( account_name this_contract, symbol_type market_symbol, exchange_accounts& acnts ); - - const exchange_state& initial_state()const; - void margin_call( extended_symbol debt_type ); - void lend( account_name lender, const extended_asset& debt ); - void unlend( account_name lender, double ishares, const extended_symbol& sym ); - void update_margin( account_name borrower, const extended_asset& delta_debt, - const extended_asset& delta_collateral ); - void cover_margin( account_name borrower, const extended_asset& cover_amount ); - - void save(); - - symbol_name marketid; - exchange_state exstate; - - markets market_table; - margins base_margins; - margins quote_margins; - loans base_loans; - loans quote_loans; - - private: - exchange_accounts& _accounts; - markets::const_iterator market_state_itr; - - void cover_margin( account_name borrower, margins& m, exchange_state::connector& c, - const extended_asset& cover_amount ); - void adjust_margin( account_name borrower, margins& m, exchange_state::connector& c, - const extended_asset& delta_debt, const extended_asset& delta_col ); - void adjust_lend_shares( account_name lender, loans& l, double delta ); - void margin_call( exchange_state::connector& c, margins& m ); - }; - -} /// namespace eosio diff --git a/examples/exchange/test_exchange.cpp b/examples/exchange/test_exchange.cpp deleted file mode 100644 index a6a1f9dae96..00000000000 --- a/examples/exchange/test_exchange.cpp +++ /dev/null @@ -1,518 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -/* -#include -#include -#include -#include - -#include -#include "fixed.hpp" -*/ - -#include -#include - -//#include "bfp/lib/posit.h" - -using namespace std; - -typedef long double real_type; -typedef double token_type; - - -/* -struct margin_position { - account_name owner; - uint64_t exchange_id; - asset lent; - asset collateral; - uint64_t open_time; - - uint64_t primary_key()const{ return owner; } - uint256_t by_owner_ex_lent_collateral()const { - - } - - real_type by_call_price()const { - return collateral.amount / real_type(lent.amount); - } -}; -*/ - - - -template -Real Abs(Real Nbr) -{ - if( Nbr >= 0 ) - return Nbr; - else - return -Nbr; -} - -template -Real sqrt_safe( const Real Nbr) -{ - return sqrt(Nbr); -// cout << " " << Nbr << "\n";; - Real Number = Nbr / Real(2.0); - const Real Tolerance = Real(double(1.0e-12)); - //cout << "tol: " << Tolerance << "\n"; - - Real Sq; - Real Er; - do { - auto tmp = Nbr / Number; - tmp += Number; - tmp /= real_type(2.0); - if( Number == tmp ) break; - Number = tmp; - Sq = Number * Number; - Er = Abs(Sq - Nbr); -// wdump((Er.getDouble())(1.0e-8)(Tolerance.getDouble())); -// wdump(((Er - Tolerance).getDouble())); - }while( Er >= Tolerance ); - - return Number; -} - -typedef __uint128_t uint128_t; -typedef string account_name; -typedef string symbol_type; - -static const symbol_type exchange_symbol = "EXC"; - -struct asset { - token_type amount; - symbol_type symbol; -}; - -struct margin_key { - symbol_type lent; - symbol_type collat; -}; - -struct margin { - asset lent; - symbol_type collateral_symbol; - real_type least_collateralized_rate; -}; - -struct user_margin { - asset lent; - asset collateral; - - real_type call_price()const { - return collateral.amount / real_type(lent.amount); - } -}; - -struct exchange_state; -struct connector { - asset balance; - real_type weight = 0.5; - token_type total_lent; /// lent from maker to users - token_type total_borrowed; /// borrowed from users to maker - token_type total_available_to_lend; /// amount available to borrow - token_type interest_pool; /// total interest earned but not claimed, - /// each user can claim user_lent - - void borrow( exchange_state& ex, const asset& amount_to_borrow ); - asset convert_to_exchange( exchange_state& ex, const asset& input ); - asset convert_from_exchange( exchange_state& ex, const asset& input ); -}; - - -struct balance_key { - account_name owner; - symbol_type symbol; - - friend bool operator < ( const balance_key& a, const balance_key& b ) { - return std::tie( a.owner, a.symbol ) < std::tie( b.owner, b.symbol ); - } - friend bool operator == ( const balance_key& a, const balance_key& b ) { - return std::tie( a.owner, a.symbol ) == std::tie( b.owner, b.symbol ); - } -}; - -real_type fee = 1;//.9995; - - -int64_t maxtrade = 20000ll; - -struct exchange_state { - token_type supply; - symbol_type symbol = exchange_symbol; - - connector base; - connector quote; - - void transfer( account_name user, asset q ) { - output[balance_key{user,q.symbol}] += q.amount; - } - map output; - vector margins; -}; - -/* -void connector::borrow( exchange_state& ex, account_name user, - asset amount_to_borrow, - asset collateral, - user_margin& marg ) { - FC_ASSERT( amount_to_borrow.amount < balance.amount, "attempt to borrow too much" ); - lent.amount += amount_to_borrow.amount; - balance.amount -= amount_to_borrow.amount; - ex.transfer( user, amount_to_borrow ); - - marg.collateral.amount += collateral.amount; - marg.lent.amount += amount_to_borrow.amount; - auto p = marg.price(); - - if( collateral.symbol == ex.symbol ) { - if( p > ex_margin.least_collateralized_rate ) - ex_margin.least_collateralized_rate = p; - } - else if( collateral.symbol == peer_margin.collateral.symbol ) { - if( p > peer_margin.least_collateralized_rate ) - peer_margin.least_collateralized_rate = p; - } -} -*/ - -asset connector::convert_to_exchange( exchange_state& ex, const asset& input ) { - - real_type R(ex.supply); - real_type S(balance.amount+input.amount); - real_type F(weight); - real_type T(input.amount); - real_type ONE(1.0); - - auto E = R * (ONE - std::pow( ONE + T / S, F) ); - - - //auto real_issued = real_type(ex.supply) * (sqrt_safe( 1.0 + (real_type(input.amount) / (balance.amount+input.amount))) - 1.0); - //auto real_issued = real_type(ex.supply) * (std::pow( 1.0 + (real_type(input.amount) / (balance.amount+input.amount)), weight) - real_type(1.0)); - //auto real_issued = R * (std::pow( ONE + (T / S), F) - ONE); - - //wdump((double(E))(double(real_issued))); - token_type issued = -E; //real_issued; - - - ex.supply += issued; - balance.amount += input.amount; - - return asset{ issued, exchange_symbol }; -} - -asset connector::convert_from_exchange( exchange_state& ex, const asset& input ) { - - real_type R(ex.supply - input.amount); - real_type S(balance.amount); - real_type F(weight); - real_type E(input.amount); - real_type ONE(1.0); - - real_type T = S * (std::pow( ONE + E/R, ONE/F) - ONE); - - - /* - real_type base = real_type(1.0) + ( real_type(input.amount) / real_type(ex.supply-input.amount)); - auto out = (balance.amount * ( std::pow(base,1.0/weight) - real_type(1.0) )); - */ - auto out = T; - -// edump((double(out-T))(double(out))(double(T))); - - ex.supply -= input.amount; - balance.amount -= token_type(out); - return asset{ token_type(out), balance.symbol }; -} - - -void eosio_assert( bool test, const string& msg ) { - if( !test ) throw std::runtime_error( msg ); -} - -void print_state( const exchange_state& e ); - - - -/** - * Given the current state, calculate the new state - */ -exchange_state convert( const exchange_state& current, - account_name user, - asset input, - asset min_output, - asset* out = nullptr) { - - eosio_assert( min_output.symbol != input.symbol, "cannot convert" ); - - exchange_state result(current); - - asset initial_output = input; - - if( input.symbol != exchange_symbol ) { - if( input.symbol == result.base.balance.symbol ) { - initial_output = result.base.convert_to_exchange( result, input ); - } - else if( input.symbol == result.quote.balance.symbol ) { - initial_output = result.quote.convert_to_exchange( result, input ); - } - else eosio_assert( false, "invalid symbol" ); - } else { - if( min_output.symbol == result.base.balance.symbol ) { - initial_output = result.base.convert_from_exchange( result, initial_output ); - } - else if( min_output.symbol == result.quote.balance.symbol ) { - initial_output= result.quote.convert_from_exchange( result, initial_output ); - } - else eosio_assert( false, "invalid symbol" ); - } - - - - asset final_output = initial_output; - -// std::cerr << "\n\nconvert " << input.amount << " "<< input.symbol << " => " << final_output.amount << " " << final_output.symbol << " final: " << min_output.symbol << " \n"; - - result.output[ balance_key{user,final_output.symbol} ] += final_output.amount; - result.output[ balance_key{user,input.symbol} ] -= input.amount; - - if( min_output.symbol != final_output.symbol ) { - return convert( result, user, final_output, min_output, out ); - } - - if( out ) *out = final_output; - return result; -} - -/* VALIDATE MARGIN ALGORITHM - * - * Given an initial condition, verify that all margin positions can be filled. - * - * Assume 3 assets, B, Q, and X and the notation LENT-COLLAT we get the following - * pairs: - * - * B-X - * B-A - * A-X - * A-B - * X-A - * X-B - * - * We assume that pairs of the same lent-type have to be simultainously filled, - * as filling one could make it impossible to fill the other. - * - * -void validate_margin( exchange_state& e ) { - for( const auto& pos : e.margins ) { - token_type min_collat = pos.lent.amount * pos.least_collateralized_rate; - asset received; - e = convert( e, "user", asset{ min_collat, pos.first.collat }, pos.lent, &received ); - FC_ASSERT( received > pos.lent.amount, "insufficient collateral" ); - - received.amount -= pos.lent.amount; - e = convert( e, "user", received, asset{ token_type(0), pos.collateral_symbol} ); - } -} -*/ - - - - - -/** - * A user has Collateral C and wishes to borrow B, so we give user B - * provided that C is enough to buy B back after removing it from market and - * that no margin calls would be triggered. - */ -exchange_state borrow( const exchange_state& current, account_name user, - asset amount_to_borrow, - asset collateral_provided ) { - FC_ASSERT( amount_to_borrow.symbol != collateral_provided.symbol ); - - /// lookup the margin position for user - /// update user's margin position - /// update least collateralized margin position on state - /// remove amount_to_borrow from exchange - /// lock collateral for user - /// simulate complete margin calls - return exchange_state(); -} - -exchange_state cover( const exchange_state& current, account_name user, - asset amount_to_cover, asset collateral_to_cover_with ) -{ - /// lookup existing position for user/debt/collat - /// verify collat > collateral_to_cover_with - /// sell collateral_to_cover_with for debt on market - /// reduce debt by proceeds - /// add proceeds to connector - // - if borrowed from user, reduce borrowed from user - /// calculate new call price and update least collateralized position - /// simulate complete margin calls - return exchange_state(); -} - -exchange_state lend( const exchange_state& current, account_name lender, - asset asset_to_lend ) { - /// add to pool of funds available for lending and buy SHARES in - /// interest pool at current rate. - return exchange_state(); -} - -exchange_state unlend( const exchange_state& current, account_name lender, - asset asset_to_lend ) { - /// sell shares in interest pool at current rate - /// this is permitable so long as total borrowed from users remains less than - /// total available to lend. Otherwise, margin is called on the least - /// collateralized position. - return exchange_state(); -} - - - -void print_state( const exchange_state& e ) { - std::cerr << "\n-----------------------------\n"; - std::cerr << "supply: " << e.supply << "\n"; - std::cerr << "base: " << e.base.balance.amount << " " << e.base.balance.symbol << "\n"; - std::cerr << "quote: " << e.quote.balance.amount << " " << e.quote.balance.symbol << "\n"; - - for( const auto& item : e.output ) { - cerr << item.first.owner << " " << item.second << " " << item.first.symbol << "\n"; - } - std::cerr << "\n-----------------------------\n"; -} - - -int main( int argc, char** argv ) { - // std::cerr << "root: " << double(root.numerator())/root.denominator() << "\n"; - - - exchange_state state; - state.supply = 100000000000ll; - //state.base.weight = state.total_weight / 2.; - state.base.balance.amount = 100000000; - state.base.balance.symbol = "USD"; - state.base.weight = .49; - //state.quote.weight = state.total_weight / 2.; - state.quote.balance.amount = state.base.balance.amount; - state.quote.balance.symbol = "BTC"; - state.quote.weight = .51; - - print_state( state ); - - //state = convert( state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - - auto start = fc::time_point::now(); - for( uint32_t i = 0; i < 10000; ++i ) { - if( rand() % 2 == 0 ) - state = convert( state, "dan", asset{ token_type(uint32_t(rand())%maxtrade), "USD"}, asset{ 0, "BTC" } ); - else - state = convert( state, "dan", asset{ token_type(uint32_t(rand())%maxtrade), "BTC"}, asset{ 0, "USD" } ); - } - for( const auto& item : state.output ) { - if( item.second > 0 ) { - if( item.first.symbol == "USD" ) - state = convert( state, "dan", asset{ item.second, item.first.symbol}, asset{ 0, "BTC" } ); - else - state = convert( state, "dan", asset{ item.second, item.first.symbol}, asset{ 0, "USD" } ); - break; - } - } - print_state( state ); - - auto end = fc::time_point::now(); - wdump((end-start)); - /* - auto new_state = convert( state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 100, "USD"}, asset{ 0, "BTC" } ); - - new_state = convert( new_state, "dan", asset{ 100, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 100, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 100, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 100, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 100, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 100, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 100, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 92.5-0.08-.53, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 100, "BTC"}, asset{ 0, "USD" } ); - */ - - //new_state = convert( new_state, "dan", asset{ 442+487-733+280+349+4.493+62.9, "BTC"}, asset{ 0, "USD" } ); - /* - auto new_state = convert( state, "dan", asset{ 500, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 500, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 442+487, "BTC"}, asset{ 0, "USD" } ); - */ - /* - new_state = convert( new_state, "dan", asset{ 487, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 442, "BTC"}, asset{ 0, "USD" } ); - */ - //new_state = convert( new_state, "dan", asset{ 526, "BTC"}, asset{ 0, "USD" } ); - //new_state = convert( new_state, "dan", asset{ 558, "BTC"}, asset{ 0, "USD" } ); - //new_state = convert( new_state, "dan", asset{ 1746, "BTC"}, asset{ 0, "USD" } ); - /* - new_state = convert( new_state, "dan", asset{ 526, "BTC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 500, "USD"}, asset{ 0, "EXC" } ); - new_state = convert( new_state, "dan", asset{ 500, "BTC"}, asset{ 0, "EXC" } ); - new_state = convert( new_state, "dan", asset{ 10, "EXC"}, asset{ 0, "USD" } ); - new_state = convert( new_state, "dan", asset{ 10, "EXC"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 500, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 500, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 500, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 500, "USD"}, asset{ 0, "BTC" } ); - new_state = convert( new_state, "dan", asset{ 2613, "BTC"}, asset{ 0, "USD" } ); - */ - - - - /* - auto new_state = convert( state, "dan", asset{ 10, "EXC"}, asset{ 0, "USD" } ); - - print_state( new_state ); - - new_state = convert( state, "dan", asset{ 10, "EXC"}, asset{ 0, "BTC" } ); - print_state( new_state ); - new_state = convert( new_state, "dan", asset{ 10, "EXC"}, asset{ 0, "USD" } ); - print_state( new_state ); - - - //new_state = convert( new_state, "dan", asset{ 52, "USD"}, asset{ 0, "EXC" } ); - */ - - return 0; -} - - - -#if 0 - -0. if( margin_fault ) - Convert Least Collateral - if( margin fault )) - defer - -if( margin_fault ) assert( false, "busy calling" ); - -1. Fill Incoming Order -2. Check Counter Order -3. if( margin fault ) - Defer Trx to finish margin call - - -#endif diff --git a/libraries/eosiolib/contracts.dox b/libraries/eosiolib/contracts.dox deleted file mode 100644 index 3bc851b6c56..00000000000 --- a/libraries/eosiolib/contracts.dox +++ /dev/null @@ -1,65 +0,0 @@ -/** - @defgroup contractdev Smart Contract API Reference - @brief Introduction to writing contracts for EOS.IO - - @section background Background - - EOS.IO contracts (aka applications) are deployed to a blockchain as pre-compiled Web Assembly (aka WASM). WASM is compiled - from C/C++ using LLVM and clang, which means that you will require knowledge of C/C++ in order to develop your blockchain - applications. While it is possible to develop in C, we strongly recommend that all developers use the EOS.IO C++ API which - provides much stronger type safety and is generally easier to read. - - @section programstructure Application Structure - - EOS.IO applications are designed around event (aka action) handlers that respond to user actions. For example, - a user might transfer tokens to another user. This event can be processed and potentially rejected by the sender, - the receiver, and the currency application itself. - - As an application developer you get to decide what actions users can take and which handlers may or must be called - in response to those events. - - - @subsection programentry Entry Points - - EOS.IO applications have a `apply` which is like `main` in traditional applications: - - ``` - extern "C" { - void init(); - void apply( uint64_t code, uint64_t action ); - } - ``` - - `apply` is given the arguments `code` and `action` which uniquely identify every event in - the system. For example, `code` could be a *currency* contract and `action` could be *transfer*. This event (code,action) - may be passed to several contracts including the `sender` and `receiver`. It is up to your application to figure - out what to do in response to such an event. - - `init` is another entry point that is called once immediately after loading the code. It is where you should perform - one-time initialization of state. - - -### Example Apply Entry Handler - - Generally speaking, you should use your entry handler to dispatch events to functions that implement the majority - of your logic and optionally reject events that your contract is unable or unwilling to accept. - - ``` - extern "C" { - void apply( uint64_t code, uint64_t action ) { - if( code == N(currency) ) { - if( action == N(transfer) ) - currency::apply_currency_transfer( current_action< currency::transfer >() ); - } else { - eosio_assert( false, "rejecting unexpected event" ); - } - } - } - ``` - - @note When defining your entry points it is required that they are placed in an `extern "C"` code block so that - c++ name mangling does not get applied to the function. - - - -*/ diff --git a/libraries/eosiolib/currency.hpp b/libraries/eosiolib/currency.hpp deleted file mode 100644 index d71268d2584..00000000000 --- a/libraries/eosiolib/currency.hpp +++ /dev/null @@ -1,254 +0,0 @@ -#pragma once -#include -#include -#include - -namespace eosio { - using std::string; - using std::array; - - /** - * This contract enables the creation, issuance, and transfering of many different tokens. - * @deprecated This class is deprecated in favor of eosio.token in Dawn 3.0 - */ - class currency { - public: - currency( account_name contract ) - :_contract(contract) - { } - - struct create { - account_name issuer; - asset maximum_supply; - // array issuer_agreement_hash; - uint8_t issuer_can_freeze = true; - uint8_t issuer_can_recall = true; - uint8_t issuer_can_whitelist = true; - - /*(issuer_agreement_hash)*/ - EOSLIB_SERIALIZE( create, (issuer)(maximum_supply)(issuer_can_freeze)(issuer_can_recall)(issuer_can_whitelist) ) - }; - - struct transfer - { - account_name from; - account_name to; - asset quantity; - string memo; - - EOSLIB_SERIALIZE( transfer, (from)(to)(quantity)(memo) ) - }; - - struct issue { - account_name to; - asset quantity; - string memo; - - EOSLIB_SERIALIZE( issue, (to)(quantity)(memo) ) - }; - - struct fee_schedule { - uint64_t primary_key()const { return 0; } - - array fee_per_length; - EOSLIB_SERIALIZE( fee_schedule, (fee_per_length) ) - }; - - struct account { - asset balance; - bool frozen = false; - bool whitelist = true; - - uint64_t primary_key()const { return balance.symbol.name(); } - - EOSLIB_SERIALIZE( account, (balance)(frozen)(whitelist) ) - }; - - struct currency_stats { - asset supply; - asset max_supply; - account_name issuer; - bool can_freeze = true; - bool can_recall = true; - bool can_whitelist = true; - bool is_frozen = false; - bool enforce_whitelist = false; - - uint64_t primary_key()const { return supply.symbol.name(); } - - EOSLIB_SERIALIZE( currency_stats, (supply)(max_supply)(issuer)(can_freeze)(can_recall)(can_whitelist)(is_frozen)(enforce_whitelist) ) - }; - - typedef eosio::multi_index accounts; - typedef eosio::multi_index stats; - - - asset get_balance( account_name owner, symbol_name symbol )const { - accounts t( _contract, owner ); - return t.get(symbol).balance; - } - - asset get_supply( symbol_name symbol )const { - accounts t( _contract, symbol ); - return t.get(symbol).balance; - } - - static void inline_transfer( account_name from, account_name to, extended_asset amount, string memo = string(), permission_name perm = N(active) ) { - action act( permission_level( from, perm ), amount.contract, N(transfer), transfer{from,to,amount.quantity,memo} ); - act.send(); - } - - void inline_transfer( account_name from, account_name to, asset amount, string memo = string(), permission_name perm = N(active) ) { - action act( permission_level( from, perm ), _contract, N(transfer), transfer{from,to,amount,memo} ); - act.send(); - } - - - bool apply( account_name contract, action_name act ) { - if( contract != _contract ) - return false; - - switch( act ) { - case N(issue): - print( "issue\n"); - on( unpack_action_data() ); - return true; - case N(transfer): - print( "transfer\n"); - on( unpack_action_data() ); - return true; - case N(create): - print( "create\n"); - on( unpack_action_data() ); - return true; - } - return false; - } - - /** - * This is factored out so it can be used as a building block - */ - void create_currency( const create& c ) { - auto sym = c.maximum_supply.symbol; - eosio_assert( sym.is_valid(), "invalid symbol name" ); - - stats statstable( _contract, sym.name() ); - auto existing = statstable.find( sym.name() ); - eosio_assert( existing == statstable.end(), "token with symbol already exists" ); - - statstable.emplace( c.issuer, [&]( auto& s ) { - s.supply.symbol = c.maximum_supply.symbol; - s.max_supply = c.maximum_supply; - s.issuer = c.issuer; - s.can_freeze = c.issuer_can_freeze; - s.can_recall = c.issuer_can_recall; - s.can_whitelist = c.issuer_can_whitelist; - }); - } - - void issue_currency( const issue& i ) { - auto sym = i.quantity.symbol.name(); - stats statstable( _contract, sym ); - const auto& st = statstable.get( sym ); - - statstable.modify( st, 0, [&]( auto& s ) { - s.supply.amount += i.quantity.amount; - eosio_assert( s.supply.amount >= 0, "underflow" ); - }); - - add_balance( st.issuer, i.quantity, st, st.issuer ); - } - - - void on( const create& c ) { - require_auth( c.issuer ); - create_currency( c ); - - /* - auto fee = get_fee_schedule()[c.maximum_supply.name_length()]; - if( fee.amount > 0 ) { - inline_transfer( c.issuer, _contract, fee, "symbol registration fee" ); - } - */ - } - - void on( const issue& i ) { - auto sym = i.quantity.symbol.name(); - stats statstable( _contract, sym ); - const auto& st = statstable.get( sym ); - - require_auth( st.issuer ); - eosio_assert( i.quantity.is_valid(), "invalid quantity" ); - eosio_assert( i.quantity.amount > 0, "must issue positive quantity" ); - - statstable.modify( st, 0, [&]( auto& s ) { - s.supply.amount += i.quantity.amount; - }); - - add_balance( st.issuer, i.quantity, st, st.issuer ); - - if( i.to != st.issuer ) - { - inline_transfer( st.issuer, i.to, i.quantity, i.memo ); - } - } - - void on( const transfer& t ) { - require_auth(t.from); - auto sym = t.quantity.symbol.name(); - stats statstable( _contract, sym ); - const auto& st = statstable.get( sym ); - - require_recipient( t.to ); - - eosio_assert( t.quantity.is_valid(), "invalid quantity" ); - eosio_assert( t.quantity.amount > 0, "must transfer positive quantity" ); - sub_balance( t.from, t.quantity, st ); - add_balance( t.to, t.quantity, st, t.from ); - } - - - private: - void sub_balance( account_name owner, asset value, const currency_stats& st ) { - accounts from_acnts( _contract, owner ); - - const auto& from = from_acnts.get( value.symbol.name() ); - eosio_assert( from.balance.amount >= value.amount, "overdrawn balance" ); - - if( has_auth( owner ) ) { - eosio_assert( !st.can_freeze || !from.frozen, "account is frozen by issuer" ); - eosio_assert( !st.can_freeze || !st.is_frozen, "all transfers are frozen by issuer" ); - eosio_assert( !st.enforce_whitelist || from.whitelist, "account is not white listed" ); - } else if( has_auth( st.issuer ) ) { - eosio_assert( st.can_recall, "issuer may not recall token" ); - } else { - eosio_assert( false, "insufficient authority" ); - } - - from_acnts.modify( from, owner, [&]( auto& a ) { - a.balance.amount -= value.amount; - }); - } - - void add_balance( account_name owner, asset value, const currency_stats& st, account_name ram_payer ) - { - accounts to_acnts( _contract, owner ); - auto to = to_acnts.find( value.symbol.name() ); - if( to == to_acnts.end() ) { - eosio_assert( !st.enforce_whitelist, "can only transfer to white listed accounts" ); - to_acnts.emplace( ram_payer, [&]( auto& a ){ - a.balance = value; - }); - } else { - eosio_assert( !st.enforce_whitelist || to->whitelist, "receiver requires whitelist by issuer" ); - to_acnts.modify( to, 0, [&]( auto& a ) { - a.balance.amount += value.amount; - }); - } - } - - private: - account_name _contract; - }; - -} diff --git a/libraries/eosiolib/mainpage.md b/libraries/eosiolib/mainpage.md deleted file mode 100644 index e9c9d0cd8a6..00000000000 --- a/libraries/eosiolib/mainpage.md +++ /dev/null @@ -1,20 +0,0 @@ -Welcome to the EOS.IO Documentation ------------------------------------ - -@note This documentation is in progress and subject to change due to rapid development. Please report inaccuracies identified to the [EOS.IO Developer Telegram Group](https://t.me/joinchat/EaEnSUPktgfoI-XPfMYtcQ) - -## EOS.IO - - [Additional resources - Github Readme](https://github.com/EOSIO/eos#readme) - -## Smart Contract Developers -- @ref eosiorpc -- @ref contractdev - - @ref chainapi - Define API for querying internal chain state - - @ref database - APIs that store and retreive data on the blockchainEOS.IO organizes data according to the following broad structure - - @ref actionapi - Defines API for querying action properties - - @ref consoleapi - Enables applications to log/print text messages - - @ref systemapi - Define API for interating with system level intrinsics - - @ref transactionapi - Define API for sending transactions and inline messages - - @ref types - Specifies typedefs and aliases - - diff --git a/libraries/eosiolib/rpc.dox b/libraries/eosiolib/rpc.dox deleted file mode 100644 index 047250276eb..00000000000 --- a/libraries/eosiolib/rpc.dox +++ /dev/null @@ -1,544 +0,0 @@ -/** -@defgroup eosiorpc RPC Interface -@brief Describes how to interface with eosd over HTTP RPC - -@section tableofcontent Table Of Contents -- [Configuration](#configuration) -- [Chain API](#chainrpc) - - [get_info](#v1chaingetinfo) - - [get_block](#v1chaingetblock) - - [get_account](#v1chaingetaccount) - - [get_code](#v1chaingetcode) - - [get_table_rows](#v1chaingettablerows) - - [abi_json_to_bin](#v1chainabijsontobin) - - [abi_bin_to_json](#v1chainabibintojson) - - [push_transaction](#v1chainpushtransaction) - - [push_transactions](#v1chainpushtransactions) - - [get_required_keys](#v1chaingetrequiredkeys) -- [Wallet API](#walletrpc) - - [wallet_create](#v1walletcreate) - - [wallet_open](#v1walletopen) - - [wallet_lock](#v1walletlock) - - [wallet_lock_all](#v1walletlockall) - - [wallet_import_key](#v1walletimportkey) - - [wallet_list](#v1walletlist) - - [wallet_list_keys](#v1walletlistkeys) - - [wallet_get_public_keys](#v1walletgetpublickeys) - - [wallet_set_timeout](#v1walletsettimeout) - - [wallet_sign_trx](#v1walletsigntrx) - -@section configuration Configuration - -`eosd` uses a REST RPC interface where plugins can register their own endpoints with the API server. This page -will explain how to use some of the APIs to get information about the blockchain and send transactions. - -Before you can query `eosd` you must first enable the necessary API plugin(s). Depending on which API you want to enable, add the following line to your `eosd`'s `config.ini`: -``` -plugin = eosio::chain_api_plugin // Enable Chain API -plugin = eosio::wallet_api_plugin // Enable Wallet API -``` -Alternatively, for Wallet API, you can also have the wallet functionality separate from `eosd`, by running `eos-walletd` separately. - -For the following guide, we will assume that we have `eosd` running on `127.0.0.1:8888` (Chain API Plugin enabled, Wallet API Plugin disabled) and `eos-walletd` running on `127.0.0.1:8889`. - -=== - -@section chainrpc Chain API - - -@subsection v1chaingetinfo get_info - -Get latest information related to a node - -@subsubsection examplegetinfo Example get_info Usage - -``` -curl http://127.0.0.1:8888/v1/chain/get_info -``` - -@subsubsection examplegetinforesult Example get_info Result - -``` -{ - "server_version": "b2eb1667", - "head_block_num": 259590, - "last_irreversible_block_num": 259573, - "head_block_id": "0003f60677f3707f0704f16177bf5f007ebd45eb6efbb749fb1c468747f72046", - "head_block_time": "2017-12-10T17:05:36", - "head_block_producer": "initp", - "recent_slots": "1111111111111111111111111111111111111111111111111111111111111111", - "participation_rate": "1.00000000000000000" -} -``` - -@subsection v1chaingetblock get_block - -Get information related to a block. - -@subsubsection examplegetblock Example get_block Usage -``` -$ curl http://127.0.0.1:8888/v1/chain/get_block -X POST -d '{"block_num_or_id":5}' -$ curl http://127.0.0.1:8888/v1/chain/get_block -X POST -d '{"block_num_or_id":0000000445a9f27898383fd7de32835d5d6a978cc14ce40d9f327b5329de796b}' -``` - -@subsubsection examplegetblockresult Example get_block Result -``` -{ - "previous": "0000000445a9f27898383fd7de32835d5d6a978cc14ce40d9f327b5329de796b", - "timestamp": "2017-07-18T20:16:36", - "transaction_merkle_root": "0000000000000000000000000000000000000000000000000000000000000000", - "producer": "initf", - "producer_changes": [ ], - "producer_signature": "204cb94b3186c3b4a7f88be4e9db9f8af2ffdb7ef0f27a065c8177a5fcfacf876f684e59c39fb009903c0c59220b147bb07f1144df1c65d26c57b534a76dd29073", - "cycles": [ ], - "id":"000000050c0175cbf218a70131ddc3c3fab8b6e954edef77e0bfe7c36b599b1d", - "block_num":5, - "ref_block_prefix":27728114 -} -``` - - -@subsection v1chaingetaccount get_account - -Get information related to an account. - -@subsubsection examplegetaccount Example get_account Usage -``` -$ curl http://127.0.0.1:8888/v1/chain/get_account -X POST -d '{"account_name":"inita"}' -``` - -@subsubsection examplegetaccountresult Example get_account Result -``` -{ - "name": "inita", - "eos_balance": "999998.9574 EOS", - "staked_balance": "0.0000 EOS", - "unstaking_balance": "0.0000 EOS", - "last_unstaking_time": "2106-02-07T06:28:15", - "permissions": [ - { - "name": "active", - "parent": "owner", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "weight": 1 - } - ], - "accounts": [] - } - }, - { - "name": "owner", - "parent": "owner", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "weight": 1 - } - ], - "accounts": [] - } - } - ] -} -``` - - -@subsection v1chaingetcode get_code - -Fetch smart contract code. - -@subsubsection examplegetcode Example get_code Usage -``` -$ curl http://127.0.0.1:8888/v1/chain/get_code -X POST -d '{"account_name":"currency"}' -``` - -@subsubsection examplegetcoderesult Example get_code Result -``` -{ - "name":"currency", - "code_hash":"a1c8c84b4700c09c8edb83522237439e33cf011a4d7ace51075998bd002e04c9", - "wast":"(module\n (type $0 (func (param i64 i64 i32) (result i32)))\n ...truncated", - "abi": { - "types": [{ - "new_type_name": "account_name", - "type": "name" - } - ], - "structs": [{ - "name": "transfer", - "base": "", - "fields": [ - {"name":"from", "type":"account_name"}, - {"name":"to", "type":"account_name"}, - {"name":"quantity", "type":"uint64"} - ] - },{ - "name": "account", - "base": "", - "fields": [ - {"name":"key", "type":"name"}, - {"name":"balance", "type":"uint64"} - ] - } - ], - "actions": [{ - "name": "transfer", - "type": "transfer" - } - ], - "tables": [{ - "name": "account", - "type": "account", - "index_type": "i64", - "key_names" : ["key"], - "key_types" : ["name"] - } - ] -} -``` - - -@subsection v1chaingettablerows get_table_rows - -Fetch smart contract data from an account. - -@subsubsection examplegettablerows get_table_rows Usage -``` -$ curl http://127.0.0.1:8888/v1/chain/get_table_rows -X POST -d '{"scope":"inita", "code":"currency", "table":"account", "json": true}' -$ curl http://127.0.0.1:8888/v1/chain/get_table_rows -X POST -d '{"scope":"inita", "code":"currency", "table":"account", "json": true, "lower_bound":0, "upper_bound":-1, "limit":10}' -``` - -@subsubsection examplegettablerowsresult Example get_table_rows Result -``` -{ - "rows": [ - { - "account": "account", - "balance": 1000 - } - ], - "more": false -} -``` - - -@subsection v1chaingeabijsontobin abi_json_to_bin - -Serialize json to binary hex. The resulting binary hex is usually used for the data field in [push_transaction](#v1chainpushtransaction). - -@subsubsection exampleabijsontobin Example abi_json_to_bin Usage -``` -$ curl http://127.0.0.1:8888/v1/chain/abi_json_to_bin -X POST -d '{"code":"currency", "action":"transfer", "args":{"from":"initb", "to":"initc", "quantity":1000}}' -``` - -@subsubsection exampleabijsontobinresult Example abi_json_to_bin Result -``` -{ - "binargs": "000000008093dd74000000000094dd74e803000000000000", - "required_scope": [], - "required_auth": [] -} -``` - - -@subsection v1chaingeabibintojson abi_bin_to_json - -Serialize back binary hex to json. - -@subsubsection exampleabibintojson Example abi_bin_to_json Usage -``` -$ curl http://127.0.0.1:8888/v1/chain/abi_bin_to_json -X POST -d '{"code":"currency", "action":"transfer", "binargs":"000000008093dd74000000000094dd74e803000000000000"}' -``` - -@subsubsection exampleabibintojsonresult Example abi_bin_to_json Result -``` -{ - "args": { - "from": "initb", - "to": "initc", - "quantity": 1000 - }, - "required_scope": [], - "required_auth": [] -} -``` - - -@subsection v1chainpushtransaction push_transaction - -This method expects a transaction in JSON format and will attempt to apply it to the blockchain, - -Success Response -

-On success it will return HTTP 200 and the transaction ID. -

- -``` - -{ - 'transaction_id' : "..." -} - - -``` - -Just because the transaction is pushed locally does not mean that the transaction has been incorporated into a block. - - -Error Response -

-If an error occurs it will return either HTTP 400 (Invalid arguments) or 500 (Internal Server Error) -

- -``` - -HTTP/1.1 500 Internal Server Error -Content-Length: 1466 - -...error message... - -``` - -@subsubsection examplepushtrx Example push_transaction Usage -This example assumes a transfer operation. The `ref_block_num` and `ref_block_prefix` here are provided as a result of `/v1/chain/get_block` of the last_irreversible_block. -You also need to use /v1/wallet/sign_transaction to get the right signature. -``` -curl http://localhost:8888/v1/chain/push_transaction -X POST -d '{"ref_block_num":"100","ref_block_prefix":"137469861","expiration":"2017-09-25T06:28:49","scope":["initb","initc"],"actions":[{"code":"currency","type":"transfer","recipients":["initb","initc"],"authorization":[{"account":"initb","permission":"active"}],"data":"000000000041934b000000008041934be803000000000000"}],"signatures":[],"authorizations":[]}' -``` - - -@subsection v1chainpushtransactions push_transactions - -This method push multiple transactions at once. - -@subsubsection examplepushtrxs Example push_transactions Usage -``` -curl http://localhost:8888/v1/chain/push_transaction -X POST -d '[{"ref_block_num":"101","ref_block_prefix":"4159312339","expiration":"2017-09-25T06:28:49","scope":["initb","initc"],"actions":[{"code":"currency","type":"transfer","recipients":["initb","initc"],"authorization":[{"account":"initb","permission":"active"}],"data":"000000000041934b000000008041934be803000000000000"}],"signatures":[],"authorizations":[]}, {"ref_block_num":"101","ref_block_prefix":"4159312339","expiration":"2017-09-25T06:28:49","scope":["inita","initc"],"actions":[{"code":"currency","type":"transfer","recipients":["inita","initc"],"authorization":[{"account":"inita","permission":"active"}],"data":"000000008040934b000000008041934be803000000000000"}],"signatures":[],"authorizations":[]}]' -``` - - -@subsection v1chaingetrequiredkeys get_required_keys - -Get required keys to sign a transaction from list of your keys. - -@subsubsection examplegetrequiredkeys Example get_required_keys Usage -``` -curl http://localhost:8888/v1/chain/get_required_keys -X POST -d '{"transaction": {"ref_block_num":"100","ref_block_prefix":"137469861","expiration":"2017-09-25T06:28:49","scope":["initb","initc"],"actions":[{"code":"currency","type":"transfer","recipients":["initb","initc"],"authorization":[{"account":"initb","permission":"active"}],"data":"000000000041934b000000008041934be803000000000000"}],"signatures":[],"authorizations":[]}, "available_keys":["EOS4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq","EOS7d9A3uLe6As66jzN8j44TXJUqJSK3bFjjEEqR4oTvNAB3iM9SA","EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"]}' -``` - -@subsubsection examplegetrequiredkeysresult Example get_required_keys Result -``` -{ - "required_keys": [ - "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - ] -} -``` - -@section walletrpc Wallet API - -@subsection v1walletcreate wallet_create - -Create a new wallet with the given name - -@subsubsection examplewalletcreate Example wallet_create Usage -``` -$ curl http://localhost:8888/v1/wallet/create -X POST -d '"default"' -``` - -@subsubsection examplewalletcreateresult Example wallet_create Result -This command will return the password that can be used to unlock the wallet in the future -``` -PW5KFWYKqvt63d4iNvedfDEPVZL227D3RQ1zpVFzuUwhMAJmRAYyX -``` - -@subsection v1walletcreatekey wallet_create_key - -Creates a key within the specified wallet, wallet must be opened and unlocked. -Param are: 1.name of the wallet to create key in; 2. type of key to create, currently we support two values: K1 and R1 - -@subsubsection examplewalletcreatekey Example wallet_create_key Usage -``` -$ curl http://localhost:8888/v1/wallet/create_key -X POST -d '["default","K1"]' -``` - -@subsubsection examplewalletcreatekeyresult Example wallet_create_key Result -This command will return the public key of the created key -``` -EOS6GZE1xeo6jX2AtP2Z6WTcxawQMH7cyYMNpG6Q3q7s514zyRhgo -``` - -@subsection v1walletopen wallet_open - -Open an existing wallet of the given name - -@subsubsection examplewalletopen Example wallet_open Usage -``` -$ curl http://localhost:8888/v1/wallet/open -X POST -d '"default"' -``` - -@subsubsection examplewalletopenresult Example wallet_open Result -``` -{} -``` - - -@subsection v1walletlock wallet_lock - -Lock a wallet of the given name - -@subsubsection examplewalletlock Example wallet_lock Usage -``` -$ curl http://localhost:8888/v1/wallet/lock -X POST -d '"default"' -``` - -@subsubsection examplewalletlockresult Example wallet_lock Result -``` -{} -``` - - -@subsection v1walletlockall wallet_lock_all - -Lock all wallets - -@subsubsection examplewalletlockall Example wallet_lock_all Usage -``` -$ curl http://localhost:8888/v1/wallet/lock_all -``` - -@subsubsection examplewalletlockallresult Example wallet_lock_all Result -``` -{} -``` - -@subsection v1walletunlock wallet_unlock - -Unlock a wallet with the given name and password - -@subsubsection examplewalletunlock Example wallet_unlock Usage -``` -$ curl http://localhost:8888/v1/wallet/unlock -X POST -d '["default", "PW5KFWYKqvt63d4iNvedfDEPVZL227D3RQ1zpVFzuUwhMAJmRAYyX"]' -``` - -@subsubsection examplewalletunlockresult Example wallet_unlock Result -``` -{} -``` - -@subsection v1walletimport wallet_import_key - -Import a private key to the wallet of the given name - -@subsubsection examplewalletimport Example wallet_import_key Usage -``` -$ curl http://localhost:8888/v1/wallet/import_key -X POST -d '["default","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]' -``` - -@subsubsection examplewalletimportresult Example wallet_import_key Result -``` -{} -``` - -@subsection v1walletlist wallet_list - -List all wallets - -@subsubsection examplewalletlist Example wallet_list Usage -``` -$ curl http://localhost:8888/v1/wallet/list_wallets -``` - -@subsubsection examplewalletlistresult Example wallet_list Result -``` -["default *"] -``` - -@subsection v1walletlistkeys wallet_list_keys - -List all key pairs across all wallets - -@subsubsection examplewalletlistkeys Example wallet_list_keys Usage -``` -$ curl http://localhost:8888/v1/wallet/list_keys -``` - -@subsubsection examplewalletlistkeysresult Example wallet_list_keys Result -``` -[["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]] -``` - -@subsection v1walletgetpublickeys wallet_get_public_keys - -List all public keys across all wallets - -@subsubsection examplewalletgetpublickeys Example wallet_get_public_keys Usage -``` -$ curl http://localhost:8888/v1/wallet/get_public_keys -``` - -@subsubsection examplewallegetpublickeysresult Example wallet_get_public_keys Result -``` -["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"] -``` - -@subsection v1walletsettimeout wallet_set_timeout - -Set wallet auto lock timeout (in seconds) - -@subsubsection examplewalletsettimeout Example wallet_set_timeout Usage -``` -$ curl http://localhost:8888/v1/wallet/set_timeout -X POST -d '10' -``` - -@subsubsection examplewalletsettimeoutresult Example wallet_set_timeout Result -``` -{} -``` - -@subsection v1walletsigntrx wallet_sign_trx - -Sign transaction given an array of transaction, require public keys, and chain id - -@subsubsection examplewalletsigntrx Example wallet_sign_trx Usage -``` -$ curl http://localhost:8888/v1/wallet/sign_transaction -X POST -d '[{"ref_block_num":21453,"ref_block_prefix":3165644999,"expiration":"2017-12-08T10:28:49","scope":["initb","initc"],"read_scope":[],"messages":[{"code":"currency","type":"transfer","authorization":[{"account":"initb","permission":"active"}],"data":"000000008093dd74000000000094dd74e803000000000000"}],"signatures":[]}, ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"], ""]' -``` - -@subsubsection examplewalletsigntrxresult Example wallet_sign_trx Result -``` -{ - "ref_block_num": 21453, - "ref_block_prefix": 3165644999, - "expiration": "2017-12-08T10:28:49", - "scope": [ - "initb", - "initc" - ], - "read_scope": [], - "messages": [ - { - "code": "currency", - "type": "transfer", - "authorization": [ - { - "account": "initb", - "permission": "active" - } - ], - "data": "000000008093dd74000000000094dd74e803000000000000" - } - ], - "signatures": [ - "1f393cc5ce6a6951fb53b11812345bcf14ffd978b07be386fd639eaf440bca7dca16b14833ec661ca0703d15e55a2a599a36d55ce78c4539433f6ce8bcee0158c3" - ] -} -``` - -*/ From 816dce83947beddbba32498bf38fb193c92ef73c Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 30 Aug 2018 11:39:21 -0400 Subject: [PATCH 18/38] Update README.md --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 152e0781f29..382ad7c6178 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,13 @@ $ eosio-cpp hello.cpp -o hello.wasm - Then create a build directory ```mkdir build``` and cd into that directory ```cd build``` - Then run ```cmake ../```, this will generate the cache and supporting files for CMake to do it's job. - Now simply run ```make```. -- You should now have a `hello` file in the build directory, this is the wasm file, if you'd like to change the name to have the .wasm extension that is perfectly fine, or you can change the add_executable target name to ```hello.wasm```, or simply use cleos to set code the ```hello``` file. +- You should now have a `hello` file in the build directory, this is the wasm file, if you would like to use ```cleos set contract``` and you need to change the name to have the .wasm extension that is perfectly fine, or you can change the add_executable target name to ```hello.wasm```, or you can use ```cleos set code /hello``` to load the file to the blockchain , without the .wasm extension. -### Writing an ABI +### Fixing an ABI, or Writing an ABI - The sections to the abi are pretty simple to understand and the syntax is purely JSON, so we are going to write our own ABI file. - Even after ABI generation is available, an important note should be made that the generator will never be completely perfect for every contract written, advanced features of the newest version of the ABI will require manual construction of the ABI, and odd and advanced C++ patterns could capsize the generators type deductions, so having a good knowledge of how to write an ABI should be an essential piece of knowledge of a smart contract writer. -#### The General Structure of An ABI +- For more in-depth documentation please refer to [developers.eos.io "How to write an abi"](https://developers.eos.io/eosio-cpp/docs/how-to-write-an-abi) +#### A Simplified View of The Structure of An ABI ```json { "version": "eosio::abi/1.0", @@ -98,7 +99,7 @@ $ eosio-cpp hello.cpp -o hello.wasm - If in your smart contract you would like to use a `typedef` of some type to another, simply add those to here. Where `new_type_name` is the new type name and `type` is simply what you are aliasing from. ##### abi structure :: structs - ```structs``` is a JSON array of objects, where each object has three fields ( `name`, `base` and `fields` ) -- If in your smart contract you create a new structure that is not one supplied by `eosiolib`, we are going to express that here. Some confusion will ultimately arise if using the `EOSIO_ABI` macro and the method style of writing your actions, because they go here too. +- If in your smart contract you create a new structure that is not one supplied by `eosiolib`, we are going to express that here. Some confusion will ultimately arise if using the `EOSIO_ABI` macro and the method style of writing your actions, [developers.eos.io "The ABI Macro & Apply"](https://developers.eos.io/eosio-cpp/docs/abi) and ["Creating an Action"](https://developers.eos.io/eosio-cpp/docs/this-does-not-exist), because the implicitly generated ```action``` class will go here too. - `name` is the stripped name of the struct/class (i.e. no namespaces, just the name of the class), if using the method style, this is the name of the method. - `base` is what class that class inherits from (same thing only the stripped name), or "" if it doesn't inherit from any class. For the method style this is always "". - `fields` is a JSON array of objects with two fields (`name` and `type`), these express the fields of the class we are referencing. For the method approach, these will be the arguments to your method. @@ -110,11 +111,11 @@ $ eosio-cpp hello.cpp -o hello.wasm - `ricardian_contract` is a plain text contract that is cryptographically linked to each action, the full explanation of this is way beyond the scope of this readme. ##### abi structure :: tables - ```tables``` is a JSON array of objects, where each object has five fields (`name`, `type`, `index_type`, `key_names`, `key_types`) -- `name` is the name of the table that is given the multi_index typedef. +- `name` is the name of the table that is given the multi_index typedef, this will be the name that is used by the ```get_table_rows``` RPC and by ```cleos get table``` command. - `type` is the struct/class type name that is being used as the table. - `index_type` is always "i64", this is a holdover and will be deprecated. -- `key_names` is a JSON array of strings and is the name of the variable of primary key followed by the name any secondary tables (indexed_by name given with mulit_index typedef) -- `key_types` is a JSON array of strings and is the type name associated with each element in `key_names` (the first element should always be uint64, as we only support i64 primary keys). +- `key_names` is a JSON array of strings and is the name of the variable of primary key, this will be deprecated. +- `key_types` is a JSON array of strings and is the type name associated with each element in `key_names`, this will be deprecated. ##### abi structure :: ricardian_clauses - ```ricardian_clauses``` is a JSON array of objects, where each object has two fields (`id` and `body`) - `id` is an identifier you would like to use with that clause @@ -147,7 +148,7 @@ project(test_example VERSION 1.0.0) if(EOSIO_WASMSDK_ROOT STREQUAL "" OR NOT EOSIO_WASMSDK_ROOT) set(EOSIO_WASMSDK_ROOT "/usr/local/eosio.wasmsdk") endif() -list(APPEND CMAKE_MODULE_PATH ${WASM_ROOT}/lib/cmake) +list(APPEND CMAKE_MODULE_PATH ${EOSIO_WASMSDK_ROOT}/lib/cmake) include(EosioWasmToolchain) add_executable( test.wasm test.cpp ) From 0926e9c01219658a9cabda40a595ac8c3b1b93e9 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 30 Aug 2018 17:44:11 -0400 Subject: [PATCH 19/38] updating for abigenerator --- InstallClang.txt | 3 +++ build.sh | 10 ++++++++-- eosio_llvm | 2 +- examples/hello/CMakeLists.txt | 2 +- install.sh | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/InstallClang.txt b/InstallClang.txt index 05f3eb260c1..2be0e61ed28 100644 --- a/InstallClang.txt +++ b/InstallClang.txt @@ -48,6 +48,9 @@ install(FILES ${CLANG_BIN_DIR}/eosio-cpp install(FILES ${CLANG_BIN_DIR}/eosio-ld DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +install(FILES ${CLANG_BIN_DIR}/eosio-abigen + DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(FILES ${CLANG_BIN_DIR}/../lib/LLVMEosioApply${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) install(CODE " diff --git a/build.sh b/build.sh index a752021bcb4..050155d68e3 100755 --- a/build.sh +++ b/build.sh @@ -58,10 +58,16 @@ if [ $# -ge 1 ]; then CORE_SYMBOL=$1 fi +if [[ `uname` == 'Darwin' ]]; then + FREE_MEM=`vm_stat | grep "Pages free:"` + read -ra FREE_MEM <<< "$FREE_MEM" + FREE_MEM=$((${FREE_MEM[2]%?}*(4096))) # free pages * page size +else + FREE_MEM=`free | grep "Mem:" | awk '{print $4}'` +fi CORES_AVAIL=`getconf _NPROCESSORS_ONLN` -FREE_MEM=`free | grep "Mem:" | awk '{print $4}'` -MEM_CORES=$(( ${FREE_MEM}/4000000 )) # 4 gigabytes per core +MEM_CORES=$(( ${FREE_MEM}/(4000000) )) # 4 gigabytes per core CORES=$(( $CORES_AVAIL < $MEM_CORES ? $CORES_AVAIL : $MEM_CORES )) mkdir -p build diff --git a/eosio_llvm b/eosio_llvm index d96b484e2ff..c43645c50f1 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit d96b484e2ffae6b8e94d3a8fa32a8b133815be23 +Subproject commit c43645c50f1b85c424750207acb884a1ed26301b diff --git a/examples/hello/CMakeLists.txt b/examples/hello/CMakeLists.txt index 7ac7e434e4f..d8f01554cf8 100644 --- a/examples/hello/CMakeLists.txt +++ b/examples/hello/CMakeLists.txt @@ -3,7 +3,7 @@ project(hello_example VERSION 1.0.0) # if no wasm root is given use default path if(EOSIO_WASMSDK_ROOT STREQUAL "" OR NOT EOSIO_WASMSDK_ROOT) - set(EOSIO_WASMSDK_ROOT ${CMAKE_INSTALL_PREFIX}) + set(EOSIO_WASMSDK_ROOT ${CMAKE_INSTALL_PREFIX}/eosio.wasmsdk) endif() # append the path to the module to include diff --git a/install.sh b/install.sh index 8f7f5ad069a..8c89e6ff3e4 100755 --- a/install.sh +++ b/install.sh @@ -63,6 +63,7 @@ create_symlink "eosio-cpp eosio-cpp" create_symlink "eosio-ld eosio-ld" create_symlink "eosio-pp eosio-pp" + create_symlink "eosio-abigen eosio-abigen" create_symlink "wasm2wat eosio-wasm2wast" create_symlink "wat2wasm eosio-wast2wasm" } From 25f9d8395228fd54f4b348e67d37093109ff95c8 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 30 Aug 2018 18:35:30 -0400 Subject: [PATCH 20/38] remove build folder --- examples/abigen_test/build/CMakeCache.txt | 352 ---------- .../CMakeFiles/3.12.0/CMakeCCompiler.cmake | 73 -- .../CMakeFiles/3.12.0/CMakeCXXCompiler.cmake | 76 --- .../3.12.0/CMakeDetermineCompilerABI_C.bin | Bin 4304 -> 0 bytes .../3.12.0/CMakeDetermineCompilerABI_CXX.bin | Bin 4288 -> 0 bytes .../build/CMakeFiles/3.12.0/CMakeSystem.cmake | 15 - .../3.12.0/CompilerIdC/CMakeCCompilerId.c | 623 ------------------ .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 602 ----------------- .../CMakeDirectoryInformation.cmake | 16 - .../build/CMakeFiles/CMakeOutput.log | 532 --------------- .../build/CMakeFiles/Makefile.cmake | 52 -- .../abigen_test/build/CMakeFiles/Makefile2 | 113 ---- .../build/CMakeFiles/TargetDirectories.txt | 3 - .../build/CMakeFiles/cmake.check_cache | 1 - .../build/CMakeFiles/feature_tests.bin | Bin 8376 -> 0 bytes .../build/CMakeFiles/feature_tests.c | 34 - .../build/CMakeFiles/feature_tests.cxx | 405 ------------ .../build/CMakeFiles/progress.marks | 1 - .../abigen_test/build/CMakeFiles/test.abi | 106 --- .../CMakeFiles/test.wasm.dir/CXX.includecache | 12 - .../CMakeFiles/test.wasm.dir/DependInfo.cmake | 20 - .../build/CMakeFiles/test.wasm.dir/build.make | 98 --- .../test.wasm.dir/cmake_clean.cmake | 10 - .../CMakeFiles/test.wasm.dir/depend.internal | 5 - .../CMakeFiles/test.wasm.dir/depend.make | 5 - .../build/CMakeFiles/test.wasm.dir/flags.make | 10 - .../build/CMakeFiles/test.wasm.dir/link.txt | 1 - .../CMakeFiles/test.wasm.dir/progress.make | 3 - examples/abigen_test/build/Makefile | 178 ----- .../abigen_test/build/cmake_install.cmake | 44 -- examples/abigen_test/build/test.wasm | Bin 2745 -> 0 bytes 31 files changed, 3390 deletions(-) delete mode 100644 examples/abigen_test/build/CMakeCache.txt delete mode 100644 examples/abigen_test/build/CMakeFiles/3.12.0/CMakeCCompiler.cmake delete mode 100644 examples/abigen_test/build/CMakeFiles/3.12.0/CMakeCXXCompiler.cmake delete mode 100755 examples/abigen_test/build/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_C.bin delete mode 100755 examples/abigen_test/build/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_CXX.bin delete mode 100644 examples/abigen_test/build/CMakeFiles/3.12.0/CMakeSystem.cmake delete mode 100644 examples/abigen_test/build/CMakeFiles/3.12.0/CompilerIdC/CMakeCCompilerId.c delete mode 100644 examples/abigen_test/build/CMakeFiles/3.12.0/CompilerIdCXX/CMakeCXXCompilerId.cpp delete mode 100644 examples/abigen_test/build/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 examples/abigen_test/build/CMakeFiles/CMakeOutput.log delete mode 100644 examples/abigen_test/build/CMakeFiles/Makefile.cmake delete mode 100644 examples/abigen_test/build/CMakeFiles/Makefile2 delete mode 100644 examples/abigen_test/build/CMakeFiles/TargetDirectories.txt delete mode 100644 examples/abigen_test/build/CMakeFiles/cmake.check_cache delete mode 100755 examples/abigen_test/build/CMakeFiles/feature_tests.bin delete mode 100644 examples/abigen_test/build/CMakeFiles/feature_tests.c delete mode 100644 examples/abigen_test/build/CMakeFiles/feature_tests.cxx delete mode 100644 examples/abigen_test/build/CMakeFiles/progress.marks delete mode 100644 examples/abigen_test/build/CMakeFiles/test.abi delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/CXX.includecache delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/DependInfo.cmake delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/build.make delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/cmake_clean.cmake delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/depend.internal delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/depend.make delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/flags.make delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/link.txt delete mode 100644 examples/abigen_test/build/CMakeFiles/test.wasm.dir/progress.make delete mode 100644 examples/abigen_test/build/Makefile delete mode 100644 examples/abigen_test/build/cmake_install.cmake delete mode 100755 examples/abigen_test/build/test.wasm diff --git a/examples/abigen_test/build/CMakeCache.txt b/examples/abigen_test/build/CMakeCache.txt deleted file mode 100644 index 4da2245959d..00000000000 --- a/examples/abigen_test/build/CMakeCache.txt +++ /dev/null @@ -1,352 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build -# It was generated by CMake: /usr/local/Cellar/cmake/3.12.0/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//ar -CMAKE_AR:PATH=/usr/local/eosio.wasmsdk/bin/eosio-ar - -//Choose the type of build, options are: None Debug Release RelWithDebInfo -// MinSizeRel ... -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - -//Flags used by the C compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the C compiler during DEBUG builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the C compiler during MINSIZEREL builds. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the C compiler during RELEASE builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the C compiler during RELWITHDEBINFO builds. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF - -//Path to a program. -CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump - -//Build architectures for OSX -CMAKE_OSX_ARCHITECTURES:STRING= - -//Minimum OS X version to target for deployment (at runtime); newer -// APIs weak linked. Set to empty string for default value. -CMAKE_OSX_DEPLOYMENT_TARGET:STRING= - -//The product will be built against the headers and libraries located -// inside the indicated SDK. -CMAKE_OSX_SYSROOT:STRING= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=hello_example - -//Value Computed by CMake -CMAKE_PROJECT_VERSION:STATIC=1.0.0 - -//Value Computed by CMake -CMAKE_PROJECT_VERSION_MAJOR:STATIC=1 - -//Value Computed by CMake -CMAKE_PROJECT_VERSION_MINOR:STATIC=0 - -//Value Computed by CMake -CMAKE_PROJECT_VERSION_PATCH:STATIC=0 - -//Value Computed by CMake -CMAKE_PROJECT_VERSION_TWEAK:STATIC= - -//ranlib -CMAKE_RANLIB:PATH=/usr/local/eosio.wasmsdk/bin/eosio-ranlib - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Value Computed by CMake -hello_example_BINARY_DIR:STATIC=/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build - -//Value Computed by CMake -hello_example_SOURCE_DIR:STATIC=/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=12 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=0 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.12.0/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.12.0/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.12.0/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/Cellar/cmake/3.12.0/bin/ccmake -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test -//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL -CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/local/Cellar/cmake/3.12.0/share/cmake -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeCCompiler.cmake b/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeCCompiler.cmake deleted file mode 100644 index 45666aa97bc..00000000000 --- a/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeCCompiler.cmake +++ /dev/null @@ -1,73 +0,0 @@ -set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "AppleClang") -set(CMAKE_C_COMPILER_VERSION "9.1.0.9020039") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") - -set(CMAKE_C_PLATFORM_ID "Darwin") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_SIMULATE_VERSION "") - - - -set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") -set(CMAKE_C_COMPILER_AR "") -set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") -set(CMAKE_C_COMPILER_RANLIB "") -set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") -set(CMAKE_COMPILER_IS_GNUCC ) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "8") -set(CMAKE_C_COMPILER_ABI "") -set(CMAKE_C_LIBRARY_ARCHITECTURE "") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib;/usr/local/lib") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Frameworks;/System/Library/Frameworks") diff --git a/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeCXXCompiler.cmake b/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeCXXCompiler.cmake deleted file mode 100644 index 757eba83775..00000000000 --- a/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeCXXCompiler.cmake +++ /dev/null @@ -1,76 +0,0 @@ -set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "AppleClang") -set(CMAKE_CXX_COMPILER_VERSION "9.1.0.9020039") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") -set(CMAKE_CXX20_COMPILE_FEATURES "") - -set(CMAKE_CXX_PLATFORM_ID "Darwin") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_SIMULATE_VERSION "") - - - -set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") -set(CMAKE_CXX_COMPILER_AR "") -set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") -set(CMAKE_CXX_COMPILER_RANLIB "") -set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") -set(CMAKE_COMPILER_IS_GNUCXX ) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "8") -set(CMAKE_CXX_COMPILER_ABI "") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib;/usr/local/lib") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Frameworks;/System/Library/Frameworks") diff --git a/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_C.bin b/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_C.bin deleted file mode 100755 index 66e26cdeafd29c82b9ccde1b6e2b7201eff78747..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4304 zcmeHKL2DC16rODw6s@KgMNu?}Nc50|RxwBqDz0u&+M*RiDPxn}(uHOt$u72*KrcN6 z5qj|Gp-1s92!a<6J?c;JptlGfi%9YNrV}#TT7SVj`1Z~BX6DVCZ}#%O{QkLpKnN!z z#Oja`;wVr6Srd7Tgg6O!fRxiW?zoTL`%{dj%}LXLGUlmZp_DW3qnY#)wSP1n6Plwo zkp)naGAZL=Db@sTcfO}NTn6!Ry@Y&tu$*Moq*B(KQG1YZcfJjs@0i|1p2}w?!&u5B zdLBl;45Rs`;_3T-(D|q-jhwpgX9NB3RVVMdx2k>ZpifFSt=Ctbh`OnH&ClU|%ljQ- z#*v4$v8EHiG&t|O4u2i~Fk^sed>g_%&z%3?nEzWI7y(L2yH#2YYbAeq(FdoU0$9h& zoA+5~tm1wwyc^nHTX}mPF_a|4kwXfX`kXOX0r%xTzQ1Warvh+}cN`x3j_WytvvK}| z<#rr2iZ_d>BdlQ&>;k~^JbVtqU(}rXShEUP1*`&A0jq#jz$#!BunJfOtO8Wvq1XN4 zy~!wvFZ%K|P5Bxe(0x zK}(D`=E6u^Wgjbz0>lK5$cS%e@Yy)4vfu-%jFUNMrzv8M$H@`w_tEIfFuzkH=ZgS5 fhsyHkp!e3Iy6IFEQdP%BQMTixCTr-qQMC9AQNxsd diff --git a/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_CXX.bin b/examples/abigen_test/build/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_CXX.bin deleted file mode 100755 index 05c215fbda6848bbbb6dbf8ef52179b2e258afd6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4288 zcmeHKO=}ZT6n)dQsI@lTD2k#{RMcXUYLy@^{2EQLwnd|qO1U=4lnykBBr}*Qfx2)J zMCd|r;l{t<&Xou*x)J;fE_4^cjZj3yb6#G^O#Q&M%!M=eoj3R1ci(xd`~KVKADfi2 zVoI&_DW&4T49Fvuz)GoIKo$_0K7YlYwXaWcH*8jz{+6*$27w}ZdnO+a(fK3cJ!Lq0 zQv(26(k9|L4bKp`jrH!}0<3q^gpl|5!bw(wRHRs~)O!Ut)_Y;9)Eo{9c#8* z&GuuvJ@5Uw1xcSlsFi wH|%YP=AB-;y}~n0TLP2vuV;!rljEP%J-;9YOwwpYWOicgG$(2aNTKWe1g0I98vp>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" -# if defined(__ibmxl__) -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) -# else - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) -# endif - - -#elif defined(__ibmxl__) || (defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800) -# define COMPILER_ID "XL" -# if defined(__ibmxl__) -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) -# else - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) -# endif - - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" -# if defined(__ibmxl__) -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) -# else - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) -# endif - - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__ARMCC_VERSION) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - -#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) -# define COMPILER_ID "MIPSpro" -# if defined(_SGI_COMPILER_VERSION) - /* _SGI_COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) -# else - /* _COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__sgi) -# define COMPILER_ID "MIPSpro" - -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) -# define PLATFORM_ID "IRIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if !defined(__STDC__) -# if (defined(_MSC_VER) && !defined(__clang__)) \ - || (defined(__ibmxl__) || defined(__IBMC__)) -# define C_DIALECT "90" -# else -# define C_DIALECT -# endif -#elif __STDC_VERSION__ >= 201000L -# define C_DIALECT "11" -#elif __STDC_VERSION__ >= 199901L -# define C_DIALECT "99" -#else -# define C_DIALECT "90" -#endif -const char* info_language_dialect_default = - "INFO" ":" "dialect_default[" C_DIALECT "]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} -#endif diff --git a/examples/abigen_test/build/CMakeFiles/3.12.0/CompilerIdCXX/CMakeCXXCompilerId.cpp b/examples/abigen_test/build/CMakeFiles/3.12.0/CompilerIdCXX/CMakeCXXCompilerId.cpp deleted file mode 100644 index b728b632913..00000000000 --- a/examples/abigen_test/build/CMakeFiles/3.12.0/CompilerIdCXX/CMakeCXXCompilerId.cpp +++ /dev/null @@ -1,602 +0,0 @@ -/* This source file must have a .cpp extension so that all C++ compilers - recognize the extension without flags. Borland does not know .cxx for - example. */ -#ifndef __cplusplus -# error "A C compiler has been selected for C++." -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__COMO__) -# define COMPILER_ID "Comeau" - /* __COMO_VERSION__ = VRR */ -# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) -# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) - -#elif defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" -# if defined(__ibmxl__) -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) -# else - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) -# endif - - -#elif defined(__ibmxl__) || (defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800) -# define COMPILER_ID "XL" -# if defined(__ibmxl__) -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) -# else - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) -# endif - - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" -# if defined(__ibmxl__) -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) -# else - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) -# endif - - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__ARMCC_VERSION) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) -# define COMPILER_ID "MIPSpro" -# if defined(_SGI_COMPILER_VERSION) - /* _SGI_COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) -# else - /* _COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__sgi) -# define COMPILER_ID "MIPSpro" - -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) -# define PLATFORM_ID "IRIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if defined(_MSC_VER) && defined(_MSVC_LANG) -#define CXX_STD _MSVC_LANG -#else -#define CXX_STD __cplusplus -#endif - -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" -#if CXX_STD > 201703L - "20" -#elif CXX_STD >= 201703L - "17" -#elif CXX_STD >= 201402L - "14" -#elif CXX_STD >= 201103L - "11" -#else - "98" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} diff --git a/examples/abigen_test/build/CMakeFiles/CMakeDirectoryInformation.cmake b/examples/abigen_test/build/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index 0634c19b3f0..00000000000 --- a/examples/abigen_test/build/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.12 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/examples/abigen_test/build/CMakeFiles/CMakeOutput.log b/examples/abigen_test/build/CMakeFiles/CMakeOutput.log deleted file mode 100644 index bc1a4078199..00000000000 --- a/examples/abigen_test/build/CMakeFiles/CMakeOutput.log +++ /dev/null @@ -1,532 +0,0 @@ -The system is: Darwin - 17.6.0 - x86_64 -Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. -Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Build flags: -Id flags: - -The output was: -0 - - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" - -The C compiler identification is AppleClang, found in "/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/3.12.0/CompilerIdC/a.out" - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. -Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Build flags: -Id flags: - -The output was: -0 - - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" - -The CXX compiler identification is AppleClang, found in "/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/3.12.0/CompilerIdCXX/a.out" - -Determining if the C compiler works passed with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_b2e08/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b2e08.dir/build.make CMakeFiles/cmTC_b2e08.dir/build -Building C object CMakeFiles/cmTC_b2e08.dir/testCCompiler.c.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -o CMakeFiles/cmTC_b2e08.dir/testCCompiler.c.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp/testCCompiler.c -Linking C executable cmTC_b2e08 -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b2e08.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_b2e08.dir/testCCompiler.c.o -o cmTC_b2e08 - - -Detecting C compiler ABI info compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_0323f/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_0323f.dir/build.make CMakeFiles/cmTC_0323f.dir/build -Building C object CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -o CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o -c /usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeCCompilerABI.c -Linking C executable cmTC_0323f -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0323f.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o -o cmTC_0323f -Apple LLVM version 9.1.0 (clang-902.0.39.2) -Target: x86_64-apple-darwin17.6.0 -Thread model: posix -InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -o cmTC_0323f -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a -@(#)PROGRAM:ld PROJECT:ld64-351.8 -configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS) -Library search paths: - /usr/lib - /usr/local/lib -Framework search paths: - /Library/Frameworks/ - /System/Library/Frameworks/ - - -Parsed C implicit link information from above output: - link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] - ignore line: [Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp] - ignore line: [] - ignore line: [Run Build Command:"/usr/bin/make" "cmTC_0323f/fast"] - ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_0323f.dir/build.make CMakeFiles/cmTC_0323f.dir/build] - ignore line: [Building C object CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o] - ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -o CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o -c /usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeCCompilerABI.c] - ignore line: [Linking C executable cmTC_0323f] - ignore line: [/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0323f.dir/link.txt --verbose=1] - ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o -o cmTC_0323f ] - ignore line: [Apple LLVM version 9.1.0 (clang-902.0.39.2)] - ignore line: [Target: x86_64-apple-darwin17.6.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -o cmTC_0323f -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore - arg [-demangle] ==> ignore - arg [-lto_library] ==> ignore, skip following value - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library - arg [-dynamic] ==> ignore - arg [-arch] ==> ignore - arg [x86_64] ==> ignore - arg [-macosx_version_min] ==> ignore - arg [10.13.0] ==> ignore - arg [-o] ==> ignore - arg [cmTC_0323f] ==> ignore - arg [-search_paths_first] ==> ignore - arg [-headerpad_max_install_names] ==> ignore - arg [-v] ==> ignore - arg [CMakeFiles/cmTC_0323f.dir/CMakeCCompilerABI.c.o] ==> ignore - arg [-lSystem] ==> lib [System] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a] - Library search paths: [;/usr/lib;/usr/local/lib] - Framework search paths: [;/Library/Frameworks/;/System/Library/Frameworks/] - remove lib [System] - remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a] - collapse library dir [/usr/lib] ==> [/usr/lib] - collapse library dir [/usr/local/lib] ==> [/usr/local/lib] - collapse framework dir [/Library/Frameworks/] ==> [/Library/Frameworks] - collapse framework dir [/System/Library/Frameworks/] ==> [/System/Library/Frameworks] - implicit libs: [] - implicit dirs: [/usr/lib;/usr/local/lib] - implicit fwks: [/Library/Frameworks;/System/Library/Frameworks] - - - - -Detecting C [-std=c11] compiler features compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_1834a/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_1834a.dir/build.make CMakeFiles/cmTC_1834a.dir/build -Building C object CMakeFiles/cmTC_1834a.dir/feature_tests.c.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -std=c11 -o CMakeFiles/cmTC_1834a.dir/feature_tests.c.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/feature_tests.c -Linking C executable cmTC_1834a -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1834a.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_1834a.dir/feature_tests.c.o -o cmTC_1834a - - - Feature record: C_FEATURE:1c_function_prototypes - Feature record: C_FEATURE:1c_restrict - Feature record: C_FEATURE:1c_static_assert - Feature record: C_FEATURE:1c_variadic_macros - - -Detecting C [-std=c99] compiler features compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_d7a98/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_d7a98.dir/build.make CMakeFiles/cmTC_d7a98.dir/build -Building C object CMakeFiles/cmTC_d7a98.dir/feature_tests.c.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -std=c99 -o CMakeFiles/cmTC_d7a98.dir/feature_tests.c.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/feature_tests.c -Linking C executable cmTC_d7a98 -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d7a98.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_d7a98.dir/feature_tests.c.o -o cmTC_d7a98 - - - Feature record: C_FEATURE:1c_function_prototypes - Feature record: C_FEATURE:1c_restrict - Feature record: C_FEATURE:0c_static_assert - Feature record: C_FEATURE:1c_variadic_macros - - -Detecting C [-std=c90] compiler features compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_88f45/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_88f45.dir/build.make CMakeFiles/cmTC_88f45.dir/build -Building C object CMakeFiles/cmTC_88f45.dir/feature_tests.c.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -std=c90 -o CMakeFiles/cmTC_88f45.dir/feature_tests.c.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/feature_tests.c -Linking C executable cmTC_88f45 -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_88f45.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_88f45.dir/feature_tests.c.o -o cmTC_88f45 - - - Feature record: C_FEATURE:1c_function_prototypes - Feature record: C_FEATURE:0c_restrict - Feature record: C_FEATURE:0c_static_assert - Feature record: C_FEATURE:0c_variadic_macros -Determining if the CXX compiler works passed with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_ea8b9/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_ea8b9.dir/build.make CMakeFiles/cmTC_ea8b9.dir/build -Building CXX object CMakeFiles/cmTC_ea8b9.dir/testCXXCompiler.cxx.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -o CMakeFiles/cmTC_ea8b9.dir/testCXXCompiler.cxx.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx -Linking CXX executable cmTC_ea8b9 -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ea8b9.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_ea8b9.dir/testCXXCompiler.cxx.o -o cmTC_ea8b9 - - -Detecting CXX compiler ABI info compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_6a8f3/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_6a8f3.dir/build.make CMakeFiles/cmTC_6a8f3.dir/build -Building CXX object CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -o CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeCXXCompilerABI.cpp -Linking CXX executable cmTC_6a8f3 -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6a8f3.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_6a8f3 -Apple LLVM version 9.1.0 (clang-902.0.39.2) -Target: x86_64-apple-darwin17.6.0 -Thread model: posix -InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -o cmTC_6a8f3 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a -@(#)PROGRAM:ld PROJECT:ld64-351.8 -configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS) -Library search paths: - /usr/lib - /usr/local/lib -Framework search paths: - /Library/Frameworks/ - /System/Library/Frameworks/ - - -Parsed CXX implicit link information from above output: - link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] - ignore line: [Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp] - ignore line: [] - ignore line: [Run Build Command:"/usr/bin/make" "cmTC_6a8f3/fast"] - ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_6a8f3.dir/build.make CMakeFiles/cmTC_6a8f3.dir/build] - ignore line: [Building CXX object CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o] - ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -o CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeCXXCompilerABI.cpp] - ignore line: [Linking CXX executable cmTC_6a8f3] - ignore line: [/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6a8f3.dir/link.txt --verbose=1] - ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_6a8f3 ] - ignore line: [Apple LLVM version 9.1.0 (clang-902.0.39.2)] - ignore line: [Target: x86_64-apple-darwin17.6.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -o cmTC_6a8f3 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore - arg [-demangle] ==> ignore - arg [-lto_library] ==> ignore, skip following value - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library - arg [-dynamic] ==> ignore - arg [-arch] ==> ignore - arg [x86_64] ==> ignore - arg [-macosx_version_min] ==> ignore - arg [10.13.0] ==> ignore - arg [-o] ==> ignore - arg [cmTC_6a8f3] ==> ignore - arg [-search_paths_first] ==> ignore - arg [-headerpad_max_install_names] ==> ignore - arg [-v] ==> ignore - arg [CMakeFiles/cmTC_6a8f3.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore - arg [-lc++] ==> lib [c++] - arg [-lSystem] ==> lib [System] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a] - Library search paths: [;/usr/lib;/usr/local/lib] - Framework search paths: [;/Library/Frameworks/;/System/Library/Frameworks/] - remove lib [System] - remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a] - collapse library dir [/usr/lib] ==> [/usr/lib] - collapse library dir [/usr/local/lib] ==> [/usr/local/lib] - collapse framework dir [/Library/Frameworks/] ==> [/Library/Frameworks] - collapse framework dir [/System/Library/Frameworks/] ==> [/System/Library/Frameworks] - implicit libs: [c++] - implicit dirs: [/usr/lib;/usr/local/lib] - implicit fwks: [/Library/Frameworks;/System/Library/Frameworks] - - - - -Detecting CXX [-std=c++1z] compiler features compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_23eb2/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_23eb2.dir/build.make CMakeFiles/cmTC_23eb2.dir/build -Building CXX object CMakeFiles/cmTC_23eb2.dir/feature_tests.cxx.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++1z -o CMakeFiles/cmTC_23eb2.dir/feature_tests.cxx.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/feature_tests.cxx -Linking CXX executable cmTC_23eb2 -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_23eb2.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_23eb2.dir/feature_tests.cxx.o -o cmTC_23eb2 - - - Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers - Feature record: CXX_FEATURE:1cxx_alias_templates - Feature record: CXX_FEATURE:1cxx_alignas - Feature record: CXX_FEATURE:1cxx_alignof - Feature record: CXX_FEATURE:1cxx_attributes - Feature record: CXX_FEATURE:1cxx_attribute_deprecated - Feature record: CXX_FEATURE:1cxx_auto_type - Feature record: CXX_FEATURE:1cxx_binary_literals - Feature record: CXX_FEATURE:1cxx_constexpr - Feature record: CXX_FEATURE:1cxx_contextual_conversions - Feature record: CXX_FEATURE:1cxx_decltype - Feature record: CXX_FEATURE:1cxx_decltype_auto - Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types - Feature record: CXX_FEATURE:1cxx_default_function_template_args - Feature record: CXX_FEATURE:1cxx_defaulted_functions - Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers - Feature record: CXX_FEATURE:1cxx_delegating_constructors - Feature record: CXX_FEATURE:1cxx_deleted_functions - Feature record: CXX_FEATURE:1cxx_digit_separators - Feature record: CXX_FEATURE:1cxx_enum_forward_declarations - Feature record: CXX_FEATURE:1cxx_explicit_conversions - Feature record: CXX_FEATURE:1cxx_extended_friend_declarations - Feature record: CXX_FEATURE:1cxx_extern_templates - Feature record: CXX_FEATURE:1cxx_final - Feature record: CXX_FEATURE:1cxx_func_identifier - Feature record: CXX_FEATURE:1cxx_generalized_initializers - Feature record: CXX_FEATURE:1cxx_generic_lambdas - Feature record: CXX_FEATURE:1cxx_inheriting_constructors - Feature record: CXX_FEATURE:1cxx_inline_namespaces - Feature record: CXX_FEATURE:1cxx_lambdas - Feature record: CXX_FEATURE:1cxx_lambda_init_captures - Feature record: CXX_FEATURE:1cxx_local_type_template_args - Feature record: CXX_FEATURE:1cxx_long_long_type - Feature record: CXX_FEATURE:1cxx_noexcept - Feature record: CXX_FEATURE:1cxx_nonstatic_member_init - Feature record: CXX_FEATURE:1cxx_nullptr - Feature record: CXX_FEATURE:1cxx_override - Feature record: CXX_FEATURE:1cxx_range_for - Feature record: CXX_FEATURE:1cxx_raw_string_literals - Feature record: CXX_FEATURE:1cxx_reference_qualified_functions - Feature record: CXX_FEATURE:1cxx_relaxed_constexpr - Feature record: CXX_FEATURE:1cxx_return_type_deduction - Feature record: CXX_FEATURE:1cxx_right_angle_brackets - Feature record: CXX_FEATURE:1cxx_rvalue_references - Feature record: CXX_FEATURE:1cxx_sizeof_member - Feature record: CXX_FEATURE:1cxx_static_assert - Feature record: CXX_FEATURE:1cxx_strong_enums - Feature record: CXX_FEATURE:1cxx_template_template_parameters - Feature record: CXX_FEATURE:1cxx_thread_local - Feature record: CXX_FEATURE:1cxx_trailing_return_types - Feature record: CXX_FEATURE:1cxx_unicode_literals - Feature record: CXX_FEATURE:1cxx_uniform_initialization - Feature record: CXX_FEATURE:1cxx_unrestricted_unions - Feature record: CXX_FEATURE:1cxx_user_literals - Feature record: CXX_FEATURE:1cxx_variable_templates - Feature record: CXX_FEATURE:1cxx_variadic_macros - Feature record: CXX_FEATURE:1cxx_variadic_templates - - -Detecting CXX [-std=c++14] compiler features compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_38edd/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_38edd.dir/build.make CMakeFiles/cmTC_38edd.dir/build -Building CXX object CMakeFiles/cmTC_38edd.dir/feature_tests.cxx.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++14 -o CMakeFiles/cmTC_38edd.dir/feature_tests.cxx.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/feature_tests.cxx -Linking CXX executable cmTC_38edd -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_38edd.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_38edd.dir/feature_tests.cxx.o -o cmTC_38edd - - - Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers - Feature record: CXX_FEATURE:1cxx_alias_templates - Feature record: CXX_FEATURE:1cxx_alignas - Feature record: CXX_FEATURE:1cxx_alignof - Feature record: CXX_FEATURE:1cxx_attributes - Feature record: CXX_FEATURE:1cxx_attribute_deprecated - Feature record: CXX_FEATURE:1cxx_auto_type - Feature record: CXX_FEATURE:1cxx_binary_literals - Feature record: CXX_FEATURE:1cxx_constexpr - Feature record: CXX_FEATURE:1cxx_contextual_conversions - Feature record: CXX_FEATURE:1cxx_decltype - Feature record: CXX_FEATURE:1cxx_decltype_auto - Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types - Feature record: CXX_FEATURE:1cxx_default_function_template_args - Feature record: CXX_FEATURE:1cxx_defaulted_functions - Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers - Feature record: CXX_FEATURE:1cxx_delegating_constructors - Feature record: CXX_FEATURE:1cxx_deleted_functions - Feature record: CXX_FEATURE:1cxx_digit_separators - Feature record: CXX_FEATURE:1cxx_enum_forward_declarations - Feature record: CXX_FEATURE:1cxx_explicit_conversions - Feature record: CXX_FEATURE:1cxx_extended_friend_declarations - Feature record: CXX_FEATURE:1cxx_extern_templates - Feature record: CXX_FEATURE:1cxx_final - Feature record: CXX_FEATURE:1cxx_func_identifier - Feature record: CXX_FEATURE:1cxx_generalized_initializers - Feature record: CXX_FEATURE:1cxx_generic_lambdas - Feature record: CXX_FEATURE:1cxx_inheriting_constructors - Feature record: CXX_FEATURE:1cxx_inline_namespaces - Feature record: CXX_FEATURE:1cxx_lambdas - Feature record: CXX_FEATURE:1cxx_lambda_init_captures - Feature record: CXX_FEATURE:1cxx_local_type_template_args - Feature record: CXX_FEATURE:1cxx_long_long_type - Feature record: CXX_FEATURE:1cxx_noexcept - Feature record: CXX_FEATURE:1cxx_nonstatic_member_init - Feature record: CXX_FEATURE:1cxx_nullptr - Feature record: CXX_FEATURE:1cxx_override - Feature record: CXX_FEATURE:1cxx_range_for - Feature record: CXX_FEATURE:1cxx_raw_string_literals - Feature record: CXX_FEATURE:1cxx_reference_qualified_functions - Feature record: CXX_FEATURE:1cxx_relaxed_constexpr - Feature record: CXX_FEATURE:1cxx_return_type_deduction - Feature record: CXX_FEATURE:1cxx_right_angle_brackets - Feature record: CXX_FEATURE:1cxx_rvalue_references - Feature record: CXX_FEATURE:1cxx_sizeof_member - Feature record: CXX_FEATURE:1cxx_static_assert - Feature record: CXX_FEATURE:1cxx_strong_enums - Feature record: CXX_FEATURE:1cxx_template_template_parameters - Feature record: CXX_FEATURE:1cxx_thread_local - Feature record: CXX_FEATURE:1cxx_trailing_return_types - Feature record: CXX_FEATURE:1cxx_unicode_literals - Feature record: CXX_FEATURE:1cxx_uniform_initialization - Feature record: CXX_FEATURE:1cxx_unrestricted_unions - Feature record: CXX_FEATURE:1cxx_user_literals - Feature record: CXX_FEATURE:1cxx_variable_templates - Feature record: CXX_FEATURE:1cxx_variadic_macros - Feature record: CXX_FEATURE:1cxx_variadic_templates - - -Detecting CXX [-std=c++11] compiler features compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_8ef3f/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_8ef3f.dir/build.make CMakeFiles/cmTC_8ef3f.dir/build -Building CXX object CMakeFiles/cmTC_8ef3f.dir/feature_tests.cxx.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++11 -o CMakeFiles/cmTC_8ef3f.dir/feature_tests.cxx.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/feature_tests.cxx -Linking CXX executable cmTC_8ef3f -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ef3f.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_8ef3f.dir/feature_tests.cxx.o -o cmTC_8ef3f - - - Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers - Feature record: CXX_FEATURE:1cxx_alias_templates - Feature record: CXX_FEATURE:1cxx_alignas - Feature record: CXX_FEATURE:1cxx_alignof - Feature record: CXX_FEATURE:1cxx_attributes - Feature record: CXX_FEATURE:0cxx_attribute_deprecated - Feature record: CXX_FEATURE:1cxx_auto_type - Feature record: CXX_FEATURE:0cxx_binary_literals - Feature record: CXX_FEATURE:1cxx_constexpr - Feature record: CXX_FEATURE:0cxx_contextual_conversions - Feature record: CXX_FEATURE:1cxx_decltype - Feature record: CXX_FEATURE:0cxx_decltype_auto - Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types - Feature record: CXX_FEATURE:1cxx_default_function_template_args - Feature record: CXX_FEATURE:1cxx_defaulted_functions - Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers - Feature record: CXX_FEATURE:1cxx_delegating_constructors - Feature record: CXX_FEATURE:1cxx_deleted_functions - Feature record: CXX_FEATURE:0cxx_digit_separators - Feature record: CXX_FEATURE:1cxx_enum_forward_declarations - Feature record: CXX_FEATURE:1cxx_explicit_conversions - Feature record: CXX_FEATURE:1cxx_extended_friend_declarations - Feature record: CXX_FEATURE:1cxx_extern_templates - Feature record: CXX_FEATURE:1cxx_final - Feature record: CXX_FEATURE:1cxx_func_identifier - Feature record: CXX_FEATURE:1cxx_generalized_initializers - Feature record: CXX_FEATURE:0cxx_generic_lambdas - Feature record: CXX_FEATURE:1cxx_inheriting_constructors - Feature record: CXX_FEATURE:1cxx_inline_namespaces - Feature record: CXX_FEATURE:1cxx_lambdas - Feature record: CXX_FEATURE:0cxx_lambda_init_captures - Feature record: CXX_FEATURE:1cxx_local_type_template_args - Feature record: CXX_FEATURE:1cxx_long_long_type - Feature record: CXX_FEATURE:1cxx_noexcept - Feature record: CXX_FEATURE:1cxx_nonstatic_member_init - Feature record: CXX_FEATURE:1cxx_nullptr - Feature record: CXX_FEATURE:1cxx_override - Feature record: CXX_FEATURE:1cxx_range_for - Feature record: CXX_FEATURE:1cxx_raw_string_literals - Feature record: CXX_FEATURE:1cxx_reference_qualified_functions - Feature record: CXX_FEATURE:0cxx_relaxed_constexpr - Feature record: CXX_FEATURE:0cxx_return_type_deduction - Feature record: CXX_FEATURE:1cxx_right_angle_brackets - Feature record: CXX_FEATURE:1cxx_rvalue_references - Feature record: CXX_FEATURE:1cxx_sizeof_member - Feature record: CXX_FEATURE:1cxx_static_assert - Feature record: CXX_FEATURE:1cxx_strong_enums - Feature record: CXX_FEATURE:1cxx_template_template_parameters - Feature record: CXX_FEATURE:1cxx_thread_local - Feature record: CXX_FEATURE:1cxx_trailing_return_types - Feature record: CXX_FEATURE:1cxx_unicode_literals - Feature record: CXX_FEATURE:1cxx_uniform_initialization - Feature record: CXX_FEATURE:1cxx_unrestricted_unions - Feature record: CXX_FEATURE:1cxx_user_literals - Feature record: CXX_FEATURE:0cxx_variable_templates - Feature record: CXX_FEATURE:1cxx_variadic_macros - Feature record: CXX_FEATURE:1cxx_variadic_templates - - -Detecting CXX [-std=c++98] compiler features compiled with the following output: -Change Dir: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_2b7aa/fast" -/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_2b7aa.dir/build.make CMakeFiles/cmTC_2b7aa.dir/build -Building CXX object CMakeFiles/cmTC_2b7aa.dir/feature_tests.cxx.o -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++98 -o CMakeFiles/cmTC_2b7aa.dir/feature_tests.cxx.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/feature_tests.cxx -Linking CXX executable cmTC_2b7aa -/usr/local/Cellar/cmake/3.12.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2b7aa.dir/link.txt --verbose=1 -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_2b7aa.dir/feature_tests.cxx.o -o cmTC_2b7aa - - - Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers - Feature record: CXX_FEATURE:0cxx_alias_templates - Feature record: CXX_FEATURE:0cxx_alignas - Feature record: CXX_FEATURE:0cxx_alignof - Feature record: CXX_FEATURE:0cxx_attributes - Feature record: CXX_FEATURE:0cxx_attribute_deprecated - Feature record: CXX_FEATURE:0cxx_auto_type - Feature record: CXX_FEATURE:0cxx_binary_literals - Feature record: CXX_FEATURE:0cxx_constexpr - Feature record: CXX_FEATURE:0cxx_contextual_conversions - Feature record: CXX_FEATURE:0cxx_decltype - Feature record: CXX_FEATURE:0cxx_decltype_auto - Feature record: CXX_FEATURE:0cxx_decltype_incomplete_return_types - Feature record: CXX_FEATURE:0cxx_default_function_template_args - Feature record: CXX_FEATURE:0cxx_defaulted_functions - Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers - Feature record: CXX_FEATURE:0cxx_delegating_constructors - Feature record: CXX_FEATURE:0cxx_deleted_functions - Feature record: CXX_FEATURE:0cxx_digit_separators - Feature record: CXX_FEATURE:0cxx_enum_forward_declarations - Feature record: CXX_FEATURE:0cxx_explicit_conversions - Feature record: CXX_FEATURE:0cxx_extended_friend_declarations - Feature record: CXX_FEATURE:0cxx_extern_templates - Feature record: CXX_FEATURE:0cxx_final - Feature record: CXX_FEATURE:0cxx_func_identifier - Feature record: CXX_FEATURE:0cxx_generalized_initializers - Feature record: CXX_FEATURE:0cxx_generic_lambdas - Feature record: CXX_FEATURE:0cxx_inheriting_constructors - Feature record: CXX_FEATURE:0cxx_inline_namespaces - Feature record: CXX_FEATURE:0cxx_lambdas - Feature record: CXX_FEATURE:0cxx_lambda_init_captures - Feature record: CXX_FEATURE:0cxx_local_type_template_args - Feature record: CXX_FEATURE:0cxx_long_long_type - Feature record: CXX_FEATURE:0cxx_noexcept - Feature record: CXX_FEATURE:0cxx_nonstatic_member_init - Feature record: CXX_FEATURE:0cxx_nullptr - Feature record: CXX_FEATURE:0cxx_override - Feature record: CXX_FEATURE:0cxx_range_for - Feature record: CXX_FEATURE:0cxx_raw_string_literals - Feature record: CXX_FEATURE:0cxx_reference_qualified_functions - Feature record: CXX_FEATURE:0cxx_relaxed_constexpr - Feature record: CXX_FEATURE:0cxx_return_type_deduction - Feature record: CXX_FEATURE:0cxx_right_angle_brackets - Feature record: CXX_FEATURE:0cxx_rvalue_references - Feature record: CXX_FEATURE:0cxx_sizeof_member - Feature record: CXX_FEATURE:0cxx_static_assert - Feature record: CXX_FEATURE:0cxx_strong_enums - Feature record: CXX_FEATURE:1cxx_template_template_parameters - Feature record: CXX_FEATURE:0cxx_thread_local - Feature record: CXX_FEATURE:0cxx_trailing_return_types - Feature record: CXX_FEATURE:0cxx_unicode_literals - Feature record: CXX_FEATURE:0cxx_uniform_initialization - Feature record: CXX_FEATURE:0cxx_unrestricted_unions - Feature record: CXX_FEATURE:0cxx_user_literals - Feature record: CXX_FEATURE:0cxx_variable_templates - Feature record: CXX_FEATURE:0cxx_variadic_macros - Feature record: CXX_FEATURE:0cxx_variadic_templates diff --git a/examples/abigen_test/build/CMakeFiles/Makefile.cmake b/examples/abigen_test/build/CMakeFiles/Makefile.cmake deleted file mode 100644 index 1e1cccec851..00000000000 --- a/examples/abigen_test/build/CMakeFiles/Makefile.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.12 - -# The generator used is: -set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") - -# The top level Makefile was generated from the following files: -set(CMAKE_MAKEFILE_DEPENDS - "CMakeCache.txt" - "../CMakeLists.txt" - "CMakeFiles/3.12.0/CMakeCCompiler.cmake" - "CMakeFiles/3.12.0/CMakeCXXCompiler.cmake" - "CMakeFiles/3.12.0/CMakeSystem.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeCInformation.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeCXXInformation.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeCommonLanguageInclude.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeGenericSystem.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeInitializeConfigs.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeLanguageInformation.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeSystemSpecificInformation.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Compiler/AppleClang-C.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Compiler/AppleClang-CXX.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Compiler/Clang.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Compiler/GNU.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Platform/Apple-AppleClang-C.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Platform/Apple-AppleClang-CXX.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Platform/Apple-Clang-C.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Platform/Apple-Clang-CXX.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Platform/Apple-Clang.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Platform/Darwin-Initialize.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Platform/Darwin.cmake" - "/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/Platform/UnixPaths.cmake" - "/usr/local/eosio.wasmsdk/lib/cmake/EosioWasmToolchain.cmake" - ) - -# The corresponding makefile is: -set(CMAKE_MAKEFILE_OUTPUTS - "Makefile" - "CMakeFiles/cmake.check_cache" - ) - -# Byproducts of CMake generate step: -set(CMAKE_MAKEFILE_PRODUCTS - "CMakeFiles/CMakeDirectoryInformation.cmake" - ) - -# Dependency information for all targets: -set(CMAKE_DEPEND_INFO_FILES - "CMakeFiles/test.wasm.dir/DependInfo.cmake" - ) diff --git a/examples/abigen_test/build/CMakeFiles/Makefile2 b/examples/abigen_test/build/CMakeFiles/Makefile2 deleted file mode 100644 index b57de581653..00000000000 --- a/examples/abigen_test/build/CMakeFiles/Makefile2 +++ /dev/null @@ -1,113 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.12 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -# The main recursive all target -all: - -.PHONY : all - -# The main recursive preinstall target -preinstall: - -.PHONY : preinstall - -# The main recursive clean target -clean: - -.PHONY : clean - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/Cellar/cmake/3.12.0/bin/cmake - -# The command to remove a file. -RM = /usr/local/Cellar/cmake/3.12.0/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build - -#============================================================================= -# Target rules for target CMakeFiles/test.wasm.dir - -# All Build rule for target. -CMakeFiles/test.wasm.dir/all: - $(MAKE) -f CMakeFiles/test.wasm.dir/build.make CMakeFiles/test.wasm.dir/depend - $(MAKE) -f CMakeFiles/test.wasm.dir/build.make CMakeFiles/test.wasm.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles --progress-num=1,2 "Built target test.wasm" -.PHONY : CMakeFiles/test.wasm.dir/all - -# Include target in all. -all: CMakeFiles/test.wasm.dir/all - -.PHONY : all - -# Build rule for subdir invocation for target. -CMakeFiles/test.wasm.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles 2 - $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/test.wasm.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles 0 -.PHONY : CMakeFiles/test.wasm.dir/rule - -# Convenience name for target. -test.wasm: CMakeFiles/test.wasm.dir/rule - -.PHONY : test.wasm - -# clean rule for target. -CMakeFiles/test.wasm.dir/clean: - $(MAKE) -f CMakeFiles/test.wasm.dir/build.make CMakeFiles/test.wasm.dir/clean -.PHONY : CMakeFiles/test.wasm.dir/clean - -# clean rule for target. -clean: CMakeFiles/test.wasm.dir/clean - -.PHONY : clean - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/examples/abigen_test/build/CMakeFiles/TargetDirectories.txt b/examples/abigen_test/build/CMakeFiles/TargetDirectories.txt deleted file mode 100644 index e05625a8afd..00000000000 --- a/examples/abigen_test/build/CMakeFiles/TargetDirectories.txt +++ /dev/null @@ -1,3 +0,0 @@ -/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/rebuild_cache.dir -/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/edit_cache.dir -/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/test.wasm.dir diff --git a/examples/abigen_test/build/CMakeFiles/cmake.check_cache b/examples/abigen_test/build/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd731726..00000000000 --- a/examples/abigen_test/build/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/examples/abigen_test/build/CMakeFiles/feature_tests.bin b/examples/abigen_test/build/CMakeFiles/feature_tests.bin deleted file mode 100755 index 52fcf8003a31deadbbc07e8405ed12359f3abcc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8376 zcmeHM&5ImG6t9gN)EKil`GG>lkBA!F-H3-p5E6BCgVBVTz!H$6rut29VRiMSrh0c) z5OVRb2W9^U?~;?`d1#%h;p$35lfd+vFfd+vFfd+vFfd+vFfd+vF zfd+vFfd+vFfd+vFfd+vT0yj4If8YG__*ty|(7w+S`=8(2+^_!H)YZL}@0Qm;`Tk&% zPQ0_VCEsgbynf?a`^|Md7)X`po^lmPX4F-c4fw0t1f#6^jC?;KZ;k5XU-zPCp_CTL zotn2$b`vH;@TOCxt&P?YUeA+;&n#h~3Z)EtJ(^wW7^nQ6v?h>OHW60*!=DB{KdXx+ zZZA~Ia$8^rco=jCX5}){Htl`1A{8Q>uL#U_2}B8L@DwWV;@2cy4U^QZoDPWQK_;Z~ z`FwfGWXkQ3N-QD1g8vy8Sh8M$D(h7z@vljDNK zF5~9Vq8%3{jh0pwoh-GnjN2v;3rA+eIBOh9rwZ!#luqs5xlV=)F;uBl4>g)pFEus` z?}eiZ)0PM~{-k$~D`}vq7iOV#+@V7eXjxFvAs=H(h*j41LIQb|xc5lStcq7IC$6^C z(yr{|nBt)49wnZ-apzBz|Q)qaaa95`9x*_5NDP5?6mFkeAA5XjPV0+`vPY~ z>huWPo>YbkK|#$161*~~<@|`#vT{b387)W|B#`f7yanUwGV8E%sCVRF^N9wfvOO5S-$>3lQZ`;x##%?W*$G){ZD@8 z9_>kJo{rjJ*vyhdfBl#&wj~Wn<4%^_NCSECT%n8;XNS$*J8MxKw(E!2z@Ng}s6WnP zD@(B>8?8SP`C%-hSTVC$q!v2kvpxX=d~*92d#~z9+~pjKls7MLbV= 400 -"1" -#else -"0" -#endif -"c_function_prototypes\n" -"C_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -"1" -#else -"0" -#endif -"c_restrict\n" -"C_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -"1" -#else -"0" -#endif -"c_static_assert\n" -"C_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -"1" -#else -"0" -#endif -"c_variadic_macros\n" - -}; - -int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/examples/abigen_test/build/CMakeFiles/feature_tests.cxx b/examples/abigen_test/build/CMakeFiles/feature_tests.cxx deleted file mode 100644 index 34d2e8c4b30..00000000000 --- a/examples/abigen_test/build/CMakeFiles/feature_tests.cxx +++ /dev/null @@ -1,405 +0,0 @@ - - const char features[] = {"\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_aggregate_nsdmi) -"1" -#else -"0" -#endif -"cxx_aggregate_default_initializers\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alias_templates) -"1" -#else -"0" -#endif -"cxx_alias_templates\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alignas) -"1" -#else -"0" -#endif -"cxx_alignas\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_alignas) -"1" -#else -"0" -#endif -"cxx_alignof\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_attributes) -"1" -#else -"0" -#endif -"cxx_attributes\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_attribute_deprecated\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_auto_type) -"1" -#else -"0" -#endif -"cxx_auto_type\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_binary_literals) -"1" -#else -"0" -#endif -"cxx_binary_literals\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_constexpr) -"1" -#else -"0" -#endif -"cxx_constexpr\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_contextual_conversions) -"1" -#else -"0" -#endif -"cxx_contextual_conversions\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_decltype) -"1" -#else -"0" -#endif -"cxx_decltype\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_decltype_auto\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_decltype_incomplete_return_types) -"1" -#else -"0" -#endif -"cxx_decltype_incomplete_return_types\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_default_function_template_args) -"1" -#else -"0" -#endif -"cxx_default_function_template_args\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_defaulted_functions) -"1" -#else -"0" -#endif -"cxx_defaulted_functions\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_defaulted_functions) -"1" -#else -"0" -#endif -"cxx_defaulted_move_initializers\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_delegating_constructors) -"1" -#else -"0" -#endif -"cxx_delegating_constructors\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_deleted_functions) -"1" -#else -"0" -#endif -"cxx_deleted_functions\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_digit_separators\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_enum_forward_declarations\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_explicit_conversions) -"1" -#else -"0" -#endif -"cxx_explicit_conversions\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_extended_friend_declarations\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_extern_templates\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_override_control) -"1" -#else -"0" -#endif -"cxx_final\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_func_identifier\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_generalized_initializers) -"1" -#else -"0" -#endif -"cxx_generalized_initializers\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 501 && __cplusplus > 201103L -"1" -#else -"0" -#endif -"cxx_generic_lambdas\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_inheriting_constructors) -"1" -#else -"0" -#endif -"cxx_inheriting_constructors\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_inline_namespaces\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_lambdas) -"1" -#else -"0" -#endif -"cxx_lambdas\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_init_captures) -"1" -#else -"0" -#endif -"cxx_lambda_init_captures\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_local_type_template_args) -"1" -#else -"0" -#endif -"cxx_local_type_template_args\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_long_long_type\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_noexcept) -"1" -#else -"0" -#endif -"cxx_noexcept\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_nonstatic_member_init) -"1" -#else -"0" -#endif -"cxx_nonstatic_member_init\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_nullptr) -"1" -#else -"0" -#endif -"cxx_nullptr\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_override_control) -"1" -#else -"0" -#endif -"cxx_override\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_range_for) -"1" -#else -"0" -#endif -"cxx_range_for\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_raw_string_literals) -"1" -#else -"0" -#endif -"cxx_raw_string_literals\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_reference_qualified_functions) -"1" -#else -"0" -#endif -"cxx_reference_qualified_functions\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_relaxed_constexpr) -"1" -#else -"0" -#endif -"cxx_relaxed_constexpr\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_return_type_deduction) -"1" -#else -"0" -#endif -"cxx_return_type_deduction\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_right_angle_brackets\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_rvalue_references) -"1" -#else -"0" -#endif -"cxx_rvalue_references\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_sizeof_member\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_static_assert) -"1" -#else -"0" -#endif -"cxx_static_assert\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_strong_enums) -"1" -#else -"0" -#endif -"cxx_strong_enums\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 199711L -"1" -#else -"0" -#endif -"cxx_template_template_parameters\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_thread_local) -"1" -#else -"0" -#endif -"cxx_thread_local\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_trailing_return) -"1" -#else -"0" -#endif -"cxx_trailing_return_types\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_unicode_literals) -"1" -#else -"0" -#endif -"cxx_unicode_literals\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_generalized_initializers) -"1" -#else -"0" -#endif -"cxx_uniform_initialization\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_unrestricted_unions) -"1" -#else -"0" -#endif -"cxx_unrestricted_unions\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_user_literals) -"1" -#else -"0" -#endif -"cxx_user_literals\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_variable_templates) -"1" -#else -"0" -#endif -"cxx_variable_templates\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __cplusplus >= 201103L -"1" -#else -"0" -#endif -"cxx_variadic_macros\n" -"CXX_FEATURE:" -#if ((__clang_major__ * 100) + __clang_minor__) >= 400 && __has_feature(cxx_variadic_templates) -"1" -#else -"0" -#endif -"cxx_variadic_templates\n" - -}; - -int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/examples/abigen_test/build/CMakeFiles/progress.marks b/examples/abigen_test/build/CMakeFiles/progress.marks deleted file mode 100644 index 0cfbf08886f..00000000000 --- a/examples/abigen_test/build/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/examples/abigen_test/build/CMakeFiles/test.abi b/examples/abigen_test/build/CMakeFiles/test.abi deleted file mode 100644 index a2ea1bbfc41..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.abi +++ /dev/null @@ -1,106 +0,0 @@ -{ - "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Aug 30 18:00:10 2018", - "version": "eosio::abi/1.0", - "structs": [ - { - "name": "testa", - "base": "", - "fields": [ - { - "name": "fielda", - "type": "int32" - }, - { - "name": "fieldb", - "type": "float32" - }, - { - "name": "name", - "type": "name" - } - ] - }, - { - "name": "testacta", - "base": "", - "fields": [ - { - "name": "user", - "type": "name" - } - ] - }, - { - "name": "testactb", - "base": "", - "fields": [ - { - "name": "input", - "type": "testc" - } - ] - }, - { - "name": "testc", - "base": "testb", - "fields": [ - { - "name": "num", - "type": "uint64" - } - ] - }, - { - "name": "testtable", - "base": "", - "fields": [ - { - "name": "owner", - "type": "uint64" - }, - { - "name": "sec", - "type": "uint64" - }, - { - "name": "third", - "type": "uint64" - } - ] - } - ], - "types": [ - { - "new_type_name": "account_name", - "type": "name" - } - ], - "actions": [ - { - "name": "testa", - "type": "testa", - "ricardian_contract": "" - }, - { - "name": "testacta", - "type": "testacta", - "ricardian_contract": "" - }, - { - "name": "testactb", - "type": "testactb", - "ricardian_contract": "" - } - ], - "tables": [ - { - "name": "testtab", - "type": "testtable", - "index_type": "i64", - "key_names": ["owner"], - "key_types": ["uint64"] - } - ], - "ricardian_clauses": [], - "abi_extensions": [] -} \ No newline at end of file diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/CXX.includecache b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/CXX.includecache deleted file mode 100644 index 0c69d0c0bcf..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/CXX.includecache +++ /dev/null @@ -1,12 +0,0 @@ -#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) - -#IncludeRegexScan: ^.*$ - -#IncludeRegexComplain: ^$ - -#IncludeRegexTransform: - -/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/test.cpp -eosiolib/eosio.hpp -- - diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/DependInfo.cmake b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/DependInfo.cmake deleted file mode 100644 index 2f66896a753..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/DependInfo.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - "CXX" - ) -# The set of files for implicit dependencies of each language: -set(CMAKE_DEPENDS_CHECK_CXX - "/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/test.cpp" "/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/test.wasm.dir/test.cpp.o" - ) -set(CMAKE_CXX_COMPILER_ID "AppleClang") - -# The include file search paths: -set(CMAKE_CXX_TARGET_INCLUDE_PATH - ) - -# Targets to which this target links. -set(CMAKE_TARGET_LINKED_INFO_FILES - ) - -# Fortran module output directory. -set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/build.make b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/build.make deleted file mode 100644 index 6c747c18945..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/build.make +++ /dev/null @@ -1,98 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.12 - -# Delete rule output on recipe failure. -.DELETE_ON_ERROR: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/Cellar/cmake/3.12.0/bin/cmake - -# The command to remove a file. -RM = /usr/local/Cellar/cmake/3.12.0/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build - -# Include any dependencies generated for this target. -include CMakeFiles/test.wasm.dir/depend.make - -# Include the progress variables for this target. -include CMakeFiles/test.wasm.dir/progress.make - -# Include the compile flags for this target's objects. -include CMakeFiles/test.wasm.dir/flags.make - -CMakeFiles/test.wasm.dir/test.cpp.o: CMakeFiles/test.wasm.dir/flags.make -CMakeFiles/test.wasm.dir/test.cpp.o: ../test.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/test.wasm.dir/test.cpp.o" - /usr/local/eosio.wasmsdk//bin/eosio-cpp $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/test.wasm.dir/test.cpp.o -c /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/test.cpp - -CMakeFiles/test.wasm.dir/test.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/test.wasm.dir/test.cpp.i" - /usr/local/eosio.wasmsdk//bin/eosio-cpp $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/test.cpp > CMakeFiles/test.wasm.dir/test.cpp.i - -CMakeFiles/test.wasm.dir/test.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/test.wasm.dir/test.cpp.s" - /usr/local/eosio.wasmsdk//bin/eosio-cpp $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/test.cpp -o CMakeFiles/test.wasm.dir/test.cpp.s - -# Object files for target test.wasm -test_wasm_OBJECTS = \ -"CMakeFiles/test.wasm.dir/test.cpp.o" - -# External object files for target test.wasm -test_wasm_EXTERNAL_OBJECTS = - -test.wasm: CMakeFiles/test.wasm.dir/test.cpp.o -test.wasm: CMakeFiles/test.wasm.dir/build.make -test.wasm: CMakeFiles/test.wasm.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable test.wasm" - $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/test.wasm.dir/link.txt --verbose=$(VERBOSE) - -# Rule to build all files generated by this target. -CMakeFiles/test.wasm.dir/build: test.wasm - -.PHONY : CMakeFiles/test.wasm.dir/build - -CMakeFiles/test.wasm.dir/clean: - $(CMAKE_COMMAND) -P CMakeFiles/test.wasm.dir/cmake_clean.cmake -.PHONY : CMakeFiles/test.wasm.dir/clean - -CMakeFiles/test.wasm.dir/depend: - cd /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/test.wasm.dir/DependInfo.cmake --color=$(COLOR) -.PHONY : CMakeFiles/test.wasm.dir/depend - diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/cmake_clean.cmake b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/cmake_clean.cmake deleted file mode 100644 index 4a4f2343473..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/cmake_clean.cmake +++ /dev/null @@ -1,10 +0,0 @@ -file(REMOVE_RECURSE - "CMakeFiles/test.wasm.dir/test.cpp.o" - "test.wasm.pdb" - "test.wasm" -) - -# Per-language clean rules from dependency scanning. -foreach(lang CXX) - include(CMakeFiles/test.wasm.dir/cmake_clean_${lang}.cmake OPTIONAL) -endforeach() diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/depend.internal b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/depend.internal deleted file mode 100644 index 9317b13ac95..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/depend.internal +++ /dev/null @@ -1,5 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.12 - -CMakeFiles/test.wasm.dir/test.cpp.o - /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/test.cpp diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/depend.make b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/depend.make deleted file mode 100644 index 4afe9e87df6..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/depend.make +++ /dev/null @@ -1,5 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.12 - -CMakeFiles/test.wasm.dir/test.cpp.o: ../test.cpp - diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/flags.make b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/flags.make deleted file mode 100644 index 112db7e0b39..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/flags.make +++ /dev/null @@ -1,10 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.12 - -# compile CXX with /usr/local/eosio.wasmsdk//bin/eosio-cpp -CXX_FLAGS = -abigen -O3 -I/usr/local/include - -CXX_DEFINES = - -CXX_INCLUDES = - diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/link.txt b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/link.txt deleted file mode 100644 index ad597e29d3b..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/link.txt +++ /dev/null @@ -1 +0,0 @@ -/usr/local/eosio.wasmsdk//bin/eosio-ld CMakeFiles/test.wasm.dir/test.cpp.o -o test.wasm diff --git a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/progress.make b/examples/abigen_test/build/CMakeFiles/test.wasm.dir/progress.make deleted file mode 100644 index abadeb0c3ab..00000000000 --- a/examples/abigen_test/build/CMakeFiles/test.wasm.dir/progress.make +++ /dev/null @@ -1,3 +0,0 @@ -CMAKE_PROGRESS_1 = 1 -CMAKE_PROGRESS_2 = 2 - diff --git a/examples/abigen_test/build/Makefile b/examples/abigen_test/build/Makefile deleted file mode 100644 index 60b7aac75b1..00000000000 --- a/examples/abigen_test/build/Makefile +++ /dev/null @@ -1,178 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.12 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -# Allow only one "make -f Makefile2" at a time, but pass parallelism. -.NOTPARALLEL: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/local/Cellar/cmake/3.12.0/bin/cmake - -# The command to remove a file. -RM = /usr/local/Cellar/cmake/3.12.0/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/local/Cellar/cmake/3.12.0/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache - -.PHONY : rebuild_cache/fast - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/local/Cellar/cmake/3.12.0/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache - -.PHONY : edit_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles/progress.marks - $(MAKE) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean - -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named test.wasm - -# Build rule for target. -test.wasm: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 test.wasm -.PHONY : test.wasm - -# fast build rule for target. -test.wasm/fast: - $(MAKE) -f CMakeFiles/test.wasm.dir/build.make CMakeFiles/test.wasm.dir/build -.PHONY : test.wasm/fast - -test.o: test.cpp.o - -.PHONY : test.o - -# target to build an object file -test.cpp.o: - $(MAKE) -f CMakeFiles/test.wasm.dir/build.make CMakeFiles/test.wasm.dir/test.cpp.o -.PHONY : test.cpp.o - -test.i: test.cpp.i - -.PHONY : test.i - -# target to preprocess a source file -test.cpp.i: - $(MAKE) -f CMakeFiles/test.wasm.dir/build.make CMakeFiles/test.wasm.dir/test.cpp.i -.PHONY : test.cpp.i - -test.s: test.cpp.s - -.PHONY : test.s - -# target to generate assembly for a file -test.cpp.s: - $(MAKE) -f CMakeFiles/test.wasm.dir/build.make CMakeFiles/test.wasm.dir/test.cpp.s -.PHONY : test.cpp.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... rebuild_cache" - @echo "... edit_cache" - @echo "... test.wasm" - @echo "... test.o" - @echo "... test.i" - @echo "... test.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/examples/abigen_test/build/cmake_install.cmake b/examples/abigen_test/build/cmake_install.cmake deleted file mode 100644 index ff76f34f0a9..00000000000 --- a/examples/abigen_test/build/cmake_install.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# Install script for directory: /Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test - -# Set the install prefix -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/usr/local") -endif() -string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -# Set the install configuration name. -if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) - if(BUILD_TYPE) - string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" - CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") - else() - set(CMAKE_INSTALL_CONFIG_NAME "") - endif() - message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") -endif() - -# Set the component getting installed. -if(NOT CMAKE_INSTALL_COMPONENT) - if(COMPONENT) - message(STATUS "Install component: \"${COMPONENT}\"") - set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") - else() - set(CMAKE_INSTALL_COMPONENT) - endif() -endif() - -# Is this installation the result of a crosscompile? -if(NOT DEFINED CMAKE_CROSSCOMPILING) - set(CMAKE_CROSSCOMPILING "FALSE") -endif() - -if(CMAKE_INSTALL_COMPONENT) - set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") -else() - set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") -endif() - -string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT - "${CMAKE_INSTALL_MANIFEST_FILES}") -file(WRITE "/Users/judgefudge/eosio_wasmsdk/eosio.wasmsdk/examples/abigen_test/build/${CMAKE_INSTALL_MANIFEST}" - "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/examples/abigen_test/build/test.wasm b/examples/abigen_test/build/test.wasm deleted file mode 100755 index 1f5b309200dc7983cc1d8f0d6f31a2e4386dc024..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2745 zcma)8JB%Df5be+WytBiN`N=vH)C?zamaydLj7YqF5@#C=S$06W9`BCro&A4oeCTw0 zSOg^GCU=Yw5h6My2bUlrWF$w991#&B3+Z^(y?bZjz+ka6-CbSvUe&9*5yiAGg%I+i z_=cMA3jEB)4I$_Jf?qwi4~b2QQz35X-Cex!KDJ<@ewQ^}4(`><;j}Ys7Sm}tnF+~T zY0;W>hJ$9im=(=w=gU$kyFDq3cJrk(p?N##m;KggTX=Rcnsf%Usql{%0}=2dv?q5v zZbj2_*1Xvpwz{o5MQ6|)6_cW0&dSLYudQy`c1Y;<>&%WIz#$+c^)M1z=o5ZT*L=^H zBdN8orI5k9dM?f0zKG|-ym%m&kMOL=42F|!CE{lDPFakaH;ZYhWv%HlP!8H!`Ne3| z+ZOSOND3okRez)QS6auFZG8i*=JFH3 zl;$h%GVsat%}mu5T-ygJoUBx4G=?8U;dQE3fo~IZBOHcT%mF71IHHP_iBi4FtfDO7 z1X{PqLi$cjf;=PdR++>B-o`dA(2!qQOfg9c$UiCASqf69cK~Q<5I>X3cZBHmgaURP zEC>Z4Bpo4sfIzS$B$*IG9uq=-35D_812Fiw+EAzuX30=QF^ktvMN=rjw##sy=j z|C468q)CqE87b#bGO7h7b66yV!@9J(U^XQ&lwT9(>AoP5z7_xK$@&}sxQ2L$b+vDD zmB3S`2#WYcR3_cP9aIA4k;bb`IL>t!#PsP*I}z}`$0qkkT}9@&O!Z#HeXyt%ZM z%oT81wcrqLkxhQET)m3>ilMBlC|Bem8jP>7HH1eBmx-?%Zpiy%(i3*TuyV)_2e{%~ z9$Q%x1>d<$Gz65sjTaHe=AXmE!;o}0^MULDEVE!iHw&4~fytvxVHf}+lgXv|2KYIO zokdlC0`FVq(E|zTN=ptKd5wASy&ADWl|e9Or^@Smm>5Jo498Z$i4m7<&XGuD4Oh?_ z6>=C~MH_i+@39HEA)oGIWtot^%p9oBHQ@g*pQdDy6(-C%B>fo@r$|@i!|md}O|^~Z z*-o_n6vgZh4GXOr2p^#hkRaO>;(hCMjv2zvqKh`JT;bTv$OUytUV(@BJ6}d~rv@ge z8b+KIzcnB(gQPxbU?#};g2vlCc*>+Rj_{-bOiM+9g92y`_1(+83nKTKk4JvD zAyxs^Cv09!LhFKyyRdOGvoaCpG1>xpWGS*9Jhof(c8=0>J0m@I*Mj2Yqm}&? z{Owy{JA$npGH%mcF*3d6!HtdK$U%+}sw0H16FA1g=4FKFSc}p2I}jrNzG2bB-Uz7F z*3S+FFW!+FgAT~VLX8g}NMut&DCX&&#JFR*@N1Q6&5H4CnlTxnWE?^+ZW`GsWEU7I zm=4@3t|bvtaJMf8)iKt1UwSrWabq|rCzIiX+~?Q_Qz|AU4F|n#x>xi%ZMroX_Gxyf zq}+brkU67Eb-Sf_W27B?~m|#^m)I)QLD+0@Kcs; v`l6UpyPS4z53raGUAUViwP1;z;ugN&$bLat)7G#*>fxIXn5?T}R<^~z8(knK From 745074b4c161bd0dcb3eb23bf5d0d546a5d19323 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Thu, 30 Aug 2018 19:09:31 -0400 Subject: [PATCH 21/38] Update README.md --- README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 349d2cf7bac..89085f40ad9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,77 @@ WasmSDK is a toolchain for WebAssembly (WASM). In addition to being a general p - _eosio-cpp_, _eosio-cc_, _eosio-ld_, and _eosio-pp_ are set the core set of tools that you will interact with. * These are the C++ compiler, C compiler, linker and postpass tools. - A simple CMake interface to build EOSIO smart contracts against WasmSDK -- ABI generator (Coming Soon) +- ABI generator + +# How to use eosio-abigen +## using with eosio-cpp +To generate an abi with ```eosio-cpp```, the only flag you need to pass to ```eosio-cpp``` is `-abigen`, this will tell the compiler to run `eosio-abigen` after compilation and linking stages. If the output filename is specified as a '.wasm' file with the `-o` option (e.g. \.wasm) then eosio-cpp with tell the abi generator to create the abi with the name \.abi, if no '.wasm' suffix is used then the resulting output filename is still \.abi + +Example: +```bash +$ eosio-cpp hello.cpp -o hello.wasm -abigen +``` +This will generate two files: +* The compiled binary wasm (hello.wasm) +* The generated abi file (hello.abi) + +## using eosio-abigen alone +To generate an abi with ```eosio-abigen```, only requires that you give the main '.cpp' file to compile and the output filename `-output`. + +Example: +```bash +$ eosio-abigen hello.cpp -output=hello.abi +``` + +This will generate one file: +* The generated abi file (hello.abi) + +# Difference from old abi generator +Unlike the old abi generator tool, the new tool uses C++11 or GNU style attributes to mark ```actions``` and ```tables```. + +Example: +```c++ +// this is the C++11 and greater style attribute +[[eosio::action]] +void testa( account_name n ) { + // do something +} + +// this is the GNU style attribute, this can be used in C code and prior to C++ 11 +__attribute__((eosio_action)) +void testa( account_name n ){ + // do something +} + +struct [[eosio::action]] testa { + account_name n; + EOSLIB_SERIALIZE( testa, (n) ) +}; + +struct __attribute__((eosio_action)) testa { + account_name n; + EOSLIB_SERIALIZE( testa, (n) ) +}; +``` + +These are the four ways to declare an action, for abi generation. + +Example: +```c++ +struct [[eosio::table]] testtable { + uint64_t owner; + /* all other fields */ +}; + +struct __attribute__((eosio_table)) testtable { + uint64_t owner; + /* all other fields */ +}; + +typedef eosio::multi_index testtable_t; +``` + +These are the two ways to declare a table for abi generation. ### Guided Installation First clone From cfafc91c9a58025e704d0494778f36a47c5474f8 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Fri, 31 Aug 2018 12:33:55 -0400 Subject: [PATCH 22/38] Addressed requested changes from gleehokie --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 89085f40ad9..efbf65a9231 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ WasmSDK is a toolchain for WebAssembly (WASM). In addition to being a general p # How to use eosio-abigen ## using with eosio-cpp -To generate an abi with ```eosio-cpp```, the only flag you need to pass to ```eosio-cpp``` is `-abigen`, this will tell the compiler to run `eosio-abigen` after compilation and linking stages. If the output filename is specified as a '.wasm' file with the `-o` option (e.g. \.wasm) then eosio-cpp with tell the abi generator to create the abi with the name \.abi, if no '.wasm' suffix is used then the resulting output filename is still \.abi +To generate an abi with ```eosio-cpp```, the only flag you need to pass to ```eosio-cpp``` is `-abigen`, this will tell the compiler to run `eosio-abigen` after compilation and linking stages. If the output filename is specified as a '.wasm' file with the `-o` option (e.g. \.wasm) then eosio-cpp will tell the abi generator to create the abi with the name \.abi, if no '.wasm' suffix is used then the resulting output filename is still \.abi Example: ```bash @@ -39,7 +39,7 @@ This will generate one file: # Difference from old abi generator Unlike the old abi generator tool, the new tool uses C++11 or GNU style attributes to mark ```actions``` and ```tables```. -Example: +Example (four ways to declare an action for ABI generation): ```c++ // this is the C++11 and greater style attribute [[eosio::action]] @@ -64,9 +64,7 @@ struct __attribute__((eosio_action)) testa { }; ``` -These are the four ways to declare an action, for abi generation. - -Example: +Example (Two ways to declare a table for abi generation): ```c++ struct [[eosio::table]] testtable { uint64_t owner; @@ -79,9 +77,7 @@ struct __attribute__((eosio_table)) testtable { }; typedef eosio::multi_index testtable_t; -``` - -These are the two ways to declare a table for abi generation. +`` ### Guided Installation First clone From 4c20a27ef6122d1cf3ac251adbbcf7bf668b3e4a Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Mon, 3 Sep 2018 22:49:48 -0400 Subject: [PATCH 23/38] added optional action/table name attr arg --- eosio_llvm | 2 +- examples/abigen_test/test.cpp | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/eosio_llvm b/eosio_llvm index c43645c50f1..29b4f57c9b7 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit c43645c50f1b85c424750207acb884a1ed26301b +Subproject commit 29b4f57c9b7611316eeb08a6e2f5dbeb09a19b4c diff --git a/examples/abigen_test/test.cpp b/examples/abigen_test/test.cpp index a0c105fbc3c..75c6e0d0626 100644 --- a/examples/abigen_test/test.cpp +++ b/examples/abigen_test/test.cpp @@ -8,10 +8,12 @@ namespace test { float fieldb; account_name name; }; + struct testb { void printll() { print("testb"); } }; - struct testc : testb { + + struct [[ eosio::action("testc") ]] test_c : testb { uint64_t num; }; } @@ -20,13 +22,13 @@ class test_contract : public eosio::contract { public: using contract::contract; - [[ eosio::action ]] - void testacta( account_name user ) { + [[ eosio::action("testacta") ]] + void testact_a( account_name user ) { print( "Hello, ", name{user} ); } [[ eosio::action ]] - void testactb( test::testc input ) { + void testactb( test::test_c input ) { print(input.num); } @@ -36,9 +38,16 @@ class test_contract : public eosio::contract { uint64_t third; uint64_t primary_key() const { return owner; } }; + struct [[eosio::table("testtab2")]] test_table2 { + uint64_t owner; + uint64_t sec; + uint64_t third; + uint64_t primary_key() const { return owner; } + }; }; typedef eosio::multi_index< N(testtab), test_contract::testtable > testtable_t; +typedef eosio::multi_index< N(testtab2), test_contract::test_table2 > testtable2_t; // note that the N(testtabb) is the same as the explicit name given to eosio::table // NOTE THIS IS A TEST CONTRACT AND WILL NOT WORK CORRECTLY, the action `testa` will not be in the dispatcher of this macro -EOSIO_ABI( test_contract, (testacta)(testactb) ) +EOSIO_ABI( test_contract, (testact_a)(testactb) ) From 6fa879b70551336b8658ec723fec870e6a64d8a6 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Mon, 3 Sep 2018 22:52:23 -0400 Subject: [PATCH 24/38] reverted hello back to a basic example --- examples/hello/hello.cpp | 47 ---------------------------------------- 1 file changed, 47 deletions(-) diff --git a/examples/hello/hello.cpp b/examples/hello/hello.cpp index 84593eda71c..6e75717eba1 100644 --- a/examples/hello/hello.cpp +++ b/examples/hello/hello.cpp @@ -11,50 +11,3 @@ class hello : public eosio::contract { }; EOSIO_ABI( hello, (hi) ) - -#include -using namespace eosio; - -namespace test { - struct [[ eosio::action ]] ae { - void printddd() { print("osss"); } - int cc; - float ee; - account_name name; - }; - struct dc { - void printll() { print("eoo"); } - }; - struct bb : dc { - uint64_t c; - }; -} - -class hello : public eosio::contract { - public: - using contract::contract; - - [[ eosio::action ]] - void hi( account_name user ) { - print( "Hello, ", name{user} ); - } - - [[ eosio::action ]] - void hey( aaa::bb input ) { - print(input.c); - } - - struct [[eosio::table]] test { - uint64_t owner; - uint64_t sec; - uint64_t third; - uint64_t primary_key() const { return owner; } - uint64_t by_sec() const { return sec; } - uint64_t by_another() const { return third; } - }; -}; - -typedef eosio::multi_index< N(hoosh), hello::test, indexed_by>> ttable; -//using ttable = eosio::multi_index< N(hoosh), hello::test>; - -EOSIO_ABI( hello, (hi) ) From f50685272a9ab5e278f678b0844c01ecb749529b Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Mon, 3 Sep 2018 23:24:01 -0400 Subject: [PATCH 25/38] updated README, addressed change requests and added note about valid action/table names --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index efbf65a9231..3efae5bbfbc 100644 --- a/README.md +++ b/README.md @@ -19,18 +19,18 @@ To generate an abi with ```eosio-cpp```, the only flag you need to pass to ```eo Example: ```bash -$ eosio-cpp hello.cpp -o hello.wasm -abigen +$ eosio-cpp hello.cpp -o hello.wasm --abigen ``` This will generate two files: * The compiled binary wasm (hello.wasm) * The generated abi file (hello.abi) ## using eosio-abigen alone -To generate an abi with ```eosio-abigen```, only requires that you give the main '.cpp' file to compile and the output filename `-output`. +To generate an abi with ```eosio-abigen```, only requires that you give the main '.cpp' file to compile and the output filename `--output`. Example: ```bash -$ eosio-abigen hello.cpp -output=hello.abi +$ eosio-abigen hello.cpp --output=hello.abi ``` This will generate one file: @@ -63,6 +63,7 @@ struct __attribute__((eosio_action)) testa { EOSLIB_SERIALIZE( testa, (n) ) }; ``` +If your action name is not a valid [EOSIO name](https://developers.eos.io/eosio-cpp/docs/naming-conventions) you can explicitly specify the name in the attribute ```c++ [[eosio::action("")]]``` Example (Two ways to declare a table for abi generation): ```c++ @@ -77,7 +78,10 @@ struct __attribute__((eosio_table)) testtable { }; typedef eosio::multi_index testtable_t; -`` +``` +As with actions, if your table name is not a valid [EOSIO name](https://developers.eos.io/eosio-cpp/docs/naming-conventions) you can explicitly specify the name in the attribute ```c++ [[eosio::table("")]]``` + +For an example contract of abi generation please see the file ./examples/abigen_test/test.cpp, you can generate the abi for this file with `eosio-abigen test.cpp --output=test.abi`. ### Guided Installation First clone From ee67b1af3bc155bb3cb27559f893f79a78eea77f Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 4 Sep 2018 00:43:24 -0400 Subject: [PATCH 26/38] rename to eosio.cdt --- CMakeLists.txt | 4 ++-- ClangExternalProject.txt | 2 +- README.md | 2 +- build.sh | 4 ++-- install.sh | 7 ++++--- modules/EosioWasmToolchainBuild.cmake.in | 2 +- uninstall.sh | 24 ++++++++++++++++++++++++ 7 files changed, 35 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0530627ab1d..c1c8589b4cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ set(VERSION_MINOR 1) set(VERSION_PATCH 1) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.wasmsdk") - set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/eosio.wasmsdk") + message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") + set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/eosio.cdt") elseif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") message(WARNING "CMAKE_INSTALL_PREFIX is explicitly set to /usr/local. This is not recommended.") endif() diff --git a/ClangExternalProject.txt b/ClangExternalProject.txt index e8faad8a088..4c7569ff6a0 100644 --- a/ClangExternalProject.txt +++ b/ClangExternalProject.txt @@ -4,7 +4,7 @@ include(GNUInstallDirs) ExternalProject_Add( EosioClang - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/llvm -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=${BOOST_ROOT} -DSDK_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DEOSIO_VER_MAJOR=${VERSION_MAJOR} -DEOSIO_VER_MINOR=${VERSION_MINOR} -DEOSIO_VER_REVISION=${VERSION_PATCH} -DEOSIO_STACK_SIZE=8192 + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/llvm -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=${BOOST_ROOT} -DEOSIO_VER_MAJOR=${VERSION_MAJOR} -DEOSIO_VER_MINOR=${VERSION_MINOR} -DEOSIO_VER_REVISION=${VERSION_PATCH} -DEOSIO_STACK_SIZE=8192 SOURCE_DIR "${CMAKE_SOURCE_DIR}/eosio_llvm" UPDATE_COMMAND "" diff --git a/README.md b/README.md index 349d2cf7bac..ba301f9f42d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# WasmSDK +#CDT ## Version : 1.1.1 WasmSDK is a toolchain for WebAssembly (WASM). In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that the SDK has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete. diff --git a/build.sh b/build.sh index 6f7c8eb6839..700502de7fd 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #! /bin/bash -printf "\t=========== Building eosio.wasmsdk ===========\n\n" +printf "\t=========== Building eosio.cdt ===========\n\n" RED='\033[0;31m' NC='\033[0m' @@ -82,7 +82,7 @@ fi mkdir -p build pushd build &> /dev/null -cmake -DCMAKE_INSTALL_PREFIX=/usr/local/eosio.wasmsdk -DBOOST_ROOT="${BOOST}" -DCORE_SYMBOL_NAME="${CORE_SYMBOL}" ../ +cmake -DCMAKE_INSTALL_PREFIX=/usr/local/eosio.cdt -DBOOST_ROOT="${BOOST}" -DCORE_SYMBOL_NAME="${CORE_SYMBOL}" ../ if [ $? -ne 0 ]; then exit -1; fi diff --git a/install.sh b/install.sh index 8f7f5ad069a..32903d14ca3 100755 --- a/install.sh +++ b/install.sh @@ -40,7 +40,7 @@ BUILD_DIR="${PWD}/build" CMAKE_BUILD_TYPE=Release TIME_BEGIN=$( date -u +%s ) - INSTALL_PREFIX="/usr/local/eosio.wasmsdk" + INSTALL_PREFIX="/usr/local/eosio.cdt" VERSION=1.2 txtbld=$(tput bold) @@ -49,12 +49,12 @@ create_symlink() { pushd /usr/local/bin &> /dev/null - ln -sf ../eosio.wasmsdk/bin/$1 $2 + ln -sf ../eosio.cdt/bin/$1 $2 popd &> /dev/null } install_symlinks() { - printf "\\n\\tInstalling EOSIO.WasmSDK Binary Symlinks\\n\\n" + printf "\\n\\tInstalling EOSIO.CDT Binary Symlinks\\n\\n" create_symlink "llvm-ranlib eosio-ranlib" create_symlink "llvm-ar eosio-ar" create_symlink "llvm-objdump eosio-objdump" @@ -86,6 +86,7 @@ popd &> /dev/null install_symlinks + cp /usr/local/eosio.cdt/lib/cmake printf "\n${bldred}\t ___ ___ ___ ___\n" printf "\t / /\\ / /\\ / /\\ ___ / /\\ \n" printf "\t / /:/_ / /::\\ / /:/_ / /\\ / /::\\ \n" diff --git a/modules/EosioWasmToolchainBuild.cmake.in b/modules/EosioWasmToolchainBuild.cmake.in index b9b2a4a0415..fab7ca40118 100644 --- a/modules/EosioWasmToolchainBuild.cmake.in +++ b/modules/EosioWasmToolchainBuild.cmake.in @@ -24,5 +24,5 @@ set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) # hack for OSX -set(CMAKE_OSX_SYSROOT="${CLANG_DIR}/eosio.wasmsdk") +set(CMAKE_OSX_SYSROOT="${CLANG_DIR}/eosio.cdt") set(CMAKE_OSX_DEPLOYMENT_TARGET="") diff --git a/uninstall.sh b/uninstall.sh index e1c3d0c521e..c185285e1fa 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -4,11 +4,34 @@ binaries=(eosio-ranlib eosio-ar eosio-objdump eosio-readelf + eosio-abigen + eosio-wasm2wast + eosio-wast2wasm eosio-pp eosio-cc eosio-cpp eosio-ld) +if [ -d "/usr/local/eosio.cdt" ]; then + printf "\tDo you wish to remove this install? (requires sudo)\n" + select yn in "Yes" "No"; do + case $yn in + [Yy]* ) + pushd /usr/local &> /dev/null + rm -rf eosio.cdt + pushd bin &> /dev/null + for binary in ${binaries[@]}; do + rm ${binary} + done + popd &> /dev/null + break;; + [Nn]* ) + printf "\tAborting uninstall\n\n" + exit -1;; + esac + done +fi + if [ -d "/usr/local/eosio.wasmsdk" ]; then printf "\tDo you wish to remove this install? (requires sudo)\n" select yn in "Yes" "No"; do @@ -22,6 +45,7 @@ if [ -d "/usr/local/eosio.wasmsdk" ]; then done popd &> /dev/null break;; + [Nn]* ) printf "\tAborting uninstall\n\n" exit -1;; From 19b6513223c831e7003db785ce45de6d0649f2eb Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 4 Sep 2018 09:53:34 -0400 Subject: [PATCH 27/38] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3efae5bbfbc..bde702b2b34 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ struct __attribute__((eosio_table)) testtable { typedef eosio::multi_index testtable_t; ``` -As with actions, if your table name is not a valid [EOSIO name](https://developers.eos.io/eosio-cpp/docs/naming-conventions) you can explicitly specify the name in the attribute ```c++ [[eosio::table("")]]``` +If you don't want to use the multi-index you can explicitly specify the name in the attribute ```c++ [[eosio::table("")]]``` For an example contract of abi generation please see the file ./examples/abigen_test/test.cpp, you can generate the abi for this file with `eosio-abigen test.cpp --output=test.abi`. From 22a568684c6cc79e91165a1c7ad1602f17a37b8a Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 4 Sep 2018 09:59:58 -0400 Subject: [PATCH 28/38] Update README.md --- README.md | 75 +++---------------------------------------------------- 1 file changed, 4 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index 382ad7c6178..c3433875c7c 100644 --- a/README.md +++ b/README.md @@ -53,77 +53,8 @@ $ eosio-cpp hello.cpp -o hello.wasm ### Fixing an ABI, or Writing an ABI - The sections to the abi are pretty simple to understand and the syntax is purely JSON, so we are going to write our own ABI file. - Even after ABI generation is available, an important note should be made that the generator will never be completely perfect for every contract written, advanced features of the newest version of the ABI will require manual construction of the ABI, and odd and advanced C++ patterns could capsize the generators type deductions, so having a good knowledge of how to write an ABI should be an essential piece of knowledge of a smart contract writer. -- For more in-depth documentation please refer to [developers.eos.io "How to write an abi"](https://developers.eos.io/eosio-cpp/docs/how-to-write-an-abi) -#### A Simplified View of The Structure of An ABI -```json -{ - "version": "eosio::abi/1.0", - "types": [ - { - "new_type_name": "", - "type": "" - } - ], - "structs": [{ - "name": "", - "base": "", - "fields": [{ - "name": "", - "type": "" - } - ] - } - ], - "actions": [{ - "name": "", - "type": "", - "ricardian_contract": "" - } - ], - "tables": [{ - "name": "
", - "type": "", - "index_type": "i64", - "key_names": [""], - "key_types": [""] - }], - "ricardian_clauses": [{} - ], - "error_messages": [], - "abi_extensions": [] -} -``` -- Let's unpack what each one these means -##### abi structure :: types -- ```types``` is a JSON array of objects, where each object has two fields (`new_type_name` and `type`) -- If in your smart contract you would like to use a `typedef` of some type to another, simply add those to here. Where `new_type_name` is the new type name and `type` is simply what you are aliasing from. -##### abi structure :: structs -- ```structs``` is a JSON array of objects, where each object has three fields ( `name`, `base` and `fields` ) -- If in your smart contract you create a new structure that is not one supplied by `eosiolib`, we are going to express that here. Some confusion will ultimately arise if using the `EOSIO_ABI` macro and the method style of writing your actions, [developers.eos.io "The ABI Macro & Apply"](https://developers.eos.io/eosio-cpp/docs/abi) and ["Creating an Action"](https://developers.eos.io/eosio-cpp/docs/this-does-not-exist), because the implicitly generated ```action``` class will go here too. -- `name` is the stripped name of the struct/class (i.e. no namespaces, just the name of the class), if using the method style, this is the name of the method. -- `base` is what class that class inherits from (same thing only the stripped name), or "" if it doesn't inherit from any class. For the method style this is always "". -- `fields` is a JSON array of objects with two fields (`name` and `type`), these express the fields of the class we are referencing. For the method approach, these will be the arguments to your method. - - `name` is the field name and `type` is the type of said field. -##### abi structure :: actions -- ```actions``` is a JSON array of objects, where each object has three fields (`name`, `type` and `ricardian_contract`) -- `name` is the name of the action, i.e. the name you would use with `push action` -- `type` is the type of that action, if you are using the method style and the `EOSIO_ABI` macro, then this is the name of your action method. If you are using the struct approach, then this is simply the name of the struct. -- `ricardian_contract` is a plain text contract that is cryptographically linked to each action, the full explanation of this is way beyond the scope of this readme. -##### abi structure :: tables -- ```tables``` is a JSON array of objects, where each object has five fields (`name`, `type`, `index_type`, `key_names`, `key_types`) -- `name` is the name of the table that is given the multi_index typedef, this will be the name that is used by the ```get_table_rows``` RPC and by ```cleos get table``` command. -- `type` is the struct/class type name that is being used as the table. -- `index_type` is always "i64", this is a holdover and will be deprecated. -- `key_names` is a JSON array of strings and is the name of the variable of primary key, this will be deprecated. -- `key_types` is a JSON array of strings and is the type name associated with each element in `key_names`, this will be deprecated. -##### abi structure :: ricardian_clauses -- ```ricardian_clauses``` is a JSON array of objects, where each object has two fields (`id` and `body`) -- `id` is an identifier you would like to use with that clause -- `body` is the main body of the clause -- as with `ricardian_contracts`, any real explanation of these is beyond the scope of this readme. -##### abi structure :: error_messages -##### abi structure :: abi_extensions -- For now you can ignore these two objects +- Please refer to [developers.eos.io "How to write an abi"](https://developers.eos.io/eosio-cpp/docs/how-to-write-an-abi), to learn about the different sections of an ABI. + ### Installed Tools --- @@ -131,6 +62,8 @@ $ eosio-cpp hello.cpp -o hello.wasm * [eosio-cc](#eosio-cc) * [eosio-ld](#eosio-ld) * eosio-pp (post processing pass for WASM, automatically runs with eosio-cpp and eosio-ld) +* eosio-wasm2wast +* eosio-wast2wasm * eosio-ranlib * eosio-ar * eosio-objdump From df7b9584cd957c53f1561ff64e03ff7e254bb85e Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 4 Sep 2018 14:10:55 -0400 Subject: [PATCH 29/38] Update build.sh --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index 6f7c8eb6839..12798cbcd74 100755 --- a/build.sh +++ b/build.sh @@ -50,6 +50,10 @@ else export ARCH="Ubuntu" bash ./scripts/eosio_build_ubuntu.sh ;; + "Debian GNU/Linux") + export ARCH="Debian" + bash ./scripts/eosio_build_ubuntu.sh + ;; *) printf "\\n\\tUnsupported Linux Distribution. Exiting now.\\n\\n" exit 1 From 03a35affa8b40a428f15be7789b088c398b8297e Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Tue, 4 Sep 2018 16:08:59 -0400 Subject: [PATCH 30/38] removed generation of deprecated fields, and changed some semantics of eosio::table --- eosio_llvm | 2 +- examples/abigen_test/test.cpp | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/eosio_llvm b/eosio_llvm index 29b4f57c9b7..af6f920bfbb 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit 29b4f57c9b7611316eeb08a6e2f5dbeb09a19b4c +Subproject commit af6f920bfbb0b52c51b1b9da5e67555693400118 diff --git a/examples/abigen_test/test.cpp b/examples/abigen_test/test.cpp index 75c6e0d0626..2ad60e5ba77 100644 --- a/examples/abigen_test/test.cpp +++ b/examples/abigen_test/test.cpp @@ -2,6 +2,7 @@ using namespace eosio; namespace test { + // mark this struct as an action struct [[ eosio::action ]] testa { void printddd() { print("testa"); } int fielda; @@ -12,7 +13,8 @@ namespace test { struct testb { void printll() { print("testb"); } }; - + + // mark this struct as an action and specify the name explicitly struct [[ eosio::action("testc") ]] test_c : testb { uint64_t num; }; @@ -21,24 +23,28 @@ namespace test { class test_contract : public eosio::contract { public: using contract::contract; - + + // mark this method as an action and specify the name explicity [[ eosio::action("testacta") ]] void testact_a( account_name user ) { print( "Hello, ", name{user} ); } - + + // mark this method as an action [[ eosio::action ]] void testactb( test::test_c input ) { print(input.num); } - + + // mark this struct as a table and allow multi_index typedefs to define the tables struct [[eosio::table]] testtable { uint64_t owner; - uint64_t sec; uint64_t third; uint64_t primary_key() const { return owner; } }; - struct [[eosio::table("testtab2")]] test_table2 { + + // mark this struct as a table and allow multi_index typedefs to define the tables, and specify a primitive table (non multi_index) with an explicit name + struct [[eosio::table("testtabb")]] test_table2 { uint64_t owner; uint64_t sec; uint64_t third; @@ -47,7 +53,8 @@ class test_contract : public eosio::contract { }; typedef eosio::multi_index< N(testtab), test_contract::testtable > testtable_t; -typedef eosio::multi_index< N(testtab2), test_contract::test_table2 > testtable2_t; // note that the N(testtabb) is the same as the explicit name given to eosio::table +typedef eosio::multi_index< N(testtaba), test_contract::testtable > testtable_a_t; +typedef eosio::multi_index< N(testtab2), test_contract::test_table2 > testtable2_t; // NOTE THIS IS A TEST CONTRACT AND WILL NOT WORK CORRECTLY, the action `testa` will not be in the dispatcher of this macro EOSIO_ABI( test_contract, (testact_a)(testactb) ) From fcf1c03cd6103644d73094136b3ba4819b0ea285 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 5 Sep 2018 09:42:01 -0400 Subject: [PATCH 31/38] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5abfcc3751b..c226c431333 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,4 +53,4 @@ configure_file(${CMAKE_SOURCE_DIR}/eosio.imports.in ${CMAKE_BINARY_DIR}/eosio.im install(FILES ${CMAKE_BINARY_DIR}/eosio.imports DESTINATION ${CMAKE_INSTALL_PREFIX}) configure_file(${CMAKE_SOURCE_DIR}/scripts/ricardeos/ricardeos.py ${CMAKE_BINARY_DIR}/scripts/ricardeos.py COPYONLY) -install(FILES ${CMAKE_BINARY_DIR}/ricardeos.py DESTINATION ${CMAKE_INSTALL_PREFIX}/scripts) +install(FILES ${CMAKE_BINARY_DIR}/scripts/ricardeos.py DESTINATION ${CMAKE_INSTALL_PREFIX}/scripts) From 50ec1a8a53416f67db02e68adb95a32c6228b293 Mon Sep 17 00:00:00 2001 From: arhag Date: Wed, 5 Sep 2018 14:22:11 -0400 Subject: [PATCH 32/38] typos and cleanup in ricardeos README --- scripts/ricardeos/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ricardeos/README.md b/scripts/ricardeos/README.md index 32ba8205ec4..dde70e84930 100644 --- a/scripts/ricardeos/README.md +++ b/scripts/ricardeos/README.md @@ -1,20 +1,20 @@ # Purpose -The `ricardeos.py` imports or exports ricardian contracts to and from a contracts abi +The `ricardeos.py` imports or exports Ricardian contracts to and from a contract's ABI file. ## Import Example -`$ python3 ricardeos.py import /path/to/sorce-contract.abi /path/to/new-smart-contract-abi.abi` +`$ python3 ricardeos.py import /path/to/source-contract.abi /path/to/new-smart-contract-abi.abi` -Running this will scan the directory of the abi for all rc.md files and add them to their respective actions. All files with a path format of *clause*-rc.md will be added to the ricardian_clauses section. You can provide the same name for the source and new smart contract abi, the script will prompt you before overwriting. +Running this will scan the directory of the ABI for all rc.md files and add them to their respective actions. All files with a path format of *clause*-rc.md will be added to the `ricardian_clauses` section. You can provide the same name for the source and new smart contract ABI, the script will prompt you before overwriting. The script will also notify the user of any actions that the script cannot find rc.md files for. ## Export Example -`$ python3 ricardeos.py export /path/to/sorce-contract.abi` +`$ python3 ricardeos.py export /path/to/source-contract.abi` -Running this will dump the contents of all ricardian contracts: +Running this will dump the contents of all Ricardian contracts: Actions will be exported in the following format: `--rc.md` Clauses will be exported in the following format: `-clause--rc.md` -If a file already exists the user will be asked if they wish to overwrite the file +If a file already exists the user will be asked if they wish to overwrite the file. From f298439cae8826a0446e5e676b39f0fac53a93f7 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 5 Sep 2018 14:22:33 -0400 Subject: [PATCH 33/38] Update README.md --- README.md | 118 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 103 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c3433875c7c..4edd3e29f8f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,16 @@ -# WasmSDK -## Version : 1.1.1 +# EOSIO.CDT (Contract Development Toolkit) +## Version : 1.2.0 -WasmSDK is a toolchain for WebAssembly (WASM). In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that the SDK has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete. +EOSIO.CDT is a toolchain for WebAssembly (WASM) and set of tools to facilitate contract writing for the EOSIO platform. In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that the SDK has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete. ## New Features from EOSIO - Compile (-c) option flag will compile to a WASM-elf object file - ranlib and ar support for static libraries for WASM - \_\_FILE\_\_ and \_\_BASE\_FILE\_\_ will now only return the file name and not the fullpath. This eliminates any non-determinism from location of the compiled binary - Global constructors and global destructors are now supported -- _eosio-cpp_, _eosio-cc_, _eosio-ld_, and _eosio-pp_ are set the core set of tools that you will interact with. - * These are the C++ compiler, C compiler, linker and postpass tools. -- A simple CMake interface to build EOSIO smart contracts against WasmSDK -- ABI generator (Coming Soon) +- _eosio-cpp_, _eosio-cc_, _eosio-ld_, _eosio-pp_, and _eosio_abigen_ are set the core set of tools that you will interact with. + * These are the C++ compiler, C compiler, linker, postpass tool and ABI generator. +- A simple CMake interface to build EOSIO smart contracts against EOSIO.CDT ### Guided Installation First clone @@ -50,6 +49,76 @@ $ eosio-cpp hello.cpp -o hello.wasm - Now simply run ```make```. - You should now have a `hello` file in the build directory, this is the wasm file, if you would like to use ```cleos set contract``` and you need to change the name to have the .wasm extension that is perfectly fine, or you can change the add_executable target name to ```hello.wasm```, or you can use ```cleos set code /hello``` to load the file to the blockchain , without the .wasm extension. +### How to use eosio-abigen +#### using with eosio-cpp +To generate an abi with ```eosio-cpp```, the only flag you need to pass to ```eosio-cpp``` is `-abigen`, this will tell the compiler to run `eosio-abigen` after compilation and linking stages. If the output filename is specified as a '.wasm' file with the `-o` option (e.g. \.wasm) then eosio-cpp will tell the abi generator to create the abi with the name \.abi, if no '.wasm' suffix is used then the resulting output filename is still \.abi + +Example: +```bash +$ eosio-cpp hello.cpp -o hello.wasm --abigen +``` +This will generate two files: +* The compiled binary wasm (hello.wasm) +* The generated abi file (hello.abi) + +#### using eosio-abigen alone +To generate an abi with ```eosio-abigen```, only requires that you give the main '.cpp' file to compile and the output filename `--output`. + +Example: +```bash +$ eosio-abigen hello.cpp --output=hello.abi +``` + +This will generate one file: +* The generated abi file (hello.abi) + +### Difference from old abi generator +Unlike the old abi generator tool, the new tool uses C++11 or GNU style attributes to mark ```actions``` and ```tables```. + +Example (four ways to declare an action for ABI generation): +```c++ +// this is the C++11 and greater style attribute +[[eosio::action]] +void testa( account_name n ) { + // do something +} + +// this is the GNU style attribute, this can be used in C code and prior to C++ 11 +__attribute__((eosio_action)) +void testa( account_name n ){ + // do something +} + +struct [[eosio::action]] testa { + account_name n; + EOSLIB_SERIALIZE( testa, (n) ) +}; + +struct __attribute__((eosio_action)) testa { + account_name n; + EOSLIB_SERIALIZE( testa, (n) ) +}; +``` +If your action name is not a valid [EOSIO name](https://developers.eos.io/eosio-cpp/docs/naming-conventions) you can explicitly specify the name in the attribute ```c++ [[eosio::action("")]]``` + +Example (Two ways to declare a table for abi generation): +```c++ +struct [[eosio::table]] testtable { + uint64_t owner; + /* all other fields */ +}; + +struct __attribute__((eosio_table)) testtable { + uint64_t owner; + /* all other fields */ +}; + +typedef eosio::multi_index testtable_t; +``` +If you don't want to use the multi-index you can explicitly specify the name in the attribute ```c++ [[eosio::table("")]]``` + +For an example contract of abi generation please see the file ./examples/abigen_test/test.cpp, you can generate the abi for this file with `eosio-abigen test.cpp --output=test.abi`. + ### Fixing an ABI, or Writing an ABI - The sections to the abi are pretty simple to understand and the syntax is purely JSON, so we are going to write our own ABI file. - Even after ABI generation is available, an important note should be made that the generator will never be completely perfect for every contract written, advanced features of the newest version of the ABI will require manual construction of the ABI, and odd and advanced C++ patterns could capsize the generators type deductions, so having a good knowledge of how to write an ABI should be an essential piece of knowledge of a smart contract writer. @@ -61,6 +130,7 @@ $ eosio-cpp hello.cpp -o hello.wasm * [eosio-cpp](#eosio-cpp) * [eosio-cc](#eosio-cc) * [eosio-ld](#eosio-ld) +* eosio-abigen * eosio-pp (post processing pass for WASM, automatically runs with eosio-cpp and eosio-ld) * eosio-wasm2wast * eosio-wast2wasm @@ -78,10 +148,10 @@ For example: cmake_minimum_required(VERSION 3.5) project(test_example VERSION 1.0.0) -if(EOSIO_WASMSDK_ROOT STREQUAL "" OR NOT EOSIO_WASMSDK_ROOT) - set(EOSIO_WASMSDK_ROOT "/usr/local/eosio.wasmsdk") +if(EOSIO_CDT_ROOT STREQUAL "" OR NOT EOSIO_CDT_ROOT) + set(EOSIO_CDT_ROOT "/usr/local/eosio.cdt") endif() -list(APPEND CMAKE_MODULE_PATH ${EOSIO_WASMSDK_ROOT}/lib/cmake) +list(APPEND CMAKE_MODULE_PATH ${EOSIO_CDT_ROOT}/lib/cmake) include(EosioWasmToolchain) add_executable( test.wasm test.cpp ) @@ -99,7 +169,7 @@ public: EOSIO_ABI( test, (test_action)) ``` -Since, EosioWasmToolchain overwrites `cmake` to cross-compile WASM, standard cmake commands of _add\_executable/ add\_library_ can then be used. Also note, the __WASM_ROOT__ variable, this needs to be set if you decided to install to the non-default location. +Since, EosioWasmToolchain overwrites `cmake` to cross-compile WASM, standard cmake commands of _add\_executable/ add\_library_ can then be used. Also note, the __EOSIO_CDT_ROOT__ variable, this needs to be set if you decided to install to the non-default location. To manually compile source code: Use ```eosio-cpp/eosio-cc``` and ```eosio-ld``` as if it were __clang__ and __lld__ , with all includes and options specific to EOSIO and WasmSDK being baked in. @@ -182,10 +252,28 @@ eosio.ld options: -lto-opt= - LTO Optimization level (O0-O3) -o= - Write output to ``` - - ### Todos - --- - - Add ABI generation to eosio.wasmsdk + +### eosio-abigen +--- +```bash +USAGE: eosio-abigen [options] [... ] + +OPTIONS: + +Generic Options: + + -help - Display available options (-help-hidden for more) + -help-list - Display list of available options (-help-list-hidden for more) + -version - Display the version of this program + +eosio-abigen: +generates an abi from C++ project input + + -extra-arg= - Additional argument to append to the compiler command line + -extra-arg-before= - Additional argument to prepend to the compiler command line + -output= - Set the output filename and fullpath + -p= - Build path +``` License ---- From e35e6b60fa7f228633b4602df7b63719ece4b8a2 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 5 Sep 2018 18:25:05 -0400 Subject: [PATCH 34/38] Missed some things --- README.md | 8 ++++---- install.sh | 2 +- modules/EosioWasmToolchain.cmake.in | 1 + modules/EosioWasmToolchainBuild.cmake.in | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bcebc0bc712..055f41310ff 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,8 @@ For an example contract of abi generation please see the file ./examples/abigen_ First clone ```sh -$ git clone --recursive https://github.com/eosio/eosio.wasmsdk -$ cd eosio.wasmsdk +$ git clone --recursive https://github.com/eosio/eosio.cdt +$ cd eosio.cdt ``` Now run `build.sh` and give the core symbol for the EOSIO blockchain that intend to deploy to. @@ -98,7 +98,7 @@ $ ./build.sh ``` Finally, install the build - *This install will install the core to ```/usr/local/eosio.wasmsdk``` and symlinks to the top level tools (compiler, ld, etc.) to ```/usr/local/bin``` + *This install will install the core to ```/usr/local/eosio.cdt``` and symlinks to the top level tools (compiler, ld, etc.) to ```/usr/local/bin``` ```sh $ sudo ./install.sh ``` @@ -147,7 +147,7 @@ EOSIO_ABI( test, (test_action)) Since, EosioWasmToolchain overwrites `cmake` to cross-compile WASM, standard cmake commands of _add\_executable/ add\_library_ can then be used. Also note, the __WASM_ROOT__ variable, this needs to be set if you decided to install to the non-default location. To manually compile source code: -Use ```eosio-cpp/eosio-cc``` and ```eosio-ld``` as if it were __clang__ and __lld__ , with all includes and options specific to EOSIO and WasmSDK being baked in. +Use ```eosio-cpp/eosio-cc``` and ```eosio-ld``` as if it were __clang__ and __lld__ , with all includes and options specific to EOSIO and CDT being baked in. ### eosio-cpp --- diff --git a/install.sh b/install.sh index f3f7bb41507..30db51d065c 100755 --- a/install.sh +++ b/install.sh @@ -87,7 +87,7 @@ popd &> /dev/null install_symlinks - cp /usr/local/eosio.cdt/lib/cmake + printf "\n${bldred}\t ___ ___ ___ ___\n" printf "\t / /\\ / /\\ / /\\ ___ / /\\ \n" printf "\t / /:/_ / /::\\ / /:/_ / /\\ / /::\\ \n" diff --git a/modules/EosioWasmToolchain.cmake.in b/modules/EosioWasmToolchain.cmake.in index 85b6a6ee317..14b163e1403 100644 --- a/modules/EosioWasmToolchain.cmake.in +++ b/modules/EosioWasmToolchain.cmake.in @@ -1,6 +1,7 @@ message(STATUS "Setting up Eosio Wasm Toolchain") set(CMAKE_SYSTEM_NAME WebAssembly) +set(EOSIO_CDT_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") set(EOSIO_WASMSDK_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") set(CLANG_DIR @CMAKE_INSTALL_PREFIX@/) diff --git a/modules/EosioWasmToolchainBuild.cmake.in b/modules/EosioWasmToolchainBuild.cmake.in index fab7ca40118..ed21e89155e 100644 --- a/modules/EosioWasmToolchainBuild.cmake.in +++ b/modules/EosioWasmToolchainBuild.cmake.in @@ -1,6 +1,7 @@ message(STATUS "Setting up Eosio Wasm Toolchain") set(CMAKE_SYSTEM_NAME WebAssembly) +set(EOSIO_CDT_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") set(EOSIO_WASMSDK_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") set(CLANG_DIR @CMAKE_BINARY_DIR@/EosioClang-prefix/src/EosioClang-build) From 8585bc8bb442745602c7485014391f92d106da09 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 5 Sep 2018 18:48:42 -0400 Subject: [PATCH 35/38] Update CMakeLists.txt --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63c5ba22a87..a8fea578310 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.5) project(eosio_wasm_sdk) set(VERSION_MAJOR 1) -set(VERSION_MINOR 1) -set(VERSION_PATCH 1) +set(VERSION_MINOR 2) +set(VERSION_PATCH 0) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") From 6b596d457c6af2e1ecb7574d46d8cbe42abd0868 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 5 Sep 2018 19:21:16 -0400 Subject: [PATCH 36/38] last minute fixes --- README.md | 1 - examples/abigen_test/CMakeLists.txt | 2 +- examples/hello/CMakeLists.txt | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 74c344e35b0..9e4579edea4 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,6 @@ $ eosio-cpp hello.cpp -o hello.wasm #### Optional, if you know cmake - If you want to test out the CMake system, stay in the same directory as the previous manual build. - - Sorry for the hiccup, but you will need to change one small line in the `CMakeLists.txt` file. Change `set(EOSIO_WASMSDK_ROOT ${CMAKE_INSTALL_PREFIX})` to `set(EOSIO_WASMSDK_ROOT "/usr/local/eosio.wasmsdk")` - Then create a build directory ```mkdir build``` and cd into that directory ```cd build``` - Then run ```cmake ../```, this will generate the cache and supporting files for CMake to do it's job. - Now simply run ```make```. diff --git a/examples/abigen_test/CMakeLists.txt b/examples/abigen_test/CMakeLists.txt index 53e7c0657fa..d2827150ced 100644 --- a/examples/abigen_test/CMakeLists.txt +++ b/examples/abigen_test/CMakeLists.txt @@ -3,7 +3,7 @@ project(abigen_test_example VERSION 1.0.0) # if no wasm root is given use default path if(EOSIO_CDT_ROOT STREQUAL "" OR NOT EOSIO_CDT_ROOT) - set(EOSIO_CDT_ROOT "/usr/local/eosio.wasmsdk") + set(EOSIO_CDT_ROOT "/usr/local/eosio.cdt") endif() # append the path to the module to include diff --git a/examples/hello/CMakeLists.txt b/examples/hello/CMakeLists.txt index a6f718f218a..24a566565f1 100644 --- a/examples/hello/CMakeLists.txt +++ b/examples/hello/CMakeLists.txt @@ -12,4 +12,4 @@ list(APPEND CMAKE_MODULE_PATH ${EOSIO_CDT_ROOT}/lib/cmake) #include the toolchain cmake include(EosioWasmToolchain) -add_executable( hello hello.cpp ) +add_executable( hello.wasm hello.cpp ) From 588dffedea20cef746ad7b294c73df2166df38bd Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 5 Sep 2018 19:23:04 -0400 Subject: [PATCH 37/38] last change to README, hopefully --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e4579edea4..bd0229a4e11 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,8 @@ using namespace eosio; class test : public eosio::contract { public: using contract::contract; - void test_action( account_name test ) { + [[eosio::action]] + void testact( account_name test ) { } }; EOSIO_ABI( test, (test_action)) From 58c4ce24b68d94d058b27a594ab7d24862351571 Mon Sep 17 00:00:00 2001 From: Bucky Kittinger Date: Wed, 5 Sep 2018 19:26:16 -0400 Subject: [PATCH 38/38] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd0229a4e11..f71dc0ed52b 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ public: void testact( account_name test ) { } }; -EOSIO_ABI( test, (test_action)) +EOSIO_ABI( test, (testact)) ``` Since, EosioWasmToolchain overwrites `cmake` to cross-compile WASM, standard cmake commands of _add\_executable/ add\_library_ can then be used. Also note, the __EOSIO_CDT_ROOT__ variable, this needs to be set if you decided to install to the non-default location.