Skip to content

Commit

Permalink
Merge pull request #1 from flashbots/update-readmep
Browse files Browse the repository at this point in the history
Update README
  • Loading branch information
ferranbt authored Jan 3, 2024
2 parents 5000721 + 9b84b98 commit 8a3501e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TestContract:testBar() (gas: 401)
TestTransactions:testLegacyTransactionRLPEncoding() (gas: 163969)
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@ jobs:
- name: Install deps
run: forge install

- name: Check gas snapshots
run: forge snapshot --check

- name: Run tests
run: forge test
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
# <h1 align="center"> Suave-std </h1>
# Suave-std

Suave Standard library (`suave-std`) is a collection of helpful contracts and libraries to build Suapps.

## Installation

To install with [Foundry](https://github.com/foundry-rs/foundry):

```bash
forge install flashbots/suave-std
```

## Libraries

### Transactions.sol

Helper library that defines types and encoding/decoding methods for the Ethereum transaction types.

#### Example usage

```solidity
import "suave-std/Transactions.sol";
contract Example {
function example() {
Transactions.Legacy memory legacyTxn0 = Transactions.Legacy({
to: address(0x095E7BAea6a6c7c4c2DfeB977eFac326aF552d87),
gas: 50000,
gasPrice: 10,
value: 10,
...
});
// Encode to RLP
bytes memory rlp = Transactions.encodeRLP(legacyTxn0);
// Decode from RLP
Transactions.Legacy memory legacyTxn1 = Transactions.decodeRLP(rlp);
}
}
```
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[profile.ci.fuzz]
runs = 10_000
solc_version = "0.8.23"

0 comments on commit 8a3501e

Please sign in to comment.