Skip to content

Commit

Permalink
Add REAMDE
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt committed Jan 5, 2024
1 parent 1d5be8f commit 2354ebd
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,38 @@ contract Example {
}
}
```

## Forge integration

In order to use `forge`, you need to have a running `Suave` node and the `suave` binary in your path.

To run `Suave` in development mode, use the following command:

```bash
$ suave --suave.dev
```

Then, your `forge` scripts/test must import the `SuaveEnabled` contract from the `suave-std/Test.sol` file.

```
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
import "suave-std/Test.sol";
import "suave-std/Suave.sol";
contract TestForge is Test, SuaveEnabled {
address[] public addressList = [0xC8df3686b4Afb2BB53e60EAe97EF043FE03Fb829];
function testConfidentialStore() public {
Suave.DataRecord memory record = Suave.newDataRecord(0, addressList, addressList, "namespace");
bytes memory value = abi.encode("suave works with forge!");
Suave.confidentialStore(record.id, "key1", value);
bytes memory found = Suave.confidentialRetrieve(record.id, "key1");
assertEq(keccak256(found), keccak256(value));
}
}
```

0 comments on commit 2354ebd

Please sign in to comment.