- Notifications
You must be signed in to change notification settings - Fork0
🏗 Compile Solidity smart contracts with Deno
License
NotificationsYou must be signed in to change notification settings
deno-web3/sol_build
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Compile Solidity smart contracts with Deno.
Deno >=v1.25 is required.
To installsol_build
globally run:
deno install --allow-read --allow-write --allow-net -f https://deno.land/x/sol_build/cli.ts
Initialize a new project with a samplehello.sol
contract:
sol_build init helloworld# Initializing a new project# Fetching releases...# Downloading soljson from https://solc-bin.ethereum.org/bin/soljson-v0.8.19+commit.7dd6d404.js...cd helloworld
Compile all Solidity files and produceHardhat-compatible artifacts with ABIs, EVM bytecode and more:
sol_build compile
If you only need ABIs, pass the--abi
option.To run optimizations, pass the--optimizer <number of runs>
flag.
You can pass a custom config as a file withsol_build -c sol.config.ts
if you need more flexible settings:
importtype{Config}from'https://deno.land/x/sol_build/config.ts'exportconstconfig={abi:true,// only produce ABIs// all solidity settings go here}
CLI arguments have a higher priority over config except foroutputSelection
setting.
sol_build
exports functions for finding, linking and compiling Solidity files.
import{compileToFs}from'https://deno.land/x/sol_build/mod.ts'import{createRequire}from'https://deno.land/std@0.177.0/node/module.ts'constrequire=createRequire(import.meta.url)constsolc=solc=wrapper(require('./.solc.js'))awaitcompileToFs(solc,{optimizer:{enabled:true,runs:200}})
About
🏗 Compile Solidity smart contracts with Deno