Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stake-pool: Enforce that pool mint uses 9 decimal places (HAL-03) #5085

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

joncinque
Copy link
Contributor

Problem

It's possible to create a stake pool with some number of decimals that isn't equal to 9. This has absolutely no impact on the functioning of the program, but if a stake pool mint has 2 decimals, when you deposit 1 SOL, you would get ~10,000,000.00 tokens. It's the same number underneath, but it would look wildly different.

Solution

Although the tooling already uses 9 in most places to avoid this exact issue, let's just enforce it on-chain to avoid any confusion.

@joncinque joncinque merged commit c9edc4d into solana-labs:master Sep 1, 2023
9 checks passed
@joncinque joncinque deleted the hal3 branch September 1, 2023 16:55
thlorenz added a commit to ironforge-cloud/solana-program-library that referenced this pull request Sep 4, 2023
* master: (719 commits)
  release: Bump token-2022 and all dependencies (solana-labs#5189)
  SPL errors from hashes (solana-labs#5169)
  stake-pool: Add comments about unnecessary ownership checks (HAL-01) (solana-labs#5084)
  stake-pool: Enforce that pool mint uses 9 decimal places (HAL-03) (solana-labs#5085)
  build(deps-dev): bump tsx from 3.12.7 to 3.12.8 in /single-pool/js (solana-labs#5188)
  account-compression: Fixup sdk doc deployment (solana-labs#5187)
  token-js: renamed `getExtraAccountMetaAccount` to `getExtraAccountMetaAddress` (solana-labs#5186)
  token-js: added an e2e test for transferring using a mint with a transfer hook extension (solana-labs#5138)
  Serde optional dependencies clean-up (solana-labs#5181)
  build(deps): bump chrono from 0.4.27 to 0.4.28 (solana-labs#5180)
  stake-pool: Use unaligned types for safe pointer cast (solana-labs#5179)
  spl-pod: make code docs more explicit (solana-labs#5178)
  token-js: added extra account resolution for transfer hook extension (solana-labs#5112)
  Fix incorrect code doc (solana-labs#5177)
  Move Pod types to separate library (solana-labs#5119)
  build(deps-dev): bump @typescript-eslint/eslint-plugin from 6.4.1 to 6.5.0 in /memo/js (solana-labs#5176)
  build(deps): bump chrono from 0.4.26 to 0.4.27 (solana-labs#5171)
  build(deps-dev): bump prettier from 3.0.2 to 3.0.3 in /token-swap/js (solana-labs#5174)
  build(deps-dev): bump prettier from 3.0.2 to 3.0.3 in /token/js (solana-labs#5172)
  build(deps-dev): bump prettier from 3.0.2 to 3.0.3 in /token-lending/js (solana-labs#5173)
  ...
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.

None yet

1 participant