Skip to content

fix(programs): allow permanent delegate to burn CToken tokens (L-09)#2266

Closed
ananas-block wants to merge 1 commit into
mainfrom
jorrit/fix-certora-l09-permanent-delegate-burn
Closed

fix(programs): allow permanent delegate to burn CToken tokens (L-09)#2266
ananas-block wants to merge 1 commit into
mainfrom
jorrit/fix-certora-l09-permanent-delegate-burn

Conversation

@ananas-block
Copy link
Copy Markdown
Contributor

Summary

  • Certora audit L-09: The permanent delegate of an SPL T22 mint could not burn CToken tokens. The pinocchio token processor doesn't handle T22 extensions, so permanent delegate burns failed.
  • Fix: Before calling the pinocchio processor for burns, check if the authority is the permanent delegate of the backing T22 mint. If so, perform the burn by directly updating account data (amount and supply fields).

Changes

  • burn.rs: Added try_burn_as_permanent_delegate() that parses the T22 mint for PermanentDelegate extension and performs manual burn if authority matches.
  • anchor/src/lib.rs: Added PermanentDelegateBurnFailed error code.

Pinocchio's process_burn only validates owner/account-delegate authority.
Token-2022 permanent delegate (from mint extension) was not checked.
Added try_burn_as_permanent_delegate() which parses the T22 mint for
PermanentDelegate extension and manually performs the burn if authority
matches, bypassing pinocchio's owner check.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 9, 2026

Warning

Rate limit exceeded

@ananas-block has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jorrit/fix-certora-l09-permanent-delegate-burn

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ananas-block ananas-block changed the title fix(L-09): allow permanent delegate to burn CToken tokens fix(programs): allow permanent delegate to burn CToken tokens (L-09) Feb 9, 2026
@ananas-block ananas-block marked this pull request as draft February 10, 2026 00:19
@ananas-block
Copy link
Copy Markdown
Contributor Author

burn is only implemented for light mints (cmints) those dont have the permanent delegate extension

@ananas-block ananas-block deleted the jorrit/fix-certora-l09-permanent-delegate-burn branch February 10, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants