-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: solana-poc
Are you sure you want to change the base?
Conversation
solana/bridge_token_factory/programs/bridge_token_factory/src/constants.rs
Outdated
Show resolved
Hide resolved
sequence: self.wormhole_sequence.key(), | ||
}, | ||
bumps: ConfigBumps { | ||
config: config_bump, |
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.
Could you explain the purpose of bumps?
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.
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
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.
Why is authority bump calculated but config bump is passed as an argument? What should we pass for config bump?
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.
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)
solana/bridge_token_factory/programs/bridge_token_factory/src/instructions/user/deploy_token.rs
Outdated
Show resolved
Hide resolved
solana/bridge_token_factory/programs/bridge_token_factory/src/instructions/user/repay.rs
Outdated
Show resolved
Hide resolved
solana/bridge_token_factory/programs/bridge_token_factory/src/lib.rs
Outdated
Show resolved
Hide resolved
solana/bridge_token_factory/programs/bridge_token_factory/src/instructions/user/repay.rs
Outdated
Show resolved
Hide resolved
// TODO: correct message payload | ||
let payload = MetadataPayload { | ||
token: self.mint.key().to_string(), | ||
name: self.metadata.name.clone(), |
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.
If a token doesn't have metadata registered, what would the result be? Also, this supports classic token program but not 2022, correct?
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.
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
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.
Do we need separate methods for token22?
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.
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"] } |
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.
Why do we have to specify exact revisions here?
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.
Because of the dependency wormhole-anchor-sdk. I can fork it to fix
No description provided.