Skip to content

About

Solidity helpers for working with Seaport on and off-chain using Forge scripts

Resources

Stars

23 stars

Watchers

5 watching

Forks

Repository files navigation

seaport-sol

Version npm

Solidity helpers for building and testing Seaport 1.6 orders in Foundry: struct libraries with fluent setters, order and fulfillment builders, and execution helpers.

The helpers are meant for Forge tests and scripts. They are gas-inefficient and not meant for contracts you deploy.

Install

As a Foundry submodule:

forge install ProjectOpenSea/seaport-sol

Then add remappings. The library imports seaport-types and seaport-core, and some helpers import solady and forge-std. Point these at your own copies if you already have them.

remappings = [
    "seaport-sol/=lib/seaport-sol/",
    "seaport-types/=lib/seaport-sol/lib/seaport-types/",
    "seaport-core/=lib/seaport-sol/lib/seaport-core/",
    "solady/=lib/seaport-sol/lib/solady/",
]

From npm:

npm install seaport-sol

The package ships src/ and depends on seaport-core 1.6.6 and seaport-types 1.6.3. It doesn't include solady or forge-std.

Usage

import {
    OrderComponents,
    OrderComponentsLib
} from "seaport-sol/src/SeaportSol.sol";

using OrderComponentsLib for OrderComponents;

OrderComponents memory order = OrderComponentsLib.empty()
    .withOfferer(offerer)
    .withStartTime(block.timestamp);

Develop

Requires Foundry v1.9.0 and submodules checked out recursively.

git submodule update --init --recursive
forge build
forge test
scripts/install-tools.sh
scripts/lint.sh check

Related repositories

About

Solidity helpers for working with Seaport on and off-chain using Forge scripts

Resources

Stars

23 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages