-
Notifications
You must be signed in to change notification settings - Fork 4
CLI usage
General usage: ./cmd.coffee <file.sol>
-
--router- generate a router: a special structure so methods of this contract are accessible from outside. Read more Router* -
--ds- Also print a default state. Default state is an initial values of your contract. They are required to originate (deploy) your contract into the network. In there you specify, for example, your initial holders inside bigmaps. -
--test- perform compilation of the resulting code. LIGO executable has to be installed and available in yourPATH -
--disable_enums_to_nat- In Solidity enums implemented like in C. They are virtually unsigned integer numbers. Comparing two enum values is like comparing two integers. But in LIGO enum, also known as variant type is more complex and versatile. The problem here is that you can't compare two enums or perform arithmetic operations like you do in Solidity. This option istrueby default and will produce:
const FIRST_ENUM_VAL : nat = 0;
const SECOND_ENUM_VAL : nat = 1;instead of
type Enum_val of
| FIRST_ENUM_VAL
| SECOND_ENUM_VLThis way enums while being less type safe will behave similarly to Solidity.
-
--contract <name>- specify a contract name to be considered main. This affects what methods of contract will be added to the router. And also what included contracts or interfaces will be considered foreign. Calls to foreign contracts will be attempted to be translated totransactioncalls for convenience. If not passed last contract is automatically considered main one. -
--outfile <name>- output a contract into a file with instead of stdout. This also createsstorage.ligofile alongside generated one for contract to be originated with. -
--dir <path>- keep original directory structure and yield multiple ligo files. By default all imports of original Solidity contract are collected and embedded into one file so transpiler can have as much context as possible. This may lead to a huge and hard-to-navigate LIGO output file. If the original project is consisting of several files in a directory structure this flag should preferably be passed. This waysol2ligowill attempt to preserve the original structure and place#includestatements for the system to come together. Target directory might be specified using--outdirflag, current working directory is used otherwise.