Skip to content

Navigation Menu

Sign in
Appearance settings

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
Appearance settings

deno-web3/solc

Repository files navigation

Solidity bindings for Deno, based on solc-js.

Solidity 0.7+ is supported.

For a CLI and a higher level API you can use sol_build.

Docs

See solc-js README and Deno doc.

Example

import { wrapper } from '@deno-web3/solc'
import { Input } from '@deno-web3/solc/types'
import { download } from '@deno-web3/solc/download'
import { createRequire } from 'node:module'
// Download latest Solidity compiler
await download()
const solc = wrapper(createRequire(import.meta.url)('./soljson.cjs'))
const MyToken = await Deno.readTextFile('./MyToken.sol')
const ERC20 = await Deno.readTextFile('./ERC20.sol')
const input: Input = {
 language: 'Solidity',
 sources: {
 'MyToken.sol': {
 content: MyToken,
 },
 'ERC20.sol': {
 content: ERC20,
 },
 },
 settings: {
 outputSelection: {
 '*': {
 '*': ['*'],
 },
 },
 },
}
console.log(JSON.parse(solc.compile(JSON.stringify(input))))

And then run with

deno run --allow-net --allow-read --allow-write mod.ts

About

πŸ’Ž Solidity compiler bindings for Deno

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /