9

Which version of C++ can I use to implement smart contracts?

For example: C++11, C++14 or C++17? Do we have any constant or doc where it is defined?

Also, in my understanding the code is sandboxed, where can I find the restrictions?

Is the version defined in https://github.com/EOSIO/eos/blob/4f293115f34112e843885befc4a69fce1e137aa2/CMakeLists.txt#L17 ?

2 Answers 2

2

Updated answer: Currently EOS smart contracts are written in C++17. For more details see the official SDK, CDT (Contract Development Toolkit) which is based on clang 7.

11

eosiocpp currently compiles contracts using c++14. cib compiles contracts using the c++17 language, but c++14 library.

sandboxing: contracts are compiled to WASM. Normal OS functions (filesystem, threading, etc.) are not available.

Note: cib requires an up-to-date Firefox (fastest) or Chrome (slow loading).

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.