USDC-only configuration #49
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add protocol support for operating in "USDC-only" mode.
Details
This adds the following two new fields to the
PoolOverviewaccount:PoolOverviewis created and cannot be updated.is_token_mint_usdcistrue, the protocol will enforce that the native token mint equals the USDC mint.token_rewards_enabledisfalse, staking for delegators and other reward functionality will be disabled. Operator pool commission rates must be 100%, and token amounts in reward payouts must be zero.Testing
All existing tests, and one new test suite for the USDC-only behavior, pass.
Note
Introduce USDC-only mode with new
PoolOverviewflags that disable token rewards and delegator staking, updating instruction constraints, emissions, IDL, and tests.PoolOverviewflags:is_token_mint_usdcandtoken_rewards_enabled.is_token_mint_usdc,mintmust equal USDC mint; if!token_rewards_enabled, disable token rewards and delegator staking.create_pool_overviewnow takes args; wire-through in program and IDL.create_operator_pool/update_operator_pool: require 100% commission when rewards disabled; validate USDC mint in USDC mode.create_staking_record/stake: block delegators when rewards disabled (operators only).create_reward_record/accrue_reward: require zero token rewards when disabled; update emissions check signature to acceptPoolOverview.get_expected_reward_emissions_for_epoch(epoch, &PoolOverview)returns0when rewards disabled; tests updated.TokenRewardsDisabled,DelegatorStakingDisabled,InvalidMintForUsdcMode,InvalidCommissionRateForDisabledRewards.createPoolOverviewArgs; addpoolOverviewtocreateStakingRecord).tests/usdc-only-mode.test.ts; update existing tests to pass new args/accounts.scripts/test-all.shand Anchor configs to include USDC-only test.Written by Cursor Bugbot for commit e87cbff. This will update automatically on new commits. Configure here.