Skip to content

Conversation

@tilo-14
Copy link
Contributor

@tilo-14 tilo-14 commented Jan 27, 2026

Summary

  • Add programs/anchor/ workspace with basic SPL token instruction examples
  • Add basic-instructions/ - approve, burn, close, create-ata, create-mint, create-token-account, freeze, mint-to, mint-to-checked, revoke, thaw, transfer-checked, transfer-interface
  • Add basic-macros/ - counter, create-ata, create-mint, create-token-account
  • Include test suite and shared test utilities

Test plan

  • Run cargo test-sbf in each program directory
  • Verify all examples compile with cargo build-sbf

Open with Devin

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional flags.

Open in Devin Review

@tilo-14 tilo-14 changed the title Add Anchor examples for basic SPL token instructions Add Anchor examples basic Jan 28, 2026
@tilo-14 tilo-14 force-pushed the add-anchor-clean branch 2 times, most recently from 29fe205 to ee3f30f Compare January 29, 2026 15:15
README.md Outdated
Comment on lines 32 to 36
- **delegate-approve** - Approve delegate
- [Action](typescript-client/actions/delegate-approve.ts)
- **delegate-revoke** - Revoke delegate
- [Action](typescript-client/actions/delegate-revoke.ts)

Choose a reason for hiding this comment

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

revert?

pub mod light_token_anchor_transfer_interface {
use super::*;

pub fn transfer(ctx: Context<TransferAccounts>, amount: u64, decimals: u8) -> Result<()> {

Choose a reason for hiding this comment

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

this wont work with spl or t22 only light to light.
Pls extend so that it works with any token

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View issue and 13 additional flags in Devin Review.

Open in Devin Review

Comment on lines +8 to +11
declare_id!("672fL1Nm191MbPoygNM9DRiG2psBELn97XUpGbU3jW7E");

pub const LIGHT_CPI_SIGNER: CpiSigner =
derive_light_cpi_signer!("672fL1Nm191MbPoygNM9DRiG2psBELn97XUpGbU3jW7E");

Choose a reason for hiding this comment

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

🟡 Duplicate program ID between create-and-transfer and token-transfer programs

Both create-and-transfer and token-transfer programs declare the same program ID 672fL1Nm191MbPoygNM9DRiG2psBELn97XUpGbU3jW7E and the same LIGHT_CPI_SIGNER.

Click to expand

Impact

Both programs are listed as workspace members in Anchor.toml (lines 13-14) and Cargo.toml (lines 9-10). When attempting to build or deploy both programs:

  • Only one can be deployed to that address on-chain
  • Build artifacts may overwrite each other
  • The Anchor workspace will have conflicting program configurations

Code references

  • basic-macros/create-and-transfer/src/lib.rs:8: declare_id!("672fL1Nm191MbPoygNM9DRiG2psBELn97XUpGbU3jW7E")
  • basic-macros/create-and-transfer/token-transfer/src/lib.rs:8: declare_id!("672fL1Nm191MbPoygNM9DRiG2psBELn97XUpGbU3jW7E")

The programs appear to be nearly identical code duplicates, suggesting token-transfer should either be removed or given a unique program ID.

Recommendation: Either remove the duplicate token-transfer program, or assign it a unique program ID by generating a new keypair and updating both the declare_id! and derive_light_cpi_signer! macros.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

tilo-14 added 4 commits January 30, 2026 18:19
Basic instruction examples: approve, burn, close, create-ata,
create-mint, create-token-account, freeze, mint-to, revoke, thaw,
transfer-checked, transfer-interface.

Basic macro examples: counter, create-ata, create-mint,
create-token-account, create-and-transfer with token-transfer.
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.

3 participants