Skip to content

argotorg/solcore

Repository files navigation

Experimental compiler for the new Solidity language

Development

# enter a development shell with all required dependencies
nix develop

# enter a repl
cabal repl

# build the project
cabal build

# run the tests
cabal test

# run the CI pipeline locally
nix build

Using nix and flakes

This project uses nix flakes. If you haven't already you should add the following to ~/.config/nix/nix.conf (user local) or /etc/nix/nix.conf (system wide) to disable errors about experimental-features:

experimental-features = nix-command flakes

Alternatively, the determinate nix installer installs nix with flakes enabled automatically.

Usage

Compilation

The compiler is currented implemented as two binaries:

  1. sol-core: typechecks, specializes, and lowers to the core IR
  2. yule: lowers core files to yul
# produces `output1.core`
$ cabal run -- sol-core -f <input>

# produces an output.yul
$ cabal run -- yule output1.core -o output.yul

Running Code

The runsol.sh script implements a small pipeline that executes a core solidity contract by compiling via sol-core -> yule -> solc, and then using hevm to execute the resulting EVM code.

It takes the following arguments:

Usage: ./runsol.sh <file.solc> [options]
Options:
  --calldata <sig> [args...]  Generate calldata using cast calldata
  --raw-calldata <hex>        Pass raw calldata directly to hevm
  --callvalue <value>         Pass callvalue to hevm (in wei)

About

experimental solidity compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7