Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ca5069a
chore: upgrade checkout to v5
jacopo-eth Aug 29, 2025
dfa385b
fix: contracts
jacopo-eth Sep 9, 2025
2f9b893
access control init
jacopo-eth Sep 14, 2025
958d748
wip
jacopo-eth Sep 14, 2025
57f885a
access control final draft
jacopo-eth Sep 14, 2025
3bc370c
cleanup
jacopo-eth Sep 15, 2025
21f1775
multi-actions support: init
jacopo-eth Sep 17, 2025
84c75b4
multi-pricing init
jacopo-eth Sep 22, 2025
115a4c3
contracts wip
jacopo-eth Sep 24, 2025
3e30f91
hook versioning
jacopo-eth Sep 28, 2025
ba271af
fix tests
jacopo-eth Sep 29, 2025
a484fd9
fix: NFTGated hook
jacopo-eth Sep 29, 2025
a4afabf
update hooks tests
jacopo-eth Sep 29, 2025
737189b
indexer: update tests wip
jacopo-eth Oct 1, 2025
815a305
indexer: add hooks tests
jacopo-eth Oct 2, 2025
5cf987e
indexer: final
jacopo-eth Oct 2, 2025
20355c9
fixes
jacopo-eth Oct 2, 2025
0623588
update hooks contracts with support for new interfaces
jacopo-eth Oct 4, 2025
6f0ec46
fixes
jacopo-eth Oct 5, 2025
5d86972
NFTDiscount tests
jacopo-eth Oct 5, 2025
2a4622b
update WriteAddresses logic
jacopo-eth Oct 5, 2025
2336640
fix: ScriptUtils
jacopo-eth Oct 5, 2025
4d9d8c4
indexer: add support for additional hooks
jacopo-eth Oct 5, 2025
1b0ee91
slicer pricing strategies final
jacopo-eth Oct 29, 2025
038c1aa
product type actions init + remove data from prodtype and slicer hooks
jacopo-eth Oct 29, 2025
8d6c935
fix hooks
jacopo-eth Nov 2, 2025
26729b1
update action hooks to support product type and slicer
jacopo-eth Nov 3, 2025
81406b1
added product type and slicer action tests
jacopo-eth Nov 3, 2025
3fdf67a
nit
jacopo-eth Nov 3, 2025
00cbac8
fix: generated-hooks-types
jacopo-eth Nov 9, 2025
9bd5f5a
feat: Payment and Order
jacopo-eth Mar 18, 2026
15886dd
nit: formatting
jacopo-eth Apr 8, 2026
9d6a369
fixes
jacopo-eth May 7, 2026
e929bd4
fix
jacopo-eth Jun 10, 2026
fafbdfd
foundry toml
jacopo-eth Jun 10, 2026
3a805a8
fix: foundry warnings in CI
jacopo-eth Jun 10, 2026
55a3b0c
contracts envs
zerohex-eth Jun 18, 2026
027ca74
refactor and comments
zerohex-eth Jun 18, 2026
a06f80b
refactor and comments
zerohex-eth Jun 18, 2026
cd8561c
Move walletRecovery hono endpoint from indexer to api
jacopo-eth Aug 7, 2026
98eb7fe
update licences
jacopo-eth Aug 19, 2026
1b83fe6
Refactor application architecture and remove obsolete code
jacopo-eth Aug 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
RPC_URL_MAINNET=
RPC_URL_OPTIMISM=
RPC_URL_BASE=
RPC_URL_BASE_GOERLI=
# Scope: RPC provider credential.
SLICEGLOBAL_INTERNAL_ALCHEMY_ID=

# Scope: explorer verification.
ETHERSCAN_KEY=

PRIVATE_KEY=
# Scope: signer keys.
PRIVATE_KEY=
2 changes: 1 addition & 1 deletion .github/workflows/subtree-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # gh picks this up automatically
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with: {fetch-depth: 0} # full history, just in case

- name: Ensure PR exists
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: recursive

Expand Down
12 changes: 6 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2025 Slice
Copyright (c) Slice

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,8 @@ src/
- [Actions Guide](./src/hooks/actions/README.md)
- [Pricing Strategies Guide](./src/hooks/pricing/README.md)
- [Pricing + Actions Guide](./src/hooks/pricingActions/README.md)
- [Custom Implementations](./src/custom/README.md)
- [Custom Implementations](./src/custom/README.md)

## License

This repository is available under the [MIT License](./LICENSE).
132 changes: 93 additions & 39 deletions deployments/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,132 @@
"actions": {
"Allowlisted": [
{
"address": "0x157428DD791E03c20880D22C3dA2B66A36B5cF26",
"blockNumber": 33510607,
"paramsSchema": "bytes32 merkleRoot",
"transactionHash": "0x6af9ac700f1c9a38de57fa4bc13262162d9b674649fd417ccd50237b6cfbc178"
"address": "0x87f726ac5D1023919840bebde2Da2efb5Da816ad",
"blockNumber": 36441333,
"configureProductSchema": "bytes32 merkleRoot",
"configureProductTypeSchema": "not-supported",
"configureSlicerSchema": "not-supported",
"onProductPurchaseSchema": "",
"productPriceSchema": "not-supported",
"productTypePriceSchema": "not-supported",
"slicerProductPriceSchema": "not-supported",
"transactionHash": "0x57419dee52082559db1d966b1b139bb79ac59c4533de43153dd11fda30b765c1"
}
],
"ERC20Gated": [
{
"address": "0x26A1C86B555013995Fc72864D261fDe984752E7c",
"blockNumber": 33558792,
"paramsSchema": "(address erc20,uint256 amount)[] erc20Gates",
"transactionHash": "0x3a7c01ede05a34280073479d5cdf1f35e41d9f08c36a71f358b9c503ccc54526"
"address": "0x247ebf608A0028DE933f1F90eE3920864D3fC621",
"blockNumber": 36440973,
"configureProductSchema": "(address erc20,uint256 amount)[] erc20Gates",
"configureProductTypeSchema": "(address erc20,uint256 amount)[] erc20Gates",
"configureSlicerSchema": "(address erc20,uint256 amount)[] erc20Gates",
"onProductPurchaseSchema": "",
"productPriceSchema": "not-supported",
"productTypePriceSchema": "not-supported",
"slicerProductPriceSchema": "not-supported",
"transactionHash": "0xac40db0f5c63ec520e671db10b018018900a332d563c99bc9828a6cc20b48863"
}
],
"ERC20Mint": [
{
"address": "0x67f9799FaC1D53C63217BEE47f553150F5BB0836",
"blockNumber": 33520592,
"paramsSchema": "string name,string symbol,uint256 premintAmount,address premintReceiver,bool revertOnMaxSupplyReached,uint256 maxSupply,uint256 tokensPerUnit",
"transactionHash": "0xfcd7e8fe47aa509afa0acdef86b741656c2602626f3258f8a83b359c665d6b04"
"address": "0x8B03B4dE7F6FD7A7BDD60Cb00aa49E144e45cdd0",
"blockNumber": 36441450,
"configureProductSchema": "string name,string symbol,uint256 premintAmount,address premintReceiver,bool revertOnMaxSupplyReached,uint256 maxSupply,uint256 tokensPerUnit",
"configureProductTypeSchema": "string name,string symbol,uint256 premintAmount,address premintReceiver,bool revertOnMaxSupplyReached,uint256 maxSupply,uint256 tokensPerUnit",
"configureSlicerSchema": "string name,string symbol,uint256 premintAmount,address premintReceiver,bool revertOnMaxSupplyReached,uint256 maxSupply,uint256 tokensPerUnit",
"onProductPurchaseSchema": "",
"productPriceSchema": "not-supported",
"productTypePriceSchema": "not-supported",
"slicerProductPriceSchema": "not-supported",
"transactionHash": "0xfd77332c2aba9e05a71419b87ddb0a136f85675f7d0f13cf7c46c3e65c99f44c"
}
],
"ERC721Mint": [
{
"address": "0x2b6488115FAa50142E140172CbCd60e6370675F7",
"blockNumber": 33511082,
"paramsSchema": "string name,string symbol,address royaltyReceiver,uint256 royaltyFraction,string baseURI,string tokenURI,bool revertOnMaxSupplyReached,uint256 maxSupply",
"transactionHash": "0x4981b3b67c0b8abe6a942b3ca86643f2b1dfdbcce59d6c819ad20a82814956e0"
"address": "0x48eAf12a1dC2a6dfACcb4C03F381B07ad5D5961C",
"blockNumber": 36441490,
"configureProductSchema": "string name,string symbol,address royaltyReceiver,uint256 royaltyFraction,string baseURI,string tokenURI,bool revertOnMaxSupplyReached,uint256 maxSupply",
"configureProductTypeSchema": "string name,string symbol,address royaltyReceiver,uint256 royaltyFraction,string baseURI,string tokenURI,bool revertOnMaxSupplyReached,uint256 maxSupply",
"configureSlicerSchema": "string name,string symbol,address royaltyReceiver,uint256 royaltyFraction,string baseURI,string tokenURI,bool revertOnMaxSupplyReached,uint256 maxSupply",
"onProductPurchaseSchema": "",
"productPriceSchema": "not-supported",
"productTypePriceSchema": "not-supported",
"slicerProductPriceSchema": "not-supported",
"transactionHash": "0x4851d2daedfa5de5a6a60a44fb9709e8c865039660c373d6d96f06c4ec2369f5"
}
],
"NFTGated": [
{
"address": "0xD4eF7A46bF4c58036eaCA886119F5230e5a2C25d",
"blockNumber": 33563508,
"paramsSchema": "(address nft,uint8 nftType,uint80 id,uint8 minQuantity)[] nftGates,uint256 minOwned",
"transactionHash": "0x9dd101a6155b432849cb33f65c5d4b9f6875e6b1e7bf806005a8a6b0d070f634"
"address": "0x560463f7bF3DFDB4Cff4f96c3399313d610Dd349",
"blockNumber": 36441510,
"configureProductSchema": "(address nft,uint8 nftType,uint80 id,uint8 minQuantity)[] gates,uint256 minOwned",
"configureProductTypeSchema": "(address nft,uint8 nftType,uint80 id,uint8 minQuantity)[] gates,uint256 minOwned",
"configureSlicerSchema": "(address nft,uint8 nftType,uint80 id,uint8 minQuantity)[] gates,uint256 minOwned",
"onProductPurchaseSchema": "",
"productPriceSchema": "not-supported",
"productTypePriceSchema": "not-supported",
"slicerProductPriceSchema": "not-supported",
"transactionHash": "0x3bef5e07d303ab1028a7928f9ef1ffb1613b957aff4bfe481ae79a6fd1029e2d"
}
]
},
"pricing": {
"NFTDiscount": [
"LinearVRGDAPrices": [
{
"address": "0xb830a457d2f51d4cA1136b97FB30DF6366CFe2f5",
"blockNumber": 33596708,
"paramsSchema": "(address nft,uint80 discount,uint8 minQuantity,uint8 nftType,uint256 tokenId)[] discounts",
"transactionHash": "0x966be5fa1da3fab7c5027c9acb3f118307997e30687188b4745d74fd26ad9e7e"
"address": "0x67AEdfe386a078DF350D4b1E033AB735c1fCD0C9",
"blockNumber": 36441538,
"configureProductSchema": "int184 priceDecayPercent,uint16 min,int256 perTimeUnit",
"configureProductTypeSchema": "not-supported",
"configureSlicerSchema": "not-supported",
"onProductPurchaseSchema": "not-supported",
"productPriceSchema": "",
"productTypePriceSchema": "not-supported",
"slicerProductPriceSchema": "not-supported",
"transactionHash": "0xd5ad41a2f994e0151edaf566e8114b703fa1843c4bbd4a8ed79b4312e22a4843"
}
],
"LinearVRGDAPrices": [
"LogisticVRGDAPrices": [
{
"address": "0xEC68E30182F4298b7032400B7ce809da613e4449",
"blockNumber": 33511188,
"paramsSchema": "(address currency,int128 targetPrice,uint128 min,int256 perTimeUnit)[] linearParams,int256 priceDecayPercent",
"transactionHash": "0xf2667ce20d07561e59c8d3e3de135bbd895c5b08bb57fe487c6c8197c91a0d73"
"address": "0x12b56C70fd76D45b578C50aD2eDB582b44d75cC1",
"blockNumber": 36441564,
"configureProductSchema": "int184 priceDecayPercent,uint16 min,int256 timescale",
"configureProductTypeSchema": "not-supported",
"configureSlicerSchema": "not-supported",
"onProductPurchaseSchema": "not-supported",
"productPriceSchema": "",
"productTypePriceSchema": "not-supported",
"slicerProductPriceSchema": "not-supported",
"transactionHash": "0x72fbbdd585b2fd5a2c5be0431e14c0ddee9a266f0c2c6d259dfc9b76a938122a"
}
],
"LogisticVRGDAPrices": [
"NFTDiscount": [
{
"address": "0x2b02cC8528EF18abf8185543CEC29A94F0542c8F",
"blockNumber": 33511209,
"paramsSchema": "(address currency,int128 targetPrice,uint128 min,int256 timeScale)[] logisticParams,int256 priceDecayPercent",
"transactionHash": "0x2b27380661a38b54dbccf634305622296034ddfccf5865a07fbfb7810ea41025"
"address": "0xD92820f4836b23DCe9f7696b12a5C877ec667128",
"blockNumber": 36441359,
"configureProductSchema": "(address nft,uint80 discount,uint8 minQuantity,uint8 nftType,uint256 tokenId)[] discounts",
"configureProductTypeSchema": "(address nft,uint80 discount,uint8 minQuantity,uint8 nftType,uint256 tokenId)[] discounts",
"configureSlicerSchema": "(address nft,uint80 discount,uint8 minQuantity,uint8 nftType,uint256 tokenId)[] discounts",
"onProductPurchaseSchema": "not-supported",
"productPriceSchema": "",
"productTypePriceSchema": "",
"slicerProductPriceSchema": "",
"transactionHash": "0xaf7bb92631cfa26e513b23bd48d60535244a9161e497d25d55ba139890414e3c"
}
]
},
"pricingActions": {
"FirstForFree": [
{
"address": "0x2C18D37b8229233F672bF406bCe8799BCfD43B5A",
"blockNumber": 33510960,
"paramsSchema": "uint256 usdcPrice,(address tokenAddress,uint8 tokenType,uint88 tokenId,uint8 minQuantity)[] eligibleTokens,address mintToken,uint88 mintTokenId,uint8 freeUnits",
"transactionHash": "0x8bd0b9de8edd704899210f8450096adf7f4f853030a7ba0a2f64494bc1ba726e"
"address": "0x718308153116e90393804ae7a58a8e7d5BDb6482",
"blockNumber": 36441582,
"configureProductSchema": "(address tokenAddress,uint8 tokenType,uint80 tokenId,uint8 minQuantity)[] eligibleTokens,address mintToken,uint88 mintTokenId,uint8 freeUnits",
"configureProductTypeSchema": "not-supported",
"configureSlicerSchema": "not-supported",
"onProductPurchaseSchema": "",
"productPriceSchema": "",
"productTypePriceSchema": "not-supported",
"slicerProductPriceSchema": "not-supported",
"transactionHash": "0x59033c01e7228c3f28d25ce233bb729e595515923078498e726d052f038a87aa"
}
]
}
Expand Down
51 changes: 37 additions & 14 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,44 @@ optimizer_runs = 1000000
no_match_test = "FFI"
dynamic_test_linking = true
libs = ["dependencies", "../core/src", "../core/dependencies"]
fs_permissions = [{ access = "read", path = "./src"}, { access= "read", path = "./broadcast/Deploy.s.sol/8453/run-latest.json"}, { access = "read-write", path = "./deployments"}, { access = "read", path = "./out"}]
ignored_warnings_from = ["dependencies", "../core/dependencies"]
fs_permissions = [
{ access = "read", path = "./src" },
{ access = "read", path = "./broadcast/Deploy.s.sol/8453/run-latest.json" },
{ access = "read-write", path = "./deployments" },
{ access = "read", path = "./out" },
]
remappings = [
"slice/=dependencies/slice-0.0.9/",
"@openzeppelin-4.8.0/=dependencies/@openzeppelin-contracts-4.8.0/",
"@openzeppelin-upgradeable-4.8.0/=dependencies/@openzeppelin-contracts-upgradeable-4.8.0/",
"solady-0.1.26/=dependencies/solady-0.1.26/",
"@erc721a/=dependencies/erc721a-4.3.0/contracts/",
"forge-std/=dependencies/forge-std-1.9.7/src/",
"@test/=test/",
"@/=src/"
"@/=src/",
]

[profile.ci]
fuzz_runs = 10000
fuzz.runs = 10000

[profile.ffi]
ffi = true
match_test = "FFI"
no_match_test = "a^"
fuzz_runs = 1000
fuzz.runs = 1000


[rpc_endpoints]
mainnet = "${RPC_URL_MAINNET}"
op = "${RPC_URL_OPTIMISM}"
base = "${RPC_URL_BASE}"
base-goerli = "${RPC_URL_BASE_GOERLI}"
mainnet = "https://eth-mainnet.g.alchemy.com/v2/${SLICEGLOBAL_INTERNAL_ALCHEMY_ID}"
op = "https://opt-mainnet.g.alchemy.com/v2/${SLICEGLOBAL_INTERNAL_ALCHEMY_ID}"
base = "https://base-mainnet.g.alchemy.com/v2/${SLICEGLOBAL_INTERNAL_ALCHEMY_ID}"

[etherscan]
mainnet = { key="${ETHERSCAN_KEY}", chain=1 }
op = { key="${ETHERSCAN_KEY}", chain=10 }
base = { key="${ETHERSCAN_KEY}", chain=8453, url="https://api.basescan.org/api" }
base-goerli = {key="${ETHERSCAN_KEY}", chain=84531, url="https://api-goerli.basescan.org/api" }
mainnet = { key = "${ETHERSCAN_KEY}", chain = 1 }
op = { key = "${ETHERSCAN_KEY}", chain = 10 }
base = { key = "${ETHERSCAN_KEY}", chain = 8453, url = "https://api.basescan.org/api" }
base-goerli = { key = "${ETHERSCAN_KEY}", chain = 84531, url = "https://api-goerli.basescan.org/api" }

[soldeer]
recursive_deps = true
Expand All @@ -49,7 +55,24 @@ forge-std = "1.9.7"
"@openzeppelin-contracts" = "4.8.0"
"@openzeppelin-contracts-upgradeable" = "4.8.0"
erc721a = "4.3.0"
solady = "0.1.26"

[lint]
ignore = ["test/**/*.sol","script/**/*.sol", "src/interfaces/*.sol", "src/utils/*.sol", "src/hooks/actions/actions.sol", "src/hooks/pricing/pricing.sol", "src/hooks/pricingActions/pricingActions.sol"]
exclude_lints=["mixed-case-function", "mixed-case-variable", "pascal-case-struct"]
ignore = [
"dependencies/**/*.sol",
"../core/dependencies/**/*.sol",
"test/**/*.sol",
"script/**/*.sol",
"src/interfaces/*.sol",
"src/utils/*.sol",
"src/hooks/actions/actions.sol",
"src/hooks/pricing/pricing.sol",
"src/hooks/pricingActions/pricingActions.sol",
"src/utils/math/SignedWadMath.sol",
]
exclude_lints = [
"block-timestamp",
"mixed-case-function",
"mixed-case-variable",
"pascal-case-struct",
]
1 change: 0 additions & 1 deletion script/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;

import {console} from "forge-std/console.sol";
import {VmSafe} from "forge-std/Vm.sol";
import {BaseScript, SetUpContractsList} from "./ScriptUtils.sol";

Expand Down
Loading
Loading