Defi Project
Token claim and staking service on BSC — contracts, signing server, frontend and admin, built around DeFi security review
- My role
- Smart contract, Frontend, Backend, Admin, Security review
The challenge
Users' funds move through claims and staking, so one math error or permission slip means lost money. Not just the contracts but the signing server and frontend had to be checked for any path that leaks funds before mainnet.
Key decisions
Folding AI security-review findings into the design
Acting on an AI-run security review of the contracts, claim signatures now cover the final payout total so a signature can't be replayed for a different amount, and the admin correction path emits events for traceability.
Fixing reward bugs by unifying the model
I found reward-ratio and lockup changes applying retroactively, and instead of patching each case unified the settlement model so the class of bug can't recur.
Operations behind a multisig
Contract ownership moved to a Safe multisig, and routine owner operations are generated as Transaction Builder batches so multi-step changes execute atomically.
Reviewing beyond the contracts
Before mainnet I reviewed the frontend and signing server — not just contracts — for fund-leak paths, auth and chain consistency, and prioritized what had to be fixed before the switch. An AI (Claude) pass came first; confirming findings and setting priorities stayed with people.
Results
- Wrote the main token (LayerZero OFT with a timelock), ERC-721, staking and claim contracts
- Built the EIP-712 signing server, user app and operations admin
- Validated on testnet, then moved to BSC mainnet
Tech
- Solidity — Main token, ERC-721, staking and claim contracts
- LayerZero v2 (OFT) — Reused my earlier LayerZero OFT as the main token, behind a timelock
- DeFi security review — AI-review fixes, settlement bug fixes, pre-mainnet review incl. frontend and signer
- EIP-712 — Claims whose signature covers the final payout total
- Upgradeable contracts (UUPS) — UUPS-proxied staking with Pausable, ReentrancyGuard, SafeERC20
- Multisig operations (Safe) — Ownership on Safe; owner ops as atomic batches
- Hardhat — Hardhat 3 + Ignition
- Next.js — User app, admin and API routes
- wagmi · viem — Reown AppKit + wagmi + viem
- Prisma
- AWS (ECS · RDS · S3) — Fargate
Planning & collaboration
- AI-assisted build & review — Claude for the first security pass; people confirm
- End-to-end ownership — Built everything from contracts to admin solo
- Feature specs