introduction.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .. _language-status:
  2. Brief Language status
  3. =====================
  4. The Solidity language supported by Solang aims to be compatible with the latest
  5. `Ethereum Foundation Solidity Compiler <https://github.com/ethereum/solidity/>`_,
  6. version 0.8 with some small exceptions.
  7. .. note::
  8. Where differences exist between different targets or the Ethereum Foundation Solidity
  9. compiler, this is noted in boxes like these.
  10. As with any new project, bugs are possible. Please report any issues you may find to github.
  11. Differences:
  12. - libraries are always statically linked into the contract code
  13. - Solang generates WebAssembly or Solana SBF rather than EVM.
  14. - Packed encoded uses little endian encoding, as WASM and SBF are little endian
  15. virtual machines.
  16. Unique features to Solang:
  17. - Solang can target different blockchains and some features depending on the target.
  18. For example, Polkadot uses a different ABI encoding and allows constructors
  19. to be named.
  20. - Events can be declared outside of contracts
  21. - Base contracts can be declared in any order
  22. - There is a ``print()`` function for debugging
  23. - Strings can be formatted with python style format string, which is useful for debugging: ``print("x = {}".format(x));``
  24. - Ethereum style address literals like ``0xE0f5206BBD039e7b0592d8918820024e2a7437b9`` are
  25. not supported on Polkadot or Solana, but are supported for EVM.
  26. - On Polkadot and Solana, base58 style encoded address literals like
  27. ``address"5GBWmgdFAMqm8ZgAHGobqDqX6tjLxJhv53ygjNtaaAn3sjeZ"`` are supported, but
  28. not with EVM.
  29. - On Solana, there is special builtin import file called ``'solana'`` available.
  30. - On Polkadot, there is special builtin import file called ``'polkadot'`` available.
  31. - Different blockchains offer different builtins. See the :ref:`builtins documentation <builtins>`.
  32. - There are many more differences, which are noted throughout the documentation.