Skip to content

Commit

Permalink
add how to use to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
coreggon11 committed Apr 27, 2023
1 parent 9e615cb commit aa46108
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can use Sol2Ink either with cargo run or by running the binary of Sol2Ink.

# Capabilities

Sol2Ink can parse Solidity files into ink! project while leveraging the power of [OpenBrush](https://github.com/727-Ventures/openbrush-contracts). You can either parse a single file by providing the path to the file, or a whole folder by providing the path to teh folder. In the latter case, Sol2Ink will parse all Solidity files in the selected folder file tree and add them to one big ink! project. The output of Sol2Ink is a folder called `generated` with the following file structure:
Sol2Ink can parse Solidity files into ink! project while leveraging the power of [OpenBrush](https://github.com/Brushfam/openbrush-contracts). You can either parse a single file by providing the path to the file, or a whole folder by providing the path to teh folder. In the latter case, Sol2Ink will parse all Solidity files in the selected folder file tree and add them to one big ink! project. The output of Sol2Ink is a folder called `generated` with the following file structure:

```shell
├── contracts
Expand Down
20 changes: 20 additions & 0 deletions docs/docs/how-to-use.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_position: 3
title: How to use
---

You can use Sol2Ink either with cargo run or by running the binary of Sol2Ink.

- ### Using `cargo run`

1. Sol2Ink runs on the nightly toolchain of Rust, so you will need that installed
2. Clone the Sol2Ink repository with `git clone https://github.com/Brushfam/sol2ink`
3. Copy the path to your Solidity files. It can be either a single .sol file or a folder with multiple .sol files. Navigate to the cloned repo and run `cargo +nightly run path_to_files` substituting `path_to_files` with the actual name of the file or folder.
4. The output will be saved in the folder of the original file under `generated`

- ### Using Sol2Ink binary

1. Download Sol2Ink from the release page
2. Navigate to the folder where you saved the binary
3. Run `./sol2ink path_to_files` substituting `path_to_files` with the actual name of the file or folder.
4. The output will be saved in the folder of the original file under `generated`

0 comments on commit aa46108

Please sign in to comment.