From aea75c895afefc452566a8d97952dfd1d0c97fb6 Mon Sep 17 00:00:00 2001 From: OxToF <160028560+OxToF@users.noreply.github.com> Date: Sun, 16 Aug 2026 02:31:31 +0200 Subject: [PATCH] style: cargo fmt, so CI stops failing on every PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `cargo fmt --all --check` has been red on main, which makes the Anchor Build & Lint job fail on any branch that touches nothing Rust at all — two PRs merged today both showed a red check they had no part in. A lint that is always red stops being read. Formatting only, no semantic change: `cargo check` clean. One comment moved rather than reformatted. rustfmt treated the FOUNDER_BORROW_CAP_BPS note as a continuation of the trailing comment on MAX_EXERCISE_FEE_BPS and indented it to column 45, which is worse than what it replaced. It is now a plain block comment at the margin, which is what it always was in intent. Co-Authored-By: Claude Opus 5 --- programs/soladrome/src/lib.rs | 17 ++++++----------- programs/soladrome/src/pol.rs | 8 +++----- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/programs/soladrome/src/lib.rs b/programs/soladrome/src/lib.rs index 74b7daa..95904e0 100644 --- a/programs/soladrome/src/lib.rs +++ b/programs/soladrome/src/lib.rs @@ -125,8 +125,9 @@ pub const DEFAULT_EXERCISE_FEE_BPS: u16 = 1_000; // 10 % of the gain /// it is a guard against an authority setting a value that makes oSOLA worthless as an /// LP incentive, which would be an economic self-inflicted wound, not an exploit. pub const MAX_EXERCISE_FEE_BPS: u16 = 5_000; // 50 % of the gain - // (FOUNDER_BORROW_CAP_BPS removed 2026-07-18 with founder_borrow_usdc — the 7M are ve-escrowed, - // so the founder's only borrow path is borrow_against_locked at PARTNER_BORROW_CAP_BPS, 20%.) + +// FOUNDER_BORROW_CAP_BPS removed 2026-07-18 with founder_borrow_usdc — the 7M are ve-escrowed, +// so the founder's only borrow path is borrow_against_locked at PARTNER_BORROW_CAP_BPS, 20%. pub const FOUNDER_HI_VESTING_SEED: &[u8] = b"founder_hi_vesting"; @@ -660,11 +661,8 @@ pub mod soladrome { } else { // `staked_amount` is still the pre-stake figure here: this harvest settles // what the OLD position earned, before the new deposit is recorded below. - let basis = math::fee_basis( - position.staked_amount, - old_balance, - position.vote_escrowed, - ); + let basis = + math::fee_basis(position.staked_amount, old_balance, position.vote_escrowed); math::pending_fees(acc, position.fees_debt, basis) }; // Entry/exit point: debt = current accumulator (no retroactive claim). @@ -1092,10 +1090,7 @@ pub mod soladrome { .checked_mul(vu - vs) .ok_or(SoladromeError::Overflow)? / vs; - let f = gain - .checked_mul(fee_bps) - .ok_or(SoladromeError::Overflow)? - / 10_000; + let f = gain.checked_mul(fee_bps).ok_or(SoladromeError::Overflow)? / 10_000; u64::try_from(f).map_err(|_| error!(SoladromeError::Overflow))? } }; diff --git a/programs/soladrome/src/pol.rs b/programs/soladrome/src/pol.rs index 01049ae..ea6270c 100644 --- a/programs/soladrome/src/pol.rs +++ b/programs/soladrome/src/pol.rs @@ -68,15 +68,13 @@ pub fn collect_to_pol(ctx: Context, amount: u64) -> Result<()> { // // The base is the uncredited growth, not the whole vault: everything at or below // `last_market_vault_balance` is already promised to stakers and is not POL's to split. - let growth = market_balance.saturating_sub(ctx.accounts.protocol_state.last_market_vault_balance); + let growth = + market_balance.saturating_sub(ctx.accounts.protocol_state.last_market_vault_balance); let max_skim = (growth as u128) .checked_mul(ctx.accounts.pol_state.pol_split_bps as u128) .ok_or(SoladromeError::Overflow)? / 10_000; - require!( - amount as u128 <= max_skim, - SoladromeError::PolSplitExceeded - ); + require!(amount as u128 <= max_skim, SoladromeError::PolSplitExceeded); // Credit stakers only on what the skim leaves behind. saturating_sub also covers the // case where `amount` digs into fees already credited in a previous advance: the