ourovoros-io / charcoal

A Solidity to Sway translator written in Rust.
14 stars 8 forks source link

Charcoal is a Solidity-to-Sway translator written in Rust. This tool aims to translate contracts written in Solidity into Sway source code.

This is primarily an educational tool, and some generated Sway code may be incorrect or not optimal.

Please feel free to file an issue.

Requirements

Compiling the charcoal binary requires the Rust compiler and its package manager, cargo.

See the Rust Install page for installation options.

Usage

cargo run --release -- [OPTIONS]

Flags
-h, --help Prints help information
-V, --version Prints version information
Options
-d, --definition-name <definition-name> The name of the specific definition to translate. (Optional; Leave unused for all)
-o, --output-directory <output-directory> The path to save the translated Forc project to. (Optional; Must be a directory)
-t, --target <target> The Solidity target file or folder to translate.

[!warning]

Known Issues

  • Functions that return owned strings may return string constants.
  • Contracts that contain inheritance may generate incorrect function implementations.
  • Structures that contain mappings may not be translated correctly.
  • Pointer types may not be translated correctly.
  • Signed integers support is incomplete.
  • Low level calls are not all supported.
  • Contract creation with new is not supported.

Implementation Status