Skip to content

Commit

Permalink
Update README import instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
bitzoic committed Nov 16, 2023
1 parent c38e5fb commit 1dd58e1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ These libraries contain helper functions and other tools valuable to blockchain

#### Cryptography

- [Binary Merkle Proof](./libs/merkle_proof/) is used to verify Binary Merkle Trees computed off-chain.
- [Merkle Proof](./libs/merkle_proof/) is used to verify Binary Merkle Trees computed off-chain.

#### Math

Expand All @@ -56,22 +56,24 @@ These libraries contain helper functions and other tools valuable to blockchain

## Using a library

To import the Merkle Proof library the following should be added to the project's `Forc.toml` file under `[dependencies]` with the most recent release:
To import a library, a dependency should be added to the project's `Forc.toml` file under `[dependencies]`. The following shows adding the Merkle Proof Library.

```rust
merkle_proof = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.1.0" }
```

> **NOTE** Be sure to set the tag as the most recent release.
You may then import your desired library in your Sway Smart Contract as so:

```rust
```sway
use merkle_proof::<library_function>;
```

For example, to import the Merkle Proof library use the following statement:
For example, to import the `verify_proof()` function use the following statement:

```rust
merkle_proof::binary_merkle_proof::verify_proof;
```sway
use merkle_proof::binary_merkle_proof::verify_proof;
```

## Running Tests
Expand Down

0 comments on commit 1dd58e1

Please sign in to comment.