What libraries can be used when writing a contract in C++? What are the limitations? If I have a library I normally use and like, how do I compile it for use by contracts?

Contracts are in WASM which is a compiled binary language. The only currently tested and validated language for EOS smart contract development is C++, but in theory any language that compiles down to WASM can be used. There is an active community effort to support TypeScript as well.

  • 2
    I think expaand is asking about which C++ libraries they can use, but I may be mistaken. – Jackson Kelley Jun 6 at 16:33
  • Yes, that is what I was asking. And what limitations are there, if any? – expaand Jun 7 at 12:45
  • 1
    I know boost comes included and supported. STL of course. There is a library of contracts that comes included which has contracts for social media, an exchange, a token contract, etc. Then there is a library of objects as well. – Nat Jul 21 at 10:53
  • @Nat, aware of the system token contract, but where are the others you mention, like an exchange? – Walter K Nov 7 at 8:55
  • @WalterK github.com/EOSIO/eos/tree/master/contracts looks like they've removed the exchange contract. Feel free to go back to a previous release to find it. – Nat Nov 7 at 13:29

The code for Boost is in https://github.com/EOSIO/eosio.cdt/tree/master/libraries/boost

The main EOS library is eosiolib, and it uses Boost in action.hpp, dispatcher, datastream, etc.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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