Saleor Store
우리 컬렉션을 쇼핑하세요
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기The first Uniswap v4 Hook that turns AI intent into real-world commerce — UHI8 Hookathon 2026
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Intent-driven commerce on Uniswap v4: a single hook that turns AI payment intent into enforceable restaurant settlement, dynamic pricing, and on-chain loyalty.
Part of FoodyePay, the broader platform for AI-powered restaurant commerce.
FoodySwap is a real Uniswap v4 hook for programmable commerce.
It does not stop at AI intent generation. It enforces merchant validity, time windows, transaction limits, dynamic fees, cashback, loyalty progression, referrals, and VIP rewards inside the swap lifecycle.
If you only read one thing in this README, read this:README 전문 보기 ↗Intent-driven commerce on Uniswap v4: a single hook that turns AI payment intent into enforceable restaurant settlement, dynamic pricing, and on-chain loyalty.
Part of FoodyePay, the broader platform for AI-powered restaurant commerce.
FoodySwap is a real Uniswap v4 hook for programmable commerce.
It does not stop at AI intent generation. It enforces merchant validity, time windows, transaction limits, dynamic fees, cashback, loyalty progression, referrals, and VIP rewards inside the swap lifecycle.
If you only read one thing in this README, read this:
FoodySwap is presented publicly as a 5-layer commerce protocol:
This repository implements the on-chain execution and enforcement of that system as a single Uniswap v4 hook.
That distinction matters:
So the website's 5 layers and the repo's single-hook design are not in conflict. They are two levels of the same stack.
Most AI commerce demos stop at intent suggestion.
FoodySwap does not.
FoodySwap takes an AI-generated payment intent and makes it enforceable on-chain:
This is why FoodySwap is not just a loyalty demo. It is a Uniswap v4 hook for real-world programmable commerce.
At the product level, FoodySwap is described as a 5-layer protocol.
At the contract level, those five layers compress into the hook lifecycle:
| Product layer | On-chain implementation in this repo |
|---|---|
| Layer 0: Intent Verification | Intent prepared off-chain and submitted through approved router flow |
| Layer 1: Agent Market | Best execution selected before swap submission |
| Layer 2: Commerce Guard | beforeSwap() merchant checks, hours checks, max transaction checks |
| Layer 3: Smart Pricing | beforeSwap() dynamic fee override via LPFeeLibrary.OVERRIDE_FEE_FLAG |
| Layer 4: Settlement + Loyalty | afterSwap() cashback, tier tracking, referrals, VIP rewards |
FoodySwap uses a single hook contract because that is the cleanest v4 implementation:
FoodySwapHook.sol
|- afterInitialize()
| `- initial dynamic fee setup
|- beforeSwap()
| |- Commerce Guard
| | |- restaurant whitelist verification
| | |- operating hours validation
| | `- per-transaction amount limits
| `- Smart Pricing
| |- tier-based fee discount
| |- peak-hour bonus
| `- dynamic fee override
`- afterSwap()
`- Settlement + Loyalty
|- FOODY cashback mint
|- loyalty points and tier upgrades
|- referral bonus
`- VIP NFT auto-mint
| Permission | Used | Purpose |
|---|---|---|
afterInitialize | Yes | Set initial dynamic LP fee configuration |
beforeSwap | Yes | Enforce merchant constraints and compute dynamic pricing |
afterSwap | Yes | Apply settlement-side rewards and loyalty accounting |
| All others | No | Intentionally omitted |
One important trust-boundary issue was identified during review:
Earlier drafts allowed user identity to be inferred from caller-provided hookData, which could be spoofed.
That is not how the current hook works.
hookData carries only restaurantIdIMsgSender(sender).msgSender()This ties discounts and rewards to the actual transaction initiator instead of trusting user-supplied calldata.
Relevant fix:
ef1b1eb - use IMsgSender instead of spoofable hookData| Contract | Purpose |
|---|---|
src/FoodySwapHook.sol | Main hook implementing constraints, pricing, settlement, and loyalty |
src/FoodyVIPNFT.sol | Soulbound VIP membership NFT |
src/MockUSDC.sol | Testnet / local mock USDC |
test/mocks/MockFoodyToken.sol | Test mock for FoodyeCoin |
| Tier | Threshold | Fee Discount | Cashback Rate | Perks |
|---|---|---|---|---|
| Bronze | $0+ | 2% | 3% FOODY | Base tier |
| Silver | $200+ | 5% | 5% FOODY | Better rates |
| Gold | $500+ | 8% | 7% FOODY | Higher rewards |
| VIP | $1,000+ | 12% | 10% FOODY | Soulbound VIP NFT |
Additional mechanics:
| Partner | Role in FoodySwap | Status |
|---|---|---|
| Uniswap v4 | Hook lifecycle, pool manager, swap callbacks, fee override mechanics | Implemented |
| Base | Target chain for FOODY commerce flows | Implemented / targeted |
| FoodyeCoin (FOODY) | Reward token and loyalty asset | Integrated |
| USDC | Payment-side settlement currency | Integrated |
| OpenZeppelin Uniswap Hooks | BaseHook foundation | Implemented |
| Solmate | NFT and token primitives | Implemented |
| FoodyePay app layer | Voice AI, wallet UX, merchant-facing experience | Platform-level integration |
Potential future extensions:
^0.8.26git clone --recurse-submodules https://github.com/AIoOS-67/foodyswap-hook.git
cd foodyswap-hook
forge build
forge test --match-path test/FoodySwapHook.t.sol
Expected:
18 unit tests passingforge test --match-path test/FoodySwapHook.fuzz.t.sol -vvv
Hookathon validation narrative reflected in recent commits:
Relevant commits:
This repo contains the scripts needed to reproduce the hook flow on Base Sepolia:
script/DeployFoodySwap.s.solscript/CreatePoolSepolia.s.solscript/SetupTestnet.s.solscript/TestSwapSepolia.s.solThese scripts cover:
anvil
forge script script/DeployFoodySwap.s.sol \
--rpc-url http://localhost:8545 \
--private-key <PRIVATE_KEY> \
--broadcast
cp .env.example .env
# fill in your env vars
forge script script/DeployFoodySwap.s.sol \
--rpc-url base_sepolia \
--private-key $PRIVATE_KEY \
--broadcast \
--verify
After deployment, the hook contract must be granted
MINTER_ROLEon the FoodyeCoin contract to mint cashback rewards.
| Asset | Address | Chain |
|---|---|---|
| FoodyeCoin (FOODY) | 0x1022B1B028a2237C440DbAc51Dc6fC220D88C08F | Base |
| USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | Base |
Verification notes:
hookData0.8.26+ compiled with 0.8.30| Area | Mitigation | Status |
|---|---|---|
| Admin privilege | Only admin can add / remove restaurants and update wallets | Implemented |
| Reentrancy | Hook callbacks run through PoolManager flow; no unsafe external flow before state updates | Safe by design |
| Integer overflow | Solidity 0.8+ checks plus fuzz validation | Tested |
| Self-referral | setReferrer() rejects self-referral | Tested |
| Double referral | Referrer can only be set once | Tested |
| Soulbound NFT | VIP NFT transfer is blocked | Tested |
| hookData validation | Swaps without hookData skip loyalty logic safely | Tested |
| Operating hours | Overnight wrapping handled correctly | Fuzz tested |
| Max tx limits | Per-merchant caps reduce abuse | Tested |
| MINTER_ROLE | Cashback minting requires explicit post-deploy permission | Documented |
| Fee bounds | Dynamic fee cannot exceed base LP fee | Fuzz tested |
MIT