OpenViSTAI · Agents · Blockchain · Crypto
Menu
Smart Contracts

Slice Hooks

Slice Hooks is an MIT-licensed Solidity library of interfaces and smart-contract hooks for customizing pricing and purchase-time behavior in Slice products.

Independent OpenViST project profile, based on linked sources.

Slice Hooks — OpenViST project profile in Smart Contracts.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when extending a Slice product's purchase flow with custom Solidity pricing, eligibility rules or on-chain actions.

Who it is for

  • Solidity developers building custom pricing or purchase actions for Slice products.
  • Teams implementing reusable hooks across products or contracts tailored to an individual product.

Documented uses

  • Calculate product prices using buyer-specific or other custom logic before a purchase.
  • Check purchase eligibility and run custom logic during purchase execution.
  • Add purchase-time effects such as rewards or gating.
  • Create reusable registry hooks or product-specific hook contracts.
Before you choose

Requirements & limits

The public GitHub repository declares an MIT license. Its documented development workflow requires Foundry.

  • Pricing hooks calculate prices before purchase execution; action hooks check eligibility and run logic during the purchase transaction.
  • Registry hooks are designed for reuse across products, while product-specific hooks target individual products.
  • The generator supplies scaffolding, but developers must implement custom logic and write tests.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Generate a hook contract template

Create a starter contract template for a registry or product-specific Slice hook.

Before you start

  • A local copy of the repository.
  • Foundry installed.

Steps

  1. Run ./script/generate-hook.sh.

  2. Choose Registry or Product-specific scope.

  3. Select Action, Pricing Strategy or Pricing Action, then name the contract and optionally set authorship.

Expected outcome

The generator creates a contract file with a suitable template; registry hooks also receive aggregator imports and test-file scaffolding.

Guide limitations

  • The generated template does not implement the desired custom behavior; add the contract logic and write tests.
  • This guide covers generation only, not compilation, testing or deployment.
Source-based practical guide

Install dependencies, build and run the test suite

Use the repository's documented Foundry commands to prepare, compile and test the contracts.

Before you start

  • Foundry installed.
  • A local copy of the repository.

Steps

  1. Run forge soldeer install to install dependencies.

  2. Run forge build to compile the contracts.

  3. Run forge test to run the test suite.

Expected outcome

The documented workflow installs project dependencies, compiles the contracts and invokes the repository test suite.

Guide limitations

  • These commands do not establish that a developer's new hook behaves as intended; custom logic still requires suitable tests.
  • This workflow does not cover deployment.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
12 October 2026
Original website title
slice-so/hooks · Official homepage title · retained in its source language