Skip to content

feat(stablecoin): add ProtocolParameters account type#199

Open
gravityblast wants to merge 1 commit into
mainfrom
stablecoin-plan1-158-protocol-parameters
Open

feat(stablecoin): add ProtocolParameters account type#199
gravityblast wants to merge 1 commit into
mainfrom
stablecoin-plan1-158-protocol-parameters

Conversation

@gravityblast

Copy link
Copy Markdown
Collaborator

closes #158

Copilot AI 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.

Pull request overview

Adds the ProtocolParameters singleton account type to stablecoin_core, including Borsh/serde serialization support, Data conversions, and deterministic PDA derivation helpers. This provides the canonical on-chain configuration container that downstream stablecoin instructions can depend on.

Changes:

  • Introduce ProtocolParameters account type with BorshSerialize/BorshDeserialize, Serialize/Deserialize, and From<&ProtocolParameters> for Data / TryFrom<&Data>.
  • Add PDA seed + PDA address helpers for the single-instance ProtocolParameters account.
  • Add unit tests covering Borsh roundtrips and PDA determinism; re-export the new type/helpers from stablecoin_core::lib.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
programs/stablecoin/core/src/protocol_parameters.rs Adds the ProtocolParameters account struct, Data conversions, PDA helpers, and tests.
programs/stablecoin/core/src/lib.rs Exposes the new module and re-exports ProtocolParameters and PDA helper functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gravityblast gravityblast force-pushed the stablecoin-plan1-158-protocol-parameters branch from 4fa6bad to 092d82c Compare June 26, 2026 10:15
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.

[Plan 1 · 02] ProtocolParameters account type

2 participants