Skip to content

Conversation

@rickyrombo
Copy link
Contributor

Adds the close instruction to claimable tokens program. Hardcodes the rent recipient to our relayer funder.

Tested locally using solana-test-validator (tried writing a test but couldn't get the test file to compile)

  • Attempting to close a non-zero balance errors
  • Attempting to close with a different rent recipient errors
  • Attempting to close with our funder succeeds

@changeset-bot
Copy link

changeset-bot bot commented Aug 19, 2025

⚠️ No Changeset found

Latest commit: ae42d8d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@raymondjacobson
Copy link
Member

awesome. probably worth sorting those tests out for the sake of audit.

one additional case id want to test is making sure we can upgrade a version of the previous program that's deployed and then close to the default addy

Copy link
Contributor

@schottra schottra left a comment

Choose a reason for hiding this comment

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

Nothing stands out to me, but I'm also not very seasoned at contract dev :-)

// then we must add instruction to create it
let derived_token_acc_data = config.rpc_client.get_account_data(&pair.derive.address);

println!("claimable_tokens program id: {}", claimable_tokens::id());
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious: Are the println()s for debugging or do we want them permanently? Just wondering if it affects the number of compute units used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Debugging, will remove!

@rickyrombo
Copy link
Contributor Author

one additional case id want to test is making sure we can upgrade a version of the previous program that's deployed and then close to the default addy

Tested this by virtue of it not working on the initial deploy and iterating on the deployment - worked great

@rickyrombo rickyrombo requested a review from alecsavvy August 22, 2025 19:58
Copy link
Contributor

@alecsavvy alecsavvy left a comment

Choose a reason for hiding this comment

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

wow rust!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants