{"repo":"slice-so/hooks","free":true,"listed":false,"github":"https://github.com/slice-so/hooks","clone":"git clone https://github.com/slice-so/hooks.git","description":"Hooks for the Slice commerce protocol","language":"Solidity","stars":49,"topics":["commerce","ethereum","hooks","slice","smart-contracts"],"license":"MIT","category":"blockchain-web3","readme_excerpt":"▼ Slice Hooks Smart contracts for creating custom pricing strategies and onchain actions for Slice products. Hooks enable dynamic pricing, purchase restrictions, rewards, integration with external protocols and other custom behaviors when products are bought. Contribute by building new hooks and have them automatically integrated across all Slice stores and clients. Architecture Product Purchase Lifecycle Here's how hooks integrate into the product purchase flow: Pricing Strategies are called during the price fetching phase to calculate price based on buyer and custom logic Onchain Actions are executed during the purchase transaction to: - Validate purchase eligibility - Execute custom logic (gating, minting, rewards, etc.) Core Interfaces Hooks are built around three main interfaces: IProductPrice - Calculate dynamic prices for products: IProductAction - Execute custom logic during purchases (eligibility checks, rewards, etc.): IHookRegistry - Enable reusable hooks across multiple products with frontend integration: Hook Types Registry Hooks (Reusable) Reusable contracts designed to support multiple products, automatically integrated with Slice clients. - Actions - Purchase restrictions and onchain effects - Pricing - Dynamic pricing strategies - PricingActions - Pricing + actions in one contract Product-Specific Hooks Custom smart contracts tailored for individual products, integrated using the custom onchain action or pricing strategy in Slice. - Custom : Product-specific ","default_branch":null,"files":null,"tree":[],"storefront":"/r/slice-so","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/slice-so/hooks/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}