Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[WIP] Solana side using classic token program #59

Draft
wants to merge 17 commits into
base: solana-poc
Choose a base branch
from

Conversation

aankor
Copy link

@aankor aankor commented Oct 3, 2024

No description provided.

@aankor aankor marked this pull request as draft October 3, 2024 14:52
sequence: self.wormhole_sequence.key(),
},
bumps: ConfigBumps {
config: config_bump,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain the purpose of bumps?

Copy link
Author

Choose a reason for hiding this comment

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

Saving some CPU by skipping iterating from 255 down to 0 each call (it is required to check the bump is the first one making pubkey out of curve). Not important because we have some CPU per tx + can pay to get more but the check eats unpredicted amount of CPU that's why not perfect

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is authority bump calculated but config bump is passed as an argument? What should we pass for config bump?

Copy link
Author

Choose a reason for hiding this comment

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

There are no authority account passed so anchor doesn't know how to calculate. We can pass it, but less accounts in transaction are always better because the max account count is 32 (there are ways to send more but it requires more work)

// TODO: correct message payload
let payload = MetadataPayload {
token: self.mint.key().to_string(),
name: self.metadata.name.clone(),
Copy link
Contributor

Choose a reason for hiding this comment

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

If a token doesn't have metadata registered, what would the result be? Also, this supports classic token program but not 2022, correct?

Copy link
Author

Choose a reason for hiding this comment

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

Tokens without metadata will be rejected generating an error. I can add token22 support here but token22 may use metadata extension, metaplex or something else so need to have a list of features we need to support

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need separate methods for token22?

Copy link
Author

@aankor aankor Oct 5, 2024

Choose a reason for hiding this comment

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

Not sure. It is possible to put it together, but we need to make metaplex metadata account optional. If we want to support only 2 metadata protocols (metaplex and native token22) it will be ok using Interface + optional metaplex metadata account. Basically, the main reason of separation is different metadata standard not token version


[dependencies]
anchor-lang = { version = "0.30.1", features = ["init-if-needed"] }
anchor-spl = "0.30.1"
anchor-lang = { version = "0.30.1", git = "https://github.com/coral-xyz/anchor/", rev = "06527e57c3e59683c36eb0a5c69ee669100b42e5", features = ["init-if-needed"] }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have to specify exact revisions here?

Copy link
Author

Choose a reason for hiding this comment

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

Because of the dependency wormhole-anchor-sdk. I can fork it to fix

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OmniBridge] : Implement tokens factory on Solana
2 participants