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

solana: add recovery flow #418

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

solana: add recovery flow #418

wants to merge 9 commits into from

Conversation

kcsongor
Copy link
Contributor

@kcsongor kcsongor commented Apr 18, 2024

See recovery.rs for an explanation of the flow.

The associated token program instructions default to the legacy SPL
token program. We pass the token_program as an argument to support
token2022 tokens too.
TODO: the old token program still works -- is this secure? I think so
but double check
to be able to test if it was executed
@kcsongor kcsongor force-pushed the solana/recovery branch 2 times, most recently from abe704d to 233aea6 Compare April 18, 2024 22:31
wip because with this the test tx size is 5 bytes larger (for transfer)
than the limit. The way to mitigate is to introduce lookup tables.
That mitigation will exist in the tests, but will also have to be done
on real deployments (since the transfer hooks might add an arbitrary
number of extra acconuts, so we should leave as much headroom as possible)
@kcsongor kcsongor force-pushed the solana/recovery branch 2 times, most recently from b3ab0ae to 82f9e94 Compare April 19, 2024 16:38
@kcsongor kcsongor marked this pull request as ready for review April 19, 2024 16:38
@@ -9,15 +9,17 @@ crate-type = ["cdylib", "lib"]
name = "example_native_token_transfers"

[features]
default = ["mainnet"]
default = ["owner-recovery", "mainnet"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should remove this by default (mainnet too)

@tonyjin
Copy link
Contributor

tonyjin commented Apr 25, 2024

We've had some discussions about whether or not this should be included, and are currently thinking that this functionality could be provided to integrators directly instead of existing in the main reference repo.

@kcsongor kcsongor force-pushed the solana/token22 branch 5 times, most recently from 0e19d3c to bf49cab Compare April 30, 2024 18:53
@kcsongor kcsongor marked this pull request as draft May 1, 2024 18:15
@nik-suri nik-suri added the abi Changes Contract ABI label May 1, 2024
@kcsongor kcsongor force-pushed the solana/token22 branch 4 times, most recently from c8bc683 to 4b564c0 Compare May 2, 2024 16:37
Base automatically changed from solana/token22 to main June 12, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi Changes Contract ABI on hold
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants