A fully on-chain reputation protocol built on ERC-5484 Soulbound Tokens.
Wallet behaviour tracked on-chain. Score evolves. Medal art upgrades automatically. No IPFS dependency.
π Live Demo β’ π» Source Code β’ π ReputationToken β’ π Engine Proxy β’ π ReputationVault
On-chain identity is broken. Wallets are anonymous. There is no way to distinguish a DeFi power user from a fresh wallet. This protocol fixes that.
The ERC-5484 Reputation System assigns every wallet a Soulbound Token β non-transferable, non-mintable by the holder β that reflects their on-chain behaviour score. As the wallet performs positive actions (DAO votes, loan repayments, airdrop holding), their score rises and their medal art upgrades automatically with no re-mint required.
The scoring engine is UUPS upgradeable - logic can evolve as the protocol matures. The token contract is intentionally immutable - SBT ownership records are the ground truth of on-chain identity and must be permanent.
- π Frontend App
- ποΈ Architecture
- β Deployed Contracts
- ποΈ Reputation Tiers & Medal System
- βοΈ Scoring Actions
- π§© Smart Contract Breakdown
- π§ͺ Testing Strategy
- π Local Setup
- Live reputation dashboard β real-time score, tier, voting power, and loan access pulled directly from contracts
- Dynamic SBT medal display β on-chain SVG decoded and rendered from
tokenURI()with no IPFS - All vault actions wired β
castVote,submitProposal,mintNFT,takeLoan,repayLoan,claimAirdrop,settleAirdropβ all executable from the UI - Live cooldown bars β per-action countdown timers that update every second
- 30-day airdrop progress bar β visual hold tracker with early-settle warning
- Animated tier showcase β auto-cycles through all 5 tiers with cinematic morph transitions
- Scroll-reveal sections β intersection observer based section animations
- Particle canvas background β same as landing page, with comet trails
| Decision | Rationale |
|---|---|
| Token is immutable | SBT ownership is ground truth β upgradeability would allow silent record tampering |
| Engine is UUPS upgradeable | Scoring logic must evolve; token state must not |
| On-chain SVG medals | Zero IPFS dependency β token lives as long as Ethereum |
| Dynamic metadata | tokenURI() reads live score from engine β medal upgrades on score change, no re-mint |
_mint not _safeMint |
SBTs have no receiver contract β onERC721Received is meaningless and adds reentrancy surface |
_update() override |
Exhaustively blocks all OZ transfer paths in one hook |
All contracts deployed and verified on Ethereum Sepolia Testnet.
| Contract | Address | Etherscan |
|---|---|---|
| ReputationToken | 0x9c77Ce31a110e360d62e4eF8B1F4cf8576F70F46 |
π View |
| ReputationEngine (Impl) | 0xC81532619d5fB4728932A43A77Bfea04c3df5957 |
π View |
| ReputationEngine (Proxy) | 0x4eFC1adc7Dd594C4bB04865B6dCc5101392FaBD8 |
π View |
| ReputationVault | 0xd53320CDEF6f3DfA54436D2806e765d6d6bD98b6 |
π View |
Interact with the proxy address only β never the implementation directly.
Every wallet's SBT displays a dynamic on-chain SVG medal that reflects their current tier. No IPFS. No centralized server. The medal art is generated entirely in Solidity and upgrades automatically as score increases.
| Tier | Score Range | Medal Design | Voting Power | Loan Limit |
|---|---|---|---|---|
| Unranked | 0 β 99 | Grey hexagon + ? |
0.5Γ | None |
| Bronze π₯ | 100 β 299 | Copper circle + 6-point star | 1Γ | 20% of collateral |
| Silver π₯ | 300 β 599 | Silver circle + 5-point star | 1.5Γ | 40% of collateral |
| Gold π₯ | 600 β 849 | Gold circle + crown + gems | 2Γ | 60% of collateral |
| Platinum π | 850 β 1000 | Platinum ring + diamond | 3Γ | 80% of collateral |
Actions are recorded through the ReputationVault. Each action maps to a signed score delta enforced by the ReputationMath library. Raw deltas are never exposed β only the Action enum is accessible to callers.
| Action | Function | Score Delta | Cooldown |
|---|---|---|---|
| DAO Vote | castVote() |
+10 | 12 hours |
| DAO Proposal | submitProposal() |
+25 | 24 hours |
| Loan Repaid | repayLoan() |
+30 | None (natural gate) |
| Loan Defaulted | markDefault() |
β50 | None (owner only) |
| Airdrop Held 30d | settleAirdrop() |
+15 | None (natural gate) |
| Airdrop Dumped | settleAirdrop() |
β20 | None (natural gate) |
| NFT Minted | mintNFT() |
+5 | 12 hours |
Score is always clamped to [0, 1000]. Underflow and overflow are impossible by design.
src/
βββ ReputationToken.sol # ERC-5484 SBT β immutable, transfer-locked
βββ ReputationEngine.sol # UUPS scoring engine β issues SBTs, tracks scores
βββ ReputationVault.sol # Action simulator β user entry point
βββ interfaces/
β βββ IReputationToken.sol # Full error + event surface for callers
β βββ IReputationEngine.sol # CEI order + reentrancy requirements documented
βββ libraries/
βββ ReputationMath.sol # Pure math β Action enum, score clamping, tier resolution
βββ ReputationSVG.sol # On-chain SVG medal generator β 5 tier designs
- Enum-gated deltas β arbitrary
int256deltas are never exposed. OnlyActionenum variants can mutate scores. - Overflow guards β
_applyDelta()has early-exit guards for extreme deltas, future-proofing against new high-magnitude actions. - Single guard pattern β
_assertValidScore()is called once per public entry point._resolveTierUnchecked()avoids a double-guard intierName(). - Zero state β pure library. Zero reentrancy surface.
| Invariant | Enforced By |
|---|---|
| One SBT per wallet | s_walletToToken[to] != 0 check in issue() |
| Engine address immutable post-deploy | setEngine() reverts with EngineAlreadySet on second call |
| Transfer always reverts | _update() override β catches all OZ paths |
| Score always in [0, 1000] | ReputationMath.applyAction() β clamped by design |
| All storage writes before external calls | Strict CEI in recordAction() and all Vault functions |
| No re-entrancy | nonReentrant on all state-changing engine + vault functions |
| SBT auto-issued on first action | token.issue() called last in CEI β after all storage writes |
The project uses a 4-layer testing approach with Foundry.
test/
βββ unit/
β βββ ReputationMathTest.t.sol # Score math, tier resolution, delta clamping
β βββ ReputationTokenTest.t.sol # SBT issuance, transfer lock, burn, ERC-5484
β βββ ReputationEngineTest.t.sol # recordAction CEI, auth, score updates
β βββ ReputationVaultTest.t.sol # All actions, cooldowns, loan/airdrop lifecycle
βββ integration/
β βββ ReputationFlowTest.t.sol # Full lifecycle: Unranked β Bronze β Gold
βββ fuzz/
βββ FuzzReputation.t.sol # Score bounds, loan math, SBT uniqueness
# Full suite
forge test -v
# Vault tests only
forge test --match-contract ReputationVaultTest -vvvv
# Fuzz tests
forge test --match-path test/fuzz/* -vvvvcd web3-app
npm install
npm run dev
# β http://localhost:3000
---
Engineered by NexTech Architect
π Live Demo Β· Connect on π
Smart Contract Developer Β· Solidity Β· Foundry Β· Web3 Engineering