Skip to content

Add interest bearing mint extension#4464

Open
jamie-osec wants to merge 7 commits into
otter-sec:masterfrom
jamie-osec:interest-bearing-mint
Open

Add interest bearing mint extension#4464
jamie-osec wants to merge 7 commits into
otter-sec:masterfrom
jamie-osec:interest-bearing-mint

Conversation

@jamie-osec
Copy link
Copy Markdown
Collaborator

Rebases and adds tests for #3278

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

@Bhargavamacha is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread lang/syn/src/parser/accounts/constraints.rs Outdated
Comment thread lang/syn/src/lib.rs
Comment thread lang/syn/src/codegen/accounts/constraints.rs Outdated
Comment thread lang/syn/src/codegen/accounts/constraints.rs
…lper

The duplicate-detection error in add_extension_interest_bearing_mint_authority
referred to "rate authority"; this is the authority helper, not the rate one.
Mirrors how sibling extensions (group pointer, transfer hook, etc.) reserve
space when either of their two related fields is provided. The CPI also
defaulted to .unwrap() on the rate; default it to 0 so authority-only
configurations work, with the authority free to set a non-zero rate later.
Every other extension Expr is run through check_scope.generate_check; the
newly added interest-bearing fields skipped it, so the optional-account
ergonomics were inconsistent with the rest of the init group.
Adds the interest-bearing rate/authority fields to ConstraintTokenMintGroup,
threads them through the constraint builder, and emits checks in
generate_constraint_mint that read InterestBearingConfig from the mint and
verify current_rate / rate_authority against the user-supplied exprs. Without
this, #[account(mint::interest_bearing::authority = ..)] on a non-init
account would silently pass.

Adds three error codes: ConstraintMintInterestBearingExtension,
ConstraintMintInterestBearingAuthority, ConstraintMintInterestBearingRate.
@jamie-osec jamie-osec requested a review from 0x4ka5h April 27, 2026 13:22
Copy link
Copy Markdown
Collaborator

@0x4ka5h 0x4ka5h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall pr lgtm, but I have question/ doubt, that do we care who controls interest in InterestBearing when we taking it from init_if_needed ?

@jamie-osec jamie-osec force-pushed the interest-bearing-mint branch from 78459e8 to fd78c99 Compare April 30, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants