-
Notifications
You must be signed in to change notification settings - Fork 36
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
Prototyping canonical SolanaTBTC
token with Anchor
#650
Conversation
cross-chain/solana/solana-tbtc-anchor/programs/solana-tbtc-anchor/src/lib.rs
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/programs/solana-tbtc-anchor/src/lib.rs
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/tests/solana-tbtc-anchor.ts
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/programs/solana-tbtc-anchor/src/lib.rs
Outdated
Show resolved
Hide resolved
cross-chain/solana/solana-tbtc-anchor/programs/solana-tbtc-anchor/src/lib.rs
Outdated
Show resolved
Hide resolved
Do you think we can change the project structure like:
|
|
||
pub fn initialize(ctx: Context<Initialize>) -> Result<()> { | ||
let tbtc = &mut ctx.accounts.tbtc; | ||
tbtc.authority = ctx.accounts.authority.key(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor issue, but this authority should be the same pubkey as the one who deployed the program. The upgrade authority (found in this program's program data, which is an account owned by BpfLoaderUpgradeable
) will be this authority. Unlikely, but someone can race you to initialize the instruction after you deploy, setting himself as the authority.
Also a note about upgradeability: how do you plan on managing this? Multisig? You should set the upgrade authority to your multisig address in this instruction. Or it can be managed by an external program, where that external program's PDA can be the upgrade authority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the deployment on mainnet
we want to set the upgrade authority as Threshold Council multisig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments.
I also did not see any CPI with the token bridge yet, but I assume this is a work-in-progress. I can take a look again once these CPI calls are written.
state: tbtc -> config make config pda (remove generated keypair) fix tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: Wormhole Gateway is still a work-in-progress. Everything looks good so far.
Can't approve this myself, but looks good to me. |
Refs: #656
This PR is a continuation of tBTC expansion to L2s, sidechains, and non-EVM chains - here Solana. Solana module in large should replicate the same functionality as available in other cross-chain modules like Arbitrum, Optimism, and Polygon. It brings tBTC to Solana with the help of Wormhole. Here's a diagram to illustrate the flow
Wormhole TokenBridge
on Ethereum - holds all TBTC bridged to Solana. This is an external contract created by the Wormhole team.Wormhole TokenBridge
on Solana - mints Wormhole wrapped TBTC ie. wormholeTBTC. This is an external contract created by the Wormhole team.SolanaWormholeGateway
on Solana - acts as a vending machine that wraps and unwraps wormholeTBTC to the canonical tBTC token on Solana. (TO BE YET IMPLEMENTED by the Threshold team)SolanaTBTC
- canonical tBTC token on Solana. This PR creates it and sets up the project structure.Links: