Skip to content

CI rehearsal only (do not merge) - #23

Closed
michael-moffett wants to merge 1 commit into
mainfrom
surfpool-706-setmint-a7
Closed

michael-moffett wants to merge 1 commit into
mainfrom
surfpool-706-setmint-a7

Conversation

@michael-moffett

Copy link
Copy Markdown
Member

Fork CI only. Do not merge.

Add a `surfnet_setMint` cheatcode that creates or patches a mint, optionally writing the Token-2022 `ConfidentialTransferMint` extension (authority, auditor ElGamal pubkey, auto-approve).

Lead 3 of : builders must fork a mainnet mint today because there is no way to spin up a confidential-capable mint with a chosen auditor and decimals.
@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds test-only cheatcode for mint configuration.

Do not merge until explicit null correctly clears an existing confidential mint authority and auditor.

Findings

  1. P1 Explicit null does not clear ▶

Summary

Adds surfnet_setMint to create or patch SPL Token and Token-2022 mints, including confidential-transfer configuration, and exposes it through the Node SDK.

  • Preserves existing mint extensions and tops up lamports for the resulting account size.
  • Adds Rust tests for creation, extension updates, owner checks, and confidential-token-account integration.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["setMint request"] --> B["Load existing mint or generate one"]
  B --> C["Check token-program owner"]
  C --> D["Apply base-field updates"]
  D --> E{"Confidential update?"}
  E -- Yes --> F["Build or patch Token-2022 extension"]
  E -- No --> G["Repack base; preserve extensions"]
  F --> H["Top up rent and write account"]
  G --> H
Loading

Reviews (1) · Last reviewed commit: "feat(core): surfnet_setMint cheatcode wi..."

Comment thread crates/core/src/types.rs
Comment on lines +1460 to +1465
let authority = conf
.authority
.as_ref()
.map(|key| key.as_deref().map(Pubkey::from_str).transpose())
.transpose()
.map_err(|e| format!("authority: {e}"))?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Explicit null does not clear When surfnet_setMint receives confidential.authority: null or auditorElgamalPubkey: null for an existing mint extension, this parsing treats the null like an omitted field. The later assignments are skipped, so the old authority or auditor remains instead of being removed. The new null-removal test covers this case and will fail.

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.

1 participant