Skip to content

Support for additional Token22 extensions#3701

Closed
Ikrk wants to merge 5 commits into
otter-sec:masterfrom
Ikrk:additional-token-extensions
Closed

Support for additional Token22 extensions#3701
Ikrk wants to merge 5 commits into
otter-sec:masterfrom
Ikrk:additional-token-extensions

Conversation

@Ikrk
Copy link
Copy Markdown

@Ikrk Ikrk commented May 10, 2025

Hello,
this PR extends the original Token22 Extensions PR #2789 and adds support for additional token mint extensions, namely:

  • transfer fee
  • interest bearing
  • non-transferable
  • default account state

An example of initialization:

const BASIS_POINTS: u16 = 100;
const MAX_FEE: u64 = 10000;
const RATE: i16 = 100;

#[account(
    init,
    ...
    extensions::non_transferable,
    extensions::transfer_fee::config_authority = authority,
    extensions::transfer_fee::withheld_authority = authority,
    extensions::transfer_fee::basis_points = BASIS_POINTS,
    extensions::transfer_fee::max_fee = MAX_FEE,
    extensions::interest_bearing::authority = authority,
    extensions::interest_bearing::rate = RATE,
    extensions::default_account_state::state = AccountState::Frozen,
)]
pub mint: Box<InterfaceAccount<'info, Mint>>,

An example of constraints check:

#[account(
    extensions::non_transferable,
    extensions::transfer_fee::config_authority = authority,
    extensions::transfer_fee::withheld_authority = authority,
    extensions::interest_bearing::authority = authority,
    extensions::default_account_state::state = AccountState::Frozen,
)]
pub mint: Box<InterfaceAccount<'info, Mint>>,

Checking of constraints extensions::transfer_fee::basis_points, extensions::transfer_fee::max_fee and extensions::interest_bearing::rate is currently not supported.

Also I was wondering if it would not be better to have ex. extensions::non_transferable = false instead of only being able to check if the non-transferable extension is enabled?

Fixes #3088.

Let me know what you think. Thanks!

@tiago18c tiago18c added the v1.1 label Apr 8, 2026
@tiago18c
Copy link
Copy Markdown
Collaborator

tiago18c commented Apr 8, 2026

Hey @Ikrk , can you rebase?

@Ikrk Ikrk force-pushed the additional-token-extensions branch from 73dd177 to 60dc2ab Compare April 10, 2026 00:27
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 10, 2026

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

A member of the Team first needs to authorize it.

@Ikrk
Copy link
Copy Markdown
Author

Ikrk commented Apr 10, 2026

Hey @Ikrk , can you rebase?

@tiago18c done

@Ikrk Ikrk force-pushed the additional-token-extensions branch from 60dc2ab to 7b3e1e9 Compare April 10, 2026 00:33
@Ikrk Ikrk force-pushed the additional-token-extensions branch from 7b3e1e9 to f316c59 Compare April 12, 2026 23:31
@Ikrk
Copy link
Copy Markdown
Author

Ikrk commented Apr 12, 2026

Hey @tiago18c , I have fixed the formatting issue. Can you please approve and re-run the workflows? Thanks!

@jamie-osec
Copy link
Copy Markdown
Collaborator

Some of these have been implemented elsewhere:

In the interests of reducing open PRs and because there are significant conflicts here, I'm going to close this. Feel free to open separate PRs for the transfer fee and default account state extensions, including rebasing and updating error codes.

@jamie-osec jamie-osec closed this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to define extensions non_transferable?

3 participants