RWAComplyHook is a Uniswap v4 hook for specialized, compliance-aware markets. It enforces tier-based access, retail caps, volatility-aware dynamic fees, and admin safeguards during swap flow.
- Demo video: (https://youtu.be/oxLZlcRivwM)
- Full workflow: full_workflow.md
- Detailed test reference with all cases, commands: docs/test_cases.md
- Tier-based compliance access:
- Tier 0: blocked
- Tier 1: retail (capped)
- Tier 2: institutional
- Dynamic fees based on oracle volatility and user tier
- Admin controls:
- pause and unpause
- set retail cap
- set volatility threshold
- update oracle address
- PoolManager integration tests on the real hook call path
src/RWAComplyHook.sol- main hook logicsrc/MockRWAOracle.sol- volatility oraclesrc/PoolExecutor.sol- swap execution helpersrc/MockERC20.sol- demo tokenstest/RWAComply.t.sol- hook unit teststest/RWAComplyIntegration.t.sol- PoolManager integration testsscript/DeployFull.s.sol- canonical local deployment flowscript/run_canonical_demo.sh- one-command demo runfrontend/- interactive UI and presentation pagedocs/demo_run_log.txt- reproducible local run output
- Start local chain:
anvil- Deploy and run canonical flow:
bash script/run_canonical_demo.sh- Start frontend:
cd frontend
npm install
npm run dev- Open:
http://localhost:3000
forge testMIT