No API keys. No allowlist. No permission slip. The contracts are public, verified, and immutable — your users interact with the exact same bytecode the official app uses.
And here's the part nobody else offers: pass your own address as the usagePlatform and your frontend earns 2% of every tax event your users generate. Forever.
Every tax event splits six ways. One of those ways is reserved for whatever platform the user arrived through — and the user chooses that platform by choosing a frontend. That's you.
Source-verified on Blockscout, ABIs derivable with forge, registry discoverable on-chain. Machine-readable addresses live in deployments.json in the protocol repo.
Entry point. Maps token → vault (registry), enforces the hard-coded tax canon, emits VaultCreated. Creation fee: 0.004 ETH.
The vault itself — ERC-4626 plus dividends: deposits, redemptions, claims, previews, and the *WithPlatform variants that route your 2%.
Splits every tax 80/10/4/2/2/2 and holds each party's balance until they pull. Read-only for you — split logic is immutable.
Everything a portfolio tracker needs is a public view. This is the fastest way to learn the protocol — and a shippable product in an afternoon.
Per vault: asset() (the underlying token), totalAssets(), entryTaxBps() / exitTaxBps() / dividendShareBps() (always 500 / 1000 / 8000 — read them anyway, never hard-code), and factory() to self-verify you're talking to a real DHP vault. Unclaimed dividends for a user: rewards(account). Exact post-tax math: previewDeposit, previewWithdraw, previewRedeem.
import { createPublicClient, http } from "viem";
import { base } from "viem/chains";
const client = createPublicClient({ chain: base, transport: http() });
// live unclaimed dividend balance for a user
const unclaimed = await client.readContract({
address: VAULT_ADDRESS, // from the factory registry
abi: dhpVaultAbi, // forge inspect or Blockscout
functionName: "rewards",
args: [userAddress],
});
// exact shares a user gets after the 5% entry tax
const shares = await client.readContract({
address: VAULT_ADDRESS,
abi: dhpVaultAbi,
functionName: "previewDeposit",
args: [amount], // in token base units
});Discovering vaults: call the factory registry mapping, or index VaultCreated(token, vault, creator, …) logs from block 51,343,897 onward.
Standard ERC-4626 flow: approve the vault, then deposit/mint/withdraw/redeem. The WithPlatform variants are identical except they credit a usage platform — pass your address and the collector owes you 2% of that tax, forever.
import { useWriteContract } from "wagmi";
import { parseUnits } from "viem";
const { writeContract } = useWriteContract();
// user deposits 100 tokens; YOUR frontend is the usage platform
writeContract({
address: VAULT_ADDRESS,
abi: dhpVaultAbi,
functionName: "depositWithPlatform",
args: [
parseUnits("100", tokenDecimals), // gross amount, tax on top comes out of it
userAddress, // receiver of shares
YOUR_PLATFORM_ADDRESS, // ← your 2% lands here
],
});The same pattern exists for all four operations: depositWithPlatform, mintWithPlatform, withdrawWithPlatform, redeemWithPlatform. If a user arrives at your UI without a platform referrer, the plain variants still work — the 2% simply stays with the collector instead of you. Previews are tax-inclusive: show users the preview number and the number that lands is the same number.
Dividends accrue to holders automatically and are claimed, never pushed. Your UI should show the live unclaimed balance and make claiming one click.
// protected claim — revert if the walk-away value dips below minAmountOut
writeContract({
address: VAULT_ADDRESS,
abi: dhpVaultAbi,
functionName: "claimDividend",
args: [minAmountOut], // quote the token first; 0n = accept MEV risk
});
// unclaimed balance for the button label
const pending = await client.readContract({
address: VAULT_ADDRESS, abi: dhpVaultAbi,
functionName: "rewards", args: [userAddress],
});The minAmountOut overload exists because a public claim is a sandwichable transaction. Quote the underlying token (your price feed or a DEX quote), set a sane floor, and surface it as a "slippage protection" toggle in your UI. The official app defaults it on — copy that.
Frontends aren't limited to existing vaults. createVault is permissionless: any token, any community, and the creation platform slot is yours permanently.
writeContract({
address: FACTORY_ADDRESS,
abi: dhpFactoryAbi,
functionName: "createVault",
args: [
tokenAddress, // any ERC-20 the community wants to hold
creatorWallet, // receives the vault-creator 2%
YOUR_PLATFORM_ADDRESS, // receives your 2% on every future tax event
],
value: parseEther("0.004"), // creation fee, anti-griefing
});That 0.004 ETH is the only cost, ever. The vault that pops out is fully formed, immutable, and indexed in the factory registry. If you operate a community tool, this is the difference between integrating DHP and being a DHP deployment channel.
The official frontend is public, MIT-licensed, and already speaks fluent DHP — v1.4.0 registry, wallet flows, tax-inclusive previews, protected claims. Start from working code instead of a blank repo.
1. Clone CryptoSI-DAO/diamond-app — Next.js App Router, wagmi v2 + viem, Tailwind v4.
2. Point it at your own usage-platform address in the config — that flips the 2% revenue routing to you.
3. Rebrand, redeploy (it's a static-friendly Next build — Vercel, Pages, IPFS all work), ship.
decimals() from the underlying token per vault — parse with the right base units. Shares are 18-decimal, assets are whatever the token is.acceptFeesFromTransfer semantics before doing balance math — deltas may not match amounts.Do I need permission or an API key?
No. The contracts are permissionless and public. That's the whole point.
Can I charge my users extra fees on top?
Your 2% usage-platform share is yours to keep or pass on. What you can't do is alter vault economics — those are immutable for everyone, including us.
Is there a testnet?
v1.3.0 vaults still live on Base Sepolia for the curious; v1.4.0 is mainnet-only. Deployments per network: see the networks table.
Where are the ABIs?
Derive with forge inspect DHPImplementation abi in the protocol repo, pull from Blockscout, or copy from deployments.json's verified artifacts.
Who pays for claims and platform payouts?
Gas on claims is paid by the claimer. Platform share accrual is free — the collector books it on every tax event automatically.