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 [path] [runs] [solcVersion] [docker] [list] [all]
[quiet] [output] [buildDirectory] [workingDirectory] [deleteCompiledFiles] [exportAbi]Parameters:
path- [Optional] By specifyingpathyou can set the rootdirectory where to read the contracts and place the build folder. By
default
pathis set to the current working directory./runs- [Optional] By specifyingrunsbetween 1 and 999 youenabled the optimizer and set how many times the optimizer will be
run. By default the optimizer is not enabled.
solcVersion- [Optional] By specifyingsolcVersionyou can setthe 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 yoursolc you should set
docker=truein ordersolcVersionto acceptthe passed image.
list- [Optional] By specifyinglistyou can list theavailable solc versions. The following values can be used:
docker,releases,prereleasesandlatestRelease. By default only 10version are listed
all- [Optional] By specifyingalltogether withlistyouwill be able to list all available solc versions.
quiet- [Optional] Disable verboseness during compilation. Bythe default
quietis set to false.output- [Optional] Defines the way that the logs are shown.Choices:
none- silences the output of logs,normal- seeverbose logs in the console and
structured- structured output ina file meant for inter program communication.
buildDirectory- [Optional] Defines the directory for placingbuilded contracts.
workingDirectory- [Optional] Defines the folder to use forreading 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 thecompilation contract directory before compiling. By the default
deleteCompiledFilesis set to false.exportAbi- [Optional] In addition to the json build files, etherlime buildabisfolder with files containing the abi of every contract. By the default
exportAbiis set to false.
The solcVersion can accept the following values:
- passing undefined or simply don't using the
solcVersion argument will use the solc version from the local
node_modules
- you can pass directly the version of the solc.
Example:
--solcVersion=0.4.24- the image which will be used to load the solc into the
docker. Example:
nightly-0.4.25-a2c754b3fed422b3d8027a5298624bcfed3744a5- you can pass the absolute path to a local solc
- when you set the solc version argument to
nativethecompiler is using the solc globally installed on your machine
Here is example of result:

Last updated
Was this helpful?