etherlime compile¶
Running this command will compile all smart contracts along with imported sources. The command comes with integrated solidity and vyper compiler and would automatically fetch all files with ‘.sol’ and ‘.vy’ extensions and would record the compiled json object in ‘./build’ folder. Note! To enable the vyper compiler you need to have running docker.
Syntax¶
etherlime compile [dir] [runs] [solcVersion] [docker] [list] [all] [quiet] [output] [buildDirectory] [workingDirectory] [deleteCompiledFiles]
Parameters:
dir- [Optional] By specifyingdiryou can set the root directory where to read the contracts and place the build folder. By defaultdiris set to the current working directory./runs- [Optional] By specifyingrunsbetween 1 and 999 you enabled the optimizer and set how many times the optimizer will be run. By default the optimizer is not enabled.solcVersion- [Optional] By specifyingsolcVersionyou can set the version of the solc which will be used for compiling the smart contracts. By default it use the solc version from the node_modules folder.docker- [Optional] When you want to use a docker image for your solc you should setdocker=truein ordersolcVersionto accept the passed image.list- [Optional] By specifyinglistyou can list the available solc versions. The following values can be used:docker,releases,prereleasesandlatestRelease. By default only 10 version are listedall- [Optional] By specifyingalltogether withlistyou will be able to list all available solc versions.quiet- [Optional] Disable verboseness during compilation. By the defaultquietis set to false.output- [Optional] Defines the way that the logs are shown. Choices:none- silences the output of logs,normal- see verbose logs in the console andstructured- structured output in a file meant for inter program communication.buildDirectory- [Optional] Defines the directory for placing builded contracts.workingDirectory- [Optional] Defines the folder to use for reading contracts from, instead of the default one:./contracts. Here can be specified also a single solidity file for compiling e.g:/contracts/LimeFactory.sol.deleteCompiledFiles- [Optional] Delete the files in the compilation contract directory before compiling. By the defaultdeleteCompiledFilesis set to false.exportAbi- [Optional] In addition to the json build files, etherlime build abis folder with files containing the abi of every contract
The solcVersion can accept the following values:
- <undefined> - passing undefined or simply don’t using the solcVersion argument will use the solc version from the local node_modules
- <version> - you can pass directly the version of the solc. Example:
--solcVersion=0.4.24 - <image> - the image which will be used to load the solc into the docker. Example:
nightly-0.4.25-a2c754b3fed422b3d8027a5298624bcfed3744a5 - <path> - you can pass the absolute path to a local solc
- <native> - when you set the solc version argument to
nativethe compiler is using the solc globally installed on your machine
Here is example of result:
