-
Notifications
You must be signed in to change notification settings - Fork 4
Known issues
Solidity events are interfaces with EVM logging functionality. Each event type is defined and emitted by the keyword emit
(or without it in early compiler versions). They are subscribed to by off-chain applications.
Michelson doesn't have any analog for logging and that's why LIGO doesn't support events.
Translation will fail if your .sol
contract imports other contracts with different Solidity versions. You might need to manually go through every contract before translation and make them use the same version even for minor revisions.
In Solidity one may skip executing single loop cycle by continue
or halt loop execution by break
statement.
LIGO and Michelson are both functional languages that have a difficult relationships with loops. It is impossible to interrupt loops in LIGO.
Read more: https://ligolang.org/docs/language-basics/loops/#for-loop
Inline assembly can be used for some low-level computations. LIGO doesn't have any analog for such a feature. Theoretically it could inline Michelson code, but supporting this is out of the scope of this transpiler.
Contrary to Solidity, LIGO only allows calling functions defined above. That's why it is impossible for the function to call itself or any method below.
Tezos does not support names longer than 32 characters for entrypoints. There is a related issue on Ligo Gitlab.
Solidity support a variety of types (up tо 256 bits) meanwhile default LIGO (and Michelson) mutez
type is limited by 63 bits. That's why some operation may not fit into precision. It must be noted though int
and nat
are arbitrary-precision numbers, so they might be more than 256 bits long.
Solidity supports the following cryptographic functions: sha256
, keccak256
, ripemd160
, sha3
, ecrecover
.
Meanwhile, Ligo only supports sha256, sha512, blake2b and crypto_check.
There is no direct translation of ecrecover
to LIGO. You may want to attempt manual conversion though.
Solidity code:
ecrecover(hash, v, r, s) == address
is roughly equivalent to LIGO
Crypto.check (address, signed, hash)
Where Solidity v,r,s
in a way are components of LIGO's signed
signature
There is no direct analog in LIGO for unary expressions. We replace them with x = x + 1
or similar, but that is a statement, not an expression, those can't be used inside conditions like if (x++)
for example.