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

Some fixes #676

Merged
merged 2 commits into from
Aug 1, 2023
Merged

Some fixes #676

merged 2 commits into from
Aug 1, 2023

Conversation

a5-pickle
Copy link
Contributor

@a5-pickle a5-pickle commented Aug 1, 2023

For #650

TBTC:

  • Rename Tbtc -> Config.
  • Make Config PDA of TBTC Program instead of using generated keypair (if this were not a PDA, the program can be initialized multiple times).
  • Remove payer when authority can pay lamports.
  • Leverage Anchor 0.28 features like InitSpace derived trait and access_control macro.
  • Remove recipient as required account for recipient token account.
  • Fix tests.

Wormhole Gateway (unfinished):.

  • Add wormhole-anchor-sdk as dependency.
  • Add Custodian account to hold config data and act as mint authority.
  • Rename send_tbtc to send_tbtc_to_gateway (for now, need to either add another instruction to send to network without gateway OR make this instruction handle the case where a gateway does not exist).

TODO:

  • Add two-step owner transfer to TBTC program.
  • Add message encoding/decoding.
  • Add Token Bridge CPI to transfer wrapped tokens with message.
  • Read Posted VAA account to redeem token bridge transfer with message.
  • Audit remaining Gateway logic (commented out receive_tbtc module so program compiles).
  • Add Wormhole Gateway tests.

NOTE: This is still a work in progress. What can be done in the meantime is:

  • Add Wormhole Gateway tests (just a framework is fine, I can add some more in the morning).
  • Think about the optimal design of whether split instructions vs all-in-one instructions make sense (e.g. send_tbtc vs gateway and non-gateway separated).

state: tbtc -> config

make config pda (remove generated keypair)

fix tests
@a5-pickle a5-pickle requested review from pdyraga and eth-r August 1, 2023 03:29
@eth-r eth-r merged commit f58a45d into solana-anchor Aug 1, 2023
23 checks passed
@eth-r eth-r deleted the solana-tbtc-program branch August 1, 2023 16:09
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