Skip to Content
Smart Contracts

Smart Contracts

All HUB Voting contracts are deployed on Base, verified on BaseScan, and open source.


Contract Addresses

Base Sepolia (Testnet)

ContractAddress
HubToken0x26e9bE37aF7454deeb40c14e823443983F579A22
HubVotingV30xD8567397de2055Ea2d21be3eE5e5a03E435BAcD0
HubReputation0xf8d9792dC0decd11769b2D771Ef2B792AF301364
HubBattleArenaV60xb3365045B57c4C7C8E74e587Ce0Dc360bDA4DAf3
HubBattleArenaV70xf5dD14198f6Fa7197Bb3B25b310dD51453105abC
HubPresale0x95C6f21607b7C34d180610E9337A0DE65a5EbFcc

Base Mainnet

Mainnet deployment coming soon. Addresses will be published here once live.


HubToken

The native token of HUB Voting. Standard ERC-20 with burn support and EIP-2612 permit (1-click approve+vote).

DetailValue
StandardERC-20 + ERC-20Burnable + EIP-2612 Permit
Total Supply1,000,000,000 HUB (fixed, no minting)
Decimals18

There is no mint function. The total supply is set at deployment and can never increase. Every vote burns HUB permanently, making the supply strictly deflationary.


HubVotingV3

The core voting contract. Handles burn-to-vote mechanics and tracks on-chain reputation data for every voter.

What it does

  • Burns 1 HUB per vote (100%, no protocol fee)
  • Accepts votes for tokens on any blockchain
  • Tracks per-user reputation on-chain
  • Normalizes addresses and blockchain names for consistent hashing
  • Emits VoteExecuted and ReputationUpdated events for indexing

On-chain reputation tracked

FieldDescription
lifetimeVotesTotal votes cast
totalBurnedTotal HUB burned
uniqueTokensVotedDistinct tokens voted on
uniqueBlockchainsDistinct chains used
currentStreakCurrent consecutive voting days
longestStreakBest streak ever achieved

Key parameters

ParameterValue
Vote Cost1 HUB per vote
Min Votes per Tx1
Max Votes per Tx10,000

Voting methods

  • vote() — Standard vote (requires prior ERC-20 approval)
  • voteWithPermit() — 1-click vote using EIP-2612 signature (no separate approval tx)

Security

  • ReentrancyGuard on all state-changing functions
  • Pausable by owner for emergencies
  • Blacklist mechanism for malicious actors
  • String length limits to prevent abuse
  • Address and blockchain normalization to prevent hash collisions

HubReputation

The Hub Score oracle. Reads voting data from HubVotingV3 and combines it with Arena participation to compute a single reputation score.

What it does

  • Reads vote data directly from HubVotingV3 (trustless, no intermediary)
  • Stores Arena participation via an authorized updater
  • Computes getHubScore() with configurable weights
  • Exposes hasMinimumReputation() for easy integration

Score formula

Hub Score = (votes × 5) + (burned × 10) + (tokens × 50, cap 20) + (chains × 100, cap 5) + (streak × 200) + (arenaJoined × 200) + (arenaWon × 1,000)

Weights are configurable by the contract owner without redeployment.

Integration Example

Gate your airdrop, presale, or governance:

interface IHubReputation { function getHubScore(address user) external view returns (uint256); function hasMinimumReputation(address user, uint256 minScore) external view returns (bool); } IHubReputation hubRep = IHubReputation(0xf8d9792dC0decd11769b2D771Ef2B792AF301364); require(hubRep.hasMinimumReputation(msg.sender, 5000), "Hub Score too low");

API Access

EndpointDescription
GET /api/v1/reputation/{address}Full score breakdown for a wallet
GET /api/v1/reputation/leaderboard?limit=50Top users ranked by Hub Score

HubBattleArenaV6

The Arena reward campaign system. Projects deposit reward tokens and burn 12,500 HUB to create a campaign. Community members lock HUB, vote for the campaign’s token, and earn rewards proportional to their votes.

Key parameters

ParameterValue
Campaign Duration1 hour to 30 days
Claim Window6 months (180 days)
Tiers5 levels (100 to 10,000 participants)
Creation Fee12,500 HUB (100% burned)
Min HUB Lock5,000 HUB
Presale Boost+10% reward for presale buyers (on-chain)

For Voters

FunctionDescription
vote()Lock HUB in a campaign
claimHub()Withdraw locked HUB after campaign ends
claimReward()Claim proportional reward share
claimAll()Claim both HUB and rewards in one tx

For Project Creators

FunctionDescription
createCampaign()Launch a new reward campaign
closeCampaign()Sweep unclaimed rewards (after 6-month window)

Eligibility features

  • Optional minimum HUB voting history requirement
  • Optional presale-only restriction
  • Single participation per campaign (no double-joining)

Security

All contracts use OpenZeppelin standard libraries (Ownable, ReentrancyGuard, Pausable), custom errors for gas-efficient reverts, comprehensive event logging, and emergency pause capabilities.

ContractKey Protections
HubTokenNo mint function. Supply fixed forever.
HubVotingV3Blacklist, string limits, address normalization.
HubBattleArenaV66-month claim protection, deposit tiers, anti-grief sweep.

Verify on BaseScan

All contracts are verified and open source. Always verify you’re interacting with the official addresses: