Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🏗 Compile Solidity smart contracts with Deno

License

NotificationsYou must be signed in to change notification settings

deno-web3/sol_build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compile Solidity smart contracts with Deno.

Getting Started

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.

Configuration

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.

Programmatic use

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}})

[8]ページ先頭

©2009-2025 Movatter.jp