Skip to content

Conversation

@GabrielePicco
Copy link
Contributor

@GabrielePicco GabrielePicco commented Jan 2, 2026

Summary by CodeRabbit

  • New Features
    • On-chain SPL token transfer program with input validation and clear error codes
    • React app for ephemeral token accounts: minting, ATAs, balances, delegation, transfers, drag‑and‑drop quick transfers, alerts, and wallet integration
  • Tests
    • End‑to‑end suite covering minting, delegation, ephemeral transfers, programmatic transfers, undelegation, withdrawals, and balance assertions
  • Documentation
    • READMEs and MIT licenses added for app and workspace
  • Chores
    • Project manifests, build/tooling configs, bundler tweaks, and comprehensive .gitignore rules

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Warning

Rate limit exceeded

@GabrielePicco has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 30 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 85ba9c7 and 41ee866.

📒 Files selected for processing (5)
  • spl-tokens/.gitignore
  • spl-tokens/app/app/package.json
  • spl-tokens/app/app/src/App.tsx
  • spl-tokens/app/tsconfig.json
  • spl-tokens/tests/spl-tokens.ts

Walkthrough

Adds a new spl-tokens workspace: gitignore and manifests, a Solana Anchor program implementing an SPL token CPI transfer, an end-to-end ephemeral-rollup test, and a React frontend (UI, wallet integration, build config, assets, components, styles, and licenses).

Changes

Cohort / File(s) Summary
Workspace & Ignore
spl-tokens/.gitignore, spl-tokens/Cargo.toml
Add comprehensive .gitignore and workspace Cargo.toml with resolver and release profile overrides.
Anchor & Program Manifests
spl-tokens/Anchor.toml, spl-tokens/programs/spl-tokens/Cargo.toml
Add Anchor workspace manifest (toolchain, program IDs, test genesis, provider) and program Cargo.toml with features and dependencies.
On-chain Program
spl-tokens/programs/spl-tokens/src/lib.rs
New Anchor Rust program exposing transfer instruction, TransferTokens accounts struct (owner/mint constraints), and ErrorCode enum.
Integration Tests
spl-tokens/tests/spl-tokens.ts
New end-to-end test exercising minting, ATA creation, ephemeral delegation/transfer/undelegate/withdraw flows and an Anchor programmatic transfer.
Project Manifests & TS Configs
spl-tokens/package.json, spl-tokens/tsconfig.json, spl-tokens/app/tsconfig.json, spl-tokens/app/package.json
Add npm/yarn manifests and TypeScript configs for workspace and frontend (dependencies, scripts, types, strict TS options).
React App: Entry & Public Assets
spl-tokens/app/app/public/index.html, .../manifest.json , spl-tokens/app/app/src/index.tsx
Add React entrypoint and static public assets (HTML shell, web manifest, root mounting).
React App: Core UI & Logic
spl-tokens/app/app/src/App.tsx, spl-tokens/app/app/src/index.css
New App component handling ephemeral accounts, minting, balances, transfer/delegate flows and global styles for the UI.
React App: Components
spl-tokens/app/app/src/components/Wallet.tsx, .../Active.tsx, .../Alert.tsx, .../Button.tsx, .../Square.tsx
Add Wallet provider + SimpleProvider, and UI components: Active, Alert (with AlertProps), Button, Square (framer-motion).
Component Styles
spl-tokens/app/app/src/components/Active.scss, .../Square.scss
Add SCSS styles for Active and Square components.
React Build Configuration
spl-tokens/app/app/craco.config.js
Add CRACO webpack customization (node fallbacks, Buffer ProvidePlugin, publicPath, ignoreWarnings).
Docs & Licenses
spl-tokens/app/README.md, spl-tokens/app/LICENSE, spl-tokens/app/app/README.md, spl-tokens/app/app/LICENSE.md
Add README and MIT license files for app and subdirectory.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • jonasXchen

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat/add spl native example' clearly describes the main change—adding a new SPL (Solana Program Library) native example to the codebase, which is reflected throughout the changeset with new program files, app UI, tests, and configuration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 39

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5919bcc and a320bfc.

⛔ Files ignored due to path filters (9)
  • spl-tokens/Cargo.lock is excluded by !**/*.lock
  • spl-tokens/app/app/public/favicon.ico is excluded by !**/*.ico
  • spl-tokens/app/app/public/magicblock_white.png is excluded by !**/*.png
  • spl-tokens/app/app/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • spl-tokens/app/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • spl-tokens/package-lock.json is excluded by !**/package-lock.json
  • spl-tokens/tests/fixtures/dlp.so is excluded by !**/*.so
  • spl-tokens/tests/fixtures/ephemeral_token_program.so is excluded by !**/*.so
  • spl-tokens/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (29)
  • spl-tokens/.gitignore
  • spl-tokens/Anchor.toml
  • spl-tokens/Cargo.toml
  • spl-tokens/app/LICENSE
  • spl-tokens/app/README.md
  • spl-tokens/app/app/LICENSE.md
  • spl-tokens/app/app/README.md
  • spl-tokens/app/app/craco.config.js
  • spl-tokens/app/app/package.json
  • spl-tokens/app/app/public/index.html
  • spl-tokens/app/app/public/manifest.json
  • spl-tokens/app/app/src/App.tsx
  • spl-tokens/app/app/src/components/Active.scss
  • spl-tokens/app/app/src/components/Active.tsx
  • spl-tokens/app/app/src/components/Alert.tsx
  • spl-tokens/app/app/src/components/Button.tsx
  • spl-tokens/app/app/src/components/Square.scss
  • spl-tokens/app/app/src/components/Square.tsx
  • spl-tokens/app/app/src/components/Wallet.tsx
  • spl-tokens/app/app/src/index.css
  • spl-tokens/app/app/src/index.tsx
  • spl-tokens/app/app/tsconfig.json
  • spl-tokens/app/app/tsconfig.tsbuildinfo
  • spl-tokens/app/tsconfig.json
  • spl-tokens/package.json
  • spl-tokens/programs/spl-tokens/Cargo.toml
  • spl-tokens/programs/spl-tokens/src/lib.rs
  • spl-tokens/tests/spl-tokens.ts
  • spl-tokens/tsconfig.json
🧰 Additional context used
🧬 Code graph analysis (3)
spl-tokens/app/app/src/components/Alert.tsx (1)
roll-dice/app/components/ui/alert.tsx (1)
  • Alert (59-59)
spl-tokens/app/app/src/components/Button.tsx (1)
roll-dice/app/components/ui/button.tsx (2)
  • ButtonProps (36-40)
  • Button (56-56)
spl-tokens/app/app/src/index.tsx (1)
spl-tokens/app/app/src/components/Wallet.tsx (1)
  • Wallet (27-44)
🪛 Biome (2.1.2)
spl-tokens/app/app/src/App.tsx

[error] 697-699: Provide screen reader accessible content when using heading elements.

All headings on a page should have content that is accessible to screen readers.

(lint/a11y/useHeadingContent)


[error] 701-729: Static Elements should not be interactive.

To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.

(lint/a11y/noStaticElementInteractions)


[error] 735-755: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 793-833: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 883-968: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1008-1084: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1162-1175: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1209-1219: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1221-1231: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1236-1248: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)

spl-tokens/app/app/src/components/Button.tsx

[error] 11-20: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)

🪛 Gitleaks (8.30.0)
spl-tokens/Anchor.toml

[high] 9-9: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 12-12: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 markdownlint-cli2 (0.18.1)
spl-tokens/app/app/README.md

24-24: Trailing spaces
Expected: 0 or 2; Actual: 3

(MD009, no-trailing-spaces)

spl-tokens/app/app/LICENSE.md

1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


21-21: Files should end with a single newline character

(MD047, single-trailing-newline)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test-examples
🔇 Additional comments (20)
spl-tokens/app/README.md (1)

37-54: Verify RPC endpoint configuration and defaults.

The documentation specifies fallback endpoints to MagicBlock public services. Please verify that:

  • The endpoint URLs are correct and currently active: https://rpc.magicblock.app/devnet and https://devnet.magicblock.app
  • The environment variable names are correctly referenced in the React app code
  • The documented port 7799 for the ephemeral provider is the expected standard
spl-tokens/Cargo.toml (1)

7-10: Verify overflow-checks in release mode is intentional.

Enabling overflow-checks = true in release builds adds runtime performance overhead. While this is generally disabled in release mode for performance, it may be intentional for Solana programs where security and correctness are prioritized over performance.

Please confirm this is the desired configuration for your use case.

spl-tokens/tsconfig.json (1)

1-10: LGTM!

The TypeScript configuration is well-formatted and uses appropriate modern ECMAScript targets (es2020) for the test environment. The inclusion of Mocha and Chai type definitions properly supports the test suite.

spl-tokens/app/app/src/index.tsx (1)

7-15: LGTM! Clean React 18 bootstrap with proper error handling.

The entry point correctly:

  • Validates the root element exists before attempting to render
  • Uses React 18's createRoot API
  • Wraps the app in StrictMode for development checks
  • Integrates wallet functionality through the Wallet wrapper component

The implementation follows React best practices and provides good error handling.

spl-tokens/package.json (1)

5-5: Test script path is valid. The fullstack-test.sh script exists at the repository root and is executable, so the reference in package.json is correct.

spl-tokens/.gitignore (1)

4-4: Verify gitignore line reference and non-existent directory pattern.

The unignore patterns do work correctly with the **/target/* ignore rule—verified by tracked files in anchor-counter/, anchor-minter/, and bolt-counter/ target directories. However, the file has only 19 lines, not 20 as referenced. Additionally, line 19 references !programs/spl-tokens/target/idl/, which does not exist in the repository. Consider removing this unignore pattern if the directory is not needed, or verify whether it should be added to the codebase.

spl-tokens/app/app/src/components/Active.scss (1)

27-34: LGTM!

The .active-div utility class provides clean centering and styling for the container. The use of fit-content width and auto margins for centering is appropriate.

spl-tokens/Anchor.toml (2)

22-30: LGTM!

The test genesis configuration is properly structured with appropriate program addresses and upgrade settings for test fixtures.


32-33: Verify the test timeout duration.

The test timeout is set to 1,000,000ms (~16.67 minutes), which is exceptionally long. While Solana integration tests with ephemeral rollups may require extended timeouts, please confirm this duration is necessary and not a placeholder value.

spl-tokens/app/app/src/components/Square.scss (1)

1-38: LGTM!

The SCSS styling is well-structured and uses modern CSS techniques effectively. The use of pseudo-elements for the X visual and border-color for the O is a clean, performant approach.

spl-tokens/app/app/src/components/Square.tsx (2)

5-9: LGTM!

The type definition for SquareProps is well-structured with appropriate optional properties and flexible typing for the ind parameter.


12-16: LGTM!

The handleClick implementation correctly guards against undefined values before invoking the callback, preventing potential runtime errors.

spl-tokens/app/app/src/components/Active.tsx (2)

9-23: LGTM!

The component structure is clean and the animation pattern is consistent with other components in the codebase (e.g., Square.tsx).


2-2: > Likely an incorrect or invalid review comment.

spl-tokens/app/app/src/components/Wallet.tsx (2)

30-33: LGTM!

Wallet adapters are correctly memoized with an empty dependency array since they don't depend on any reactive values.


17-25: No changes needed. The SimpleProvider implementation is correct and complete.

The Anchor Provider interface for version 0.32.1 (used in this codebase) requires only the connection and publicKey properties, both of which are provided. Methods like send, sendAndConfirm, sendAll, and simulate are optional, not required. The implementation will not cause runtime errors.

Likely an incorrect or invalid review comment.

spl-tokens/programs/spl-tokens/Cargo.toml (1)

1-25: LGTM!

The Cargo manifest is well-structured with properly pinned Anchor dependencies and appropriate feature flags for the SPL token program.

spl-tokens/programs/spl-tokens/src/lib.rs (2)

14-28: LGTM!

The transfer function correctly validates the amount, constructs the CPI context, and invokes the SPL Token program. The error handling with custom error codes is well-implemented.


31-47: LGTM!

The account constraints properly validate token ownership and mint consistency. The constraint error annotations provide clear error messages for debugging.

spl-tokens/app/app/src/App.tsx (1)

134-172: Security consideration: Storing private keys in localStorage.

Storing keypair secret keys in localStorage exposes them to XSS attacks. While acceptable for a demo/example application, ensure this is documented and never used for real funds.

Consider adding a warning comment:

// ⚠️ WARNING: This stores private keys in localStorage for demo purposes only.
// Never use this approach with real funds or in production applications.

@vercel
Copy link

vercel bot commented Jan 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
er-rolldice Ready Ready Preview, Comment Jan 4, 2026 6:07pm

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

♻️ Duplicate comments (29)
spl-tokens/app/tsconfig.json (1)

1-11: Fix formatting issues in tsconfig.

This file has multiple formatting problems that were previously flagged:

  • Lines 2-9: Inconsistent and excessive indentation (12+ spaces instead of standard 2-4)
  • Line 11: Contains trailing whitespace
  • Lines 5, 7: Uses outdated "lib": ["es2015"] and "target": "es6" while the root spl-tokens/tsconfig.json uses "es2020"

Please address these issues by normalizing indentation, removing trailing whitespace, and aligning ECMAScript versions with the root configuration.

spl-tokens/app/LICENSE (1)

1-21: Consider consolidating duplicate license files.

As previously noted, an identical MIT license file exists at both spl-tokens/app/LICENSE and spl-tokens/app/app/LICENSE.md. Additionally, this file is missing a trailing newline character. Consider maintaining a single canonical license file to avoid synchronization issues.

spl-tokens/app/app/src/components/Active.scss (1)

13-13: LGTM with optional enhancement for smoother transitions.

The styles are well-structured. As previously suggested, consider adding background-color to the transition property for smoother visual changes when toggling between .on and .off states.

spl-tokens/app/README.md (2)

29-49: Standardize npm script command in documentation for consistency.

Both npm run dev (line 34) and npm run start (line 49) are used interchangeably, which may create confusion. As previously noted, pick one command and use it consistently throughout the documentation.


45-45: Format "Examples" as a markdown heading.

Line 45 shows Examples as plain text but should be formatted as a markdown heading (e.g., #### Examples) to maintain consistent document structure and improve readability.

spl-tokens/app/app/public/manifest.json (1)

2-3: Customize PWA manifest names to match the SPL tokens branding.

The manifest still uses generic Create React App placeholders. These should be updated to reflect the actual application name and purpose.

spl-tokens/package.json (2)

3-4: Simplify lint glob patterns for consistency.

The lint patterns are overly complex and may not match files as intended. Consider using simpler standard glob patterns like **/*.{js,ts}.


12-12: Move @solana/spl-token to production dependencies.

The package is used in production code and should not be listed as a devDependency.

spl-tokens/app/app/public/index.html (2)

8-8: Make the meta description more specific.

The current description is generic. Consider making it more descriptive of the SPL token operations and Ephemeral Rollups functionality for better SEO.


11-11: Consider font loading strategy.

The external Google Fonts link may impact privacy, performance, and reliability. Consider self-hosting fonts, using system fonts, or adding a font-display strategy.

spl-tokens/Anchor.toml (1)

12-12: Fix formatting inconsistency.

Line 12 is missing a space after the = operator, which is inconsistent with line 9's formatting.

🔎 Proposed fix
-spl-tokens= "FgvEeit1djLPPjozq9zW9R8Ahu5JpijcdWQxqL4P887"
+spl-tokens = "FgvEeit1djLPPjozq9zW9R8Ahu5JpijcdWQxqL4P887"
spl-tokens/app/app/src/components/Square.tsx (1)

24-31: Remove redundant text content from span.

Line 30 renders {clsName} as text content, but the visual X and O symbols are rendered entirely by CSS pseudo-elements and border styling in Square.scss. The span should be empty.

🔎 Proposed fix
             {clsName && (
                 <motion.span
                     initial={{ scale: 0 }}
                     animate={{ scale: 1 }}
                     className={`counter ${clsName}`}
-                >
-                    {clsName}
-                </motion.span>
+                />
             )}
spl-tokens/app/app/tsconfig.json (2)

3-4: Consider aligning module system with target.

The configuration uses target: "ES2020" with module: "commonjs". For modern React apps targeting ES2020, consider using "module": "esnext" or "module": "es2020" for better tree-shaking and modern module support, unless CommonJS is specifically required for compatibility.


13-13: Consider using the modern JSX transform.

The configuration uses "jsx": "react", which requires importing React in every file that uses JSX. Modern React (17+) supports "jsx": "react-jsx", which eliminates the need for these imports.

🔎 Proposed fix
-    "jsx": "react"
+    "jsx": "react-jsx"

Note: After this change, you can remove import React from 'react'; from files that only use JSX.

spl-tokens/app/app/README.md (1)

1-47: Consider enhancing documentation.

While the README provides basic setup instructions, consider adding:

  • Links to Solana and MagicBlock documentation
  • Troubleshooting section for common issues
  • Architecture overview or diagram showing how the UI interacts with on-chain and ephemeral components
  • Example workflows or screenshots
spl-tokens/app/app/src/index.css (1)

1-233: No additional concerns beyond past reviews.

The CSS file has been previously reviewed. The concerns about Google Fonts CDN usage (line 1) and orphaned tic-tac-toe styling (lines 52-169) were already raised in prior reviews. These should be addressed as noted in the existing comments.

spl-tokens/app/app/src/components/Button.tsx (1)

11-22: Issues previously identified.

The missing type="button" attribute and redundant !disabled check in the onClick handler were already flagged in prior reviews. These should be addressed as noted.

spl-tokens/app/app/craco.config.js (1)

8-17: Buffer package inconsistency was previously flagged.

The use of buffer-browserify in the fallback config while the ProvidePlugin references buffer was already identified in a prior review. This should be consolidated to use the modern buffer package consistently.

spl-tokens/tests/spl-tokens.ts (3)

32-50: Commented-out code was previously flagged.

The commented-out production endpoint configuration was already identified in a prior review. It should be removed or documented.


156-158: Private RPC method usage was previously flagged.

The use of _rpcRequest("getIdentity", []) was already identified as using a private/internal method that may change without notice.


177-178: Assertion messages were previously flagged.

The bare assert() calls without descriptive messages were already identified in a prior review.

spl-tokens/app/app/src/App.tsx (8)

200-208: Private RPC method usage was previously flagged.

The use of _rpcRequest("getIdentity", []) was already identified in a prior review.


235-254: Stale closure concern was previously flagged.

The potential stale closure issue with accounts in ensureAta was already identified. The suggested fix to use accountsRef.current should be applied.


291-291: Debug console.log was previously flagged.


313-313: Debug console.log was previously flagged.


433-511: Code duplication between transfer functions was previously flagged.

The significant overlap between handleTransfer and performQuickTransfer was already identified. Extracting shared logic into a helper would improve maintainability.


697-699: Empty heading accessibility issue was previously flagged.

The <h1> with only whitespace was already identified via static analysis.


701-728: Interactive div missing ARIA attributes was previously flagged.

The drag-and-drop target div lacking proper accessibility attributes was already identified.


735-755: Missing type="button" was previously flagged.

This and all other button elements missing explicit type attributes were already identified in prior reviews.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5919bcc and 5d50368.

⛔ Files ignored due to path filters (9)
  • spl-tokens/Cargo.lock is excluded by !**/*.lock
  • spl-tokens/app/app/public/favicon.ico is excluded by !**/*.ico
  • spl-tokens/app/app/public/magicblock_white.png is excluded by !**/*.png
  • spl-tokens/app/app/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • spl-tokens/app/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • spl-tokens/package-lock.json is excluded by !**/package-lock.json
  • spl-tokens/tests/fixtures/dlp.so is excluded by !**/*.so
  • spl-tokens/tests/fixtures/ephemeral_token_program.so is excluded by !**/*.so
  • spl-tokens/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (29)
  • spl-tokens/.gitignore
  • spl-tokens/Anchor.toml
  • spl-tokens/Cargo.toml
  • spl-tokens/app/LICENSE
  • spl-tokens/app/README.md
  • spl-tokens/app/app/LICENSE.md
  • spl-tokens/app/app/README.md
  • spl-tokens/app/app/craco.config.js
  • spl-tokens/app/app/package.json
  • spl-tokens/app/app/public/index.html
  • spl-tokens/app/app/public/manifest.json
  • spl-tokens/app/app/src/App.tsx
  • spl-tokens/app/app/src/components/Active.scss
  • spl-tokens/app/app/src/components/Active.tsx
  • spl-tokens/app/app/src/components/Alert.tsx
  • spl-tokens/app/app/src/components/Button.tsx
  • spl-tokens/app/app/src/components/Square.scss
  • spl-tokens/app/app/src/components/Square.tsx
  • spl-tokens/app/app/src/components/Wallet.tsx
  • spl-tokens/app/app/src/index.css
  • spl-tokens/app/app/src/index.tsx
  • spl-tokens/app/app/tsconfig.json
  • spl-tokens/app/app/tsconfig.tsbuildinfo
  • spl-tokens/app/tsconfig.json
  • spl-tokens/package.json
  • spl-tokens/programs/spl-tokens/Cargo.toml
  • spl-tokens/programs/spl-tokens/src/lib.rs
  • spl-tokens/tests/spl-tokens.ts
  • spl-tokens/tsconfig.json
🧰 Additional context used
🧬 Code graph analysis (3)
spl-tokens/app/app/src/components/Button.tsx (1)
roll-dice/app/components/ui/button.tsx (2)
  • ButtonProps (36-40)
  • Button (56-56)
spl-tokens/app/app/src/index.tsx (1)
spl-tokens/app/app/src/components/Wallet.tsx (1)
  • Wallet (27-44)
spl-tokens/app/app/src/App.tsx (2)
spl-tokens/app/app/src/components/Wallet.tsx (1)
  • Wallet (27-44)
roll-dice/app/components/ui/alert.tsx (1)
  • Alert (59-59)
🪛 Biome (2.1.2)
spl-tokens/app/app/package.json

[error] 9-9: Missing closing quote

The closing quote must be on the same line.

(parse)


[error] 10-10: expected , but instead found "@solana/spl-token"

Remove "@solana/spl-token"

(parse)

spl-tokens/app/app/src/components/Button.tsx

[error] 11-20: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)

spl-tokens/app/app/src/App.tsx

[error] 697-699: Provide screen reader accessible content when using heading elements.

All headings on a page should have content that is accessible to screen readers.

(lint/a11y/useHeadingContent)


[error] 701-729: Static Elements should not be interactive.

To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.

(lint/a11y/noStaticElementInteractions)


[error] 735-755: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 793-833: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 883-968: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1008-1084: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1162-1175: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1209-1219: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1221-1231: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 1236-1248: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)

🪛 Gitleaks (8.30.0)
spl-tokens/Anchor.toml

[high] 9-9: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 12-12: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 markdownlint-cli2 (0.18.1)
spl-tokens/app/app/LICENSE.md

1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


21-21: Files should end with a single newline character

(MD047, single-trailing-newline)

spl-tokens/app/README.md

1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


21-21: Files should end with a single newline character

(MD047, single-trailing-newline)

spl-tokens/app/app/README.md

1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)


5-5: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


17-17: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


21-21: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


25-25: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


25-25: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


31-31: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


31-31: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


36-36: Bare URL used

(MD034, no-bare-urls)


40-40: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


46-46: Bare URL used

(MD034, no-bare-urls)


47-47: Bare URL used

(MD034, no-bare-urls)


47-47: Files should end with a single newline character

(MD047, single-trailing-newline)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test-examples
🔇 Additional comments (15)
spl-tokens/tsconfig.json (1)

1-10: LGTM!

The TypeScript configuration is clean and properly formatted with appropriate settings for the spl-tokens workspace, including ES2020 support and mocha/chai types for testing.

spl-tokens/Cargo.toml (1)

1-14: LGTM! Solid Rust workspace configuration.

The workspace setup follows Solana/Anchor best practices with appropriate release optimizations (overflow checks for safety, fat LTO and single codegen unit for binary size optimization).

spl-tokens/app/app/src/components/Square.scss (1)

1-38: LGTM!

The SCSS styling is well-structured and effectively uses pseudo-elements (::before and ::after) to render the X symbol and border styling for the O symbol. The visual design is clean and the grid layout centers content appropriately.

spl-tokens/app/app/src/components/Wallet.tsx (2)

27-43: Wallet component structure looks good.

The wallet integration correctly wraps the app with the necessary Solana wallet adapter providers, uses useMemo with stable dependencies for adapter instances, and provides a sensible default RPC endpoint.


17-25: SimpleProvider is exported but not used in this file. The Wallet.tsx component exports SimpleProvider, but it's never instantiated anywhere in spl-tokens. The actual app (App.tsx) uses anchor.AnchorProvider directly for Anchor operations, making the completeness of SimpleProvider not a concern for this file. If SimpleProvider is intended only as a utility for other projects in this monorepo (like session-keys), consider moving it to a shared utilities module or removing it if unused.

Likely an incorrect or invalid review comment.

spl-tokens/programs/spl-tokens/Cargo.toml (1)

22-25: Dependency versions and features look appropriate.

The pinned versions for anchor-lang and anchor-spl ensure build reproducibility. The init-if-needed feature is enabled—be mindful that this allows accounts to be initialized during instruction execution, which requires careful validation to prevent reinitialization attacks in your program logic.

spl-tokens/app/app/craco.config.js (1)

24-29: ProvidePlugin Buffer injection is correctly configured.

The global Buffer injection via ProvidePlugin is necessary for Solana libraries that rely on Node.js Buffer in browser environments.

spl-tokens/tests/spl-tokens.ts (1)

64-159: Test setup and initialization logic is well-structured.

The before hook properly creates a mint, ATAs for both recipients, funds accounts, and mints initial tokens. The assertions verify the setup succeeded before tests run.

spl-tokens/app/app/src/App.tsx (4)

45-53: Formatting helper handles edge cases correctly.

The fmt function properly handles undefined values, negative numbers, and removes trailing zeros from fractional parts.


134-172: LocalStorage persistence for keypairs is appropriate for a demo app.

Storing generated keypairs in localStorage is acceptable for this example/demo application. For production use, this approach would need proper key management.


592-672: Mint setup flow is well-implemented.

The setupAll function correctly creates a mint, ATAs for all accounts, and mints initial tokens in a single transaction. The mint metadata is persisted to localStorage for session continuity.


913-928: Delegation flow handles re-delegation correctly.

The code properly checks if already delegated and performs undelegation first before re-delegating, including waiting for the commitment signature confirmation on L1.

spl-tokens/programs/spl-tokens/src/lib.rs (3)

1-6: LGTM! Imports and program ID are correctly configured.

The imports include all necessary types for SPL token CPI operations, and the program ID declaration follows standard Anchor conventions.


36-46: Account constraints and structure are well-designed.

The constraints on the from account correctly enforce:

  • Ownership validation (line 38): ensures payer owns the token account
  • Mint consistency (line 39): prevents transferring between accounts of different token types

The to and token_program accounts are correctly configured. Note that the previous review comment about token_program being marked as mut appears to have been addressed—line 46 correctly omits any mutability modifier.


49-57: LGTM! Error codes are well-defined and descriptive.

Each error code corresponds to a specific validation check in the program and includes clear, user-friendly messages.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
spl-tokens/Anchor.toml (1)

8-12: Formatting resolved; Gitleaks alerts are false positives.

The formatting inconsistency mentioned in the previous review has been corrected. Regarding the Gitleaks warnings: Solana program IDs are public on-chain addresses, not secrets, so these "Generic API Key" alerts are false positives and can be safely ignored.

The same program ID for both devnet and localnet was already noted in the previous review.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d50368 and 80f3f73.

📒 Files selected for processing (1)
  • spl-tokens/Anchor.toml
🧰 Additional context used
🪛 Gitleaks (8.30.0)
spl-tokens/Anchor.toml

[high] 9-9: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 12-12: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test-examples
🔇 Additional comments (4)
spl-tokens/Anchor.toml (4)

4-6: LGTM!

Feature configuration is appropriate with resolution enabled and linting active.


15-16: LGTM!

Registry configuration is correct.


18-20: LGTM!

Provider configuration is standard for local development.


22-30: Both test fixture files are present in the repository and properly referenced in the configuration.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

♻️ Duplicate comments (1)
spl-tokens/app/app/public/manifest.json (1)

2-3: PWA manifest names appropriately customized.

The manifest correctly uses project-specific branding ("SPL Tokens" and "Ephemeral SPL Token Example") instead of generic Create React App placeholders. This ensures the installed PWA will display proper, recognizable names in browser UI and installed app contexts.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80f3f73 and 85ba9c7.

📒 Files selected for processing (2)
  • spl-tokens/app/app/public/manifest.json
  • spl-tokens/tests/spl-tokens.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test-examples
🔇 Additional comments (2)
spl-tokens/tests/spl-tokens.ts (2)

185-185: Document why preflight simulation is skipped.

skipPreflight: true is used extensively throughout this test (lines 185, 192, 204, 216). Skipping preflight simulation disables transaction validation checks and can hide errors during development. If this is necessary for ephemeral rollup testing, document the reason with a comment.

Also applies to: 192-192, 204-204, 216-216


258-265: Inconsistent use of skipPreflight option.

Line 258 sends the transaction without skipPreflight, while line 265 uses skipPreflight: true. This inconsistency suggests the option may have been added arbitrarily rather than intentionally.

🔎 Proposed fix for consistency
-        await provider.sendAndConfirm(tx, [recipientA], { commitment: "confirmed" });
+        await provider.sendAndConfirm(tx, [recipientA], { commitment: "confirmed", skipPreflight: true });

Likely an incorrect or invalid review comment.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@GabrielePicco GabrielePicco merged commit f5c99ae into main Jan 4, 2026
4 of 5 checks passed
@GabrielePicco GabrielePicco deleted the feat/add-spl-native-example branch January 4, 2026 18:24
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