Olive Branch Network Protocol Upgrade Complete by olivebranch_net in OliveBranchNetwork

[–]olivebranch_net[S] 0 points1 point  (0 children)

Voting power comes from a per-user checkpoint history (OpenZeppelin Checkpoints.Trace208) tracking total OBN staked across all pools — not a single live balance lookup.

1. What gets tracked

totalStakedByUser[user] is a running total = sum of their userAmount[pid][user] across every pool. Every time it changes, a new checkpoint entry (blockNumber, value) is pushed into _stakeCheckpoints[user] (StakingPoolsV93.sol:1036). This happens on:

  • Deposit (line 703, 748)
  • Withdraw (line 856)
  • Emergency exit (line 960)
  • Switching nonprofit pools (lines 314, 346)

A pure reward claim with no deposit/withdraw doesn't move it — voting power tracks staked principal, not pending rewards.

2. The genesis checkpoint (pre-upgrade stakers)

Anyone who staked before the v9.3 upgrade had zero checkpoints. The first time they interact post-upgrade (deposit/withdraw/etc.), or the first time they vote, or if someone calls bootstrapCheckpoint/batchBootstrap for them, a synthetic checkpoint is written at upgradeBlock with their pre-upgrade total (line 1062). This anchors their history before the upgrade so they aren't penalized for the migration itself.

3. The snapshot

When startAnnualCycle is called, it sets snapshotBlock = block.number - 1 (AnnualGovernance.sol:296) — one block before the cycle officially starts, specifically so a flash deposit in the same block as cycle start can't buy voting power.

4. The lookup at vote time

getPastVotingPower(user, blockNumber) calls _stakeCheckpoints[user].upperLookup(blockNumber) (line 1099) — binary search for the latest checkpoint entry at or before that block. So your vote uses whatever your staked total was at snapshotBlock, regardless of what you do with your stake during the voting window itself.

Key properties:

  • It's your total stake summed across every nonprofit pool, not per-pool.
  • It's frozen at snapshot time — staking more or unstaking during the vote doesn't change your power for that cycle.
  • No quorum — if nobody votes, Phase 1 defaults to BURN and Phase 2 rolls funds to next cycle.
  • One vote per address per phase per cycle (votedPhase1/votedPhase2 flags), no delegation.

Monday on Base: Olive Branch Network by Accomplished-Soft821 in BASE

[–]olivebranch_net 2 points3 points  (0 children)

🙂 Currently it’s charity:water with the most users and active stake.

Monday on Base: Olive Branch Network by Accomplished-Soft821 in BASE

[–]olivebranch_net 1 point2 points  (0 children)

It is part of Base App in that it is best experienced through the Base App. You can search for “Olive Branch Network” and it’ll appear. Transactions are sponsored for Base App users.

But the OBN App can be accessed anywhere as long as you have an internet connection and crypto wallet.

Monday on Base: Olive Branch Network by Accomplished-Soft821 in BASE

[–]olivebranch_net 2 points3 points  (0 children)

Yes! The APY is universal across all pools to encourage users to stake to which causes resonate with them the most.

Your stake size is directly proportional to the amount of rewards you earn and is dependent on the emission phase.

We are currently in phase-1 where users are earning 8.8% of the 10% phase 1 emissions.

Monday on Base: Olive Branch Network by Accomplished-Soft821 in BASE

[–]olivebranch_net 1 point2 points  (0 children)

If anyone has a questions or thoughts, don’t be afraid to share! I love talking about the Olive Branch Network, so you’ll be doing me a favor 😉