Skip to content

CI rehearsal only (do not merge) - #18

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

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

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

Comment thread crates/core/src/types.rs
Comment on lines +1449 to +1455
/// Build the raw account data for a Token-2022 mint that carries the
/// confidential-transfer mint extension.
///
/// Test-only helper backing the `surfnet_setMint` cheatcode: it writes the
/// extension directly, bypassing the on-chain
/// `ConfidentialTransferInitializeMint`. An absent `authority` or
/// `auditor_elgamal_pubkey` is written as the extension's null value.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

heavy comments here

Comment thread crates/core/src/types.rs
/// The auditor key has to be real ElGamal material: a well-formed 32-byte
/// string that is not a curve point is refused just like a short one, so a
/// mint never ships an auditor key no client can encrypt to.
#[test]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

comments here too long

Comment on lines +1 to +26
// @generated by ts-rs from the Rust types in crates/types.
// Do not edit; run `npm run generate:kit-types` in crates/sdk-node instead.
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

/**
* Writes the Token-2022 `ConfidentialTransferMint` extension on a mint created
* via `surfnet_setMint`.
*
* This is a test-only cheatcode: it writes the extension directly, bypassing
* the real on-chain `ConfidentialTransferInitializeMint` instruction, so a mint
* with a chosen auditor can be created without forking one from mainnet.
*/
export type ConfidentialTransferMintUpdate = {
/**
* The authority that approves new confidential accounts and updates this
* config (base58). Omitted leaves it null.
*/
authority?: string,
/**
* The auditor's ElGamal public key (base58 or base64, 32 bytes), which every
* confidential transfer on this mint also encrypts its amount to. Omitted
* leaves it null, i.e. no auditor.
*/
auditorElgamalPubkey?: string,
/**
* Whether new confidential accounts are approved on creation (default true).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

why all these comments?

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