Revenue Sharing Infrastructure

Treasury Stake Revenue Vault

A community piggy bank with a timer. Stake tokens, wait for the lock to expire, and claim your share of rewards β€” while staked tokens flow to the treasury.

What Is It?

Think of it like a community piggy bank with a timer. People put their tokens in the piggy bank, wait for the timer to finish, and then get their share of any rewards that came in β€” but the tokens they put in go to a special treasury wallet instead of coming back to them.

🎯

Goal

Share revenue with token stakers, then collect staked tokens for treasury

Three Simple Phases

The vault lifecycle from staking to claiming

PHASE 1

Staking Period

Before lock expires

Stake (deposit) tokens anytime
Unstake (withdraw) tokens anytime
No claiming rewards yet

Revenue (WETH, USDC) accumulates in vault

Full flexibility to change stake

PHASE 2

Lock Expires

The snapshot moment

πŸ“Έ
Snapshot captures all balances
No more staking allowed
No more unstaking allowed

Percentages are calculated and frozen

Prevents last-second gaming

PHASE 3

Claiming Period

After lock expires

Claim proportional rewards
Rewards β†’ Your wallet
Staked tokens β†’ Treasury

One claim per user

Get rewards, tokens go to treasury

Visual Flow

How tokens and rewards move through the vault

STAKE

Before Lock Expires

Tokens

β†’ Vault

UNSTAKE

Before Lock Expires

Tokens

β†’ User

CLAIM

After Lock Expires

Rewards

β†’ User

Tokens

β†’ Treasury

Key Concepts

πŸͺ™

Staking Token

The token users deposit to participate. This is an existing token (like a project's governance token).

πŸ’°

Reward Tokens

The tokens distributed as rewards (like WETH or USDC). These accumulate in the vault over time.

🏦

Treasury Wallet

Where staked tokens go when users claim. This is typically controlled by the project/DAO.

Lock Duration

How long users must wait before claiming. After this period, the staking snapshot is taken.

πŸ“Έ

Snapshot

A frozen record of everyone's stake at lock expiry. This ensures fair reward distribution.

Pro-Rata Share

Your share of rewards is proportional to your staked amount vs total staked.

Why Does This Exist?

Use Case: Revenue Sharing with Token Collection

Imagine a project that wants to:

1

Reward loyal token holders with revenue

2

Collect tokens for treasury/burn/redistribution

This vault does both in one transaction!

Real World Analogy

Like a "thank you bonus" program where employees who stay until year-end get a bonus, but must surrender their company shares to receive it.

Contract Addresses

Base Mainnet

Factory
0x5563Da84e2FE96B027E87ea1699B83523018507C
First Vault
0x1F05208d6534b3c54986A946C384C976dbB95001

First Vault Configuration

Staking Token:0x43c5F79d81e1150799a0af383921a97480C62415
Treasury Wallet:0x99C515BC95E43697B38f419d5359A3876B68E538
Reward Tokens:

WETH, USDC

Lock Duration:

1 day (86,400 seconds)

Common Questions

What if I stake and then change my mind?

No problem! Unstake anytime before the lock expires. You get 100% of your tokens back.

What if I forget to claim?

Your rewards wait for you! There's no deadline to claim after the lock expires.

Can I claim multiple times?

No. Each user can only claim once. All rewards and staked tokens are handled in one transaction.

What happens to my staked tokens?

They go to the treasury wallet when you claim β€” NOT back to you. You only receive the rewards.

What if no revenue comes in?

You can still claim, but you'll receive 0 rewards. Your staked tokens still go to treasury.

Can I stake after the lock expires?

No. Once the lock expires, no staking or unstaking is allowed.

For Developers

Deploy a New Vault

factory.deployVaultWithTreasury(
    salt,                    // Unique identifier for CREATE2
    stakingTokenAddress,     // Token users will stake
    treasuryWallet,          // Where staked tokens go on claim
    vaultOwner,              // Admin of the vault
    [wethAddress, usdcAddress], // Reward tokens array
    86400                    // Lock duration in seconds (1 day)
);

User Interactions

// Before lock expires:
vault.stake(amount);      // Deposit tokens
vault.unstake(amount);    // Withdraw tokens

// After lock expires:
vault.claim();            // Get rewards, tokens go to treasury

πŸ‘View Functions

vault.stakedBalance(user);        // User's current stake
vault.userStakedSnapshot(user);   // User's frozen stake at lock expiry
vault.estimatedRewards(user);     // Predicted reward amounts
vault.isLockExpired();            // Check if claiming is available
vault.timeUntilUnlock();          // Seconds until lock expires

Summary

PhaseTime PeriodUser Can DoWhat Happens
StakingBefore lock expiresStake, UnstakeTokens move freely
LockAt expiry momentNothingSnapshot taken
ClaimingAfter lock expiresClaim onlyRewards β†’ User, Tokens β†’ Treasury

Ready to deploy your own revenue vault?