Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
CreateAccount CPI, with Token 2022 support via a
GetAccountDataSize CPI to determine account size at
runtime (falls back to the fixed 165-byte SPL Token
account size for non-2022 programs)
sol_get_return_datasyscall for reading the tokenaccount size returned by GetAccountDataSize
vault accounts before initialization, with four new error
codes (
BaseVaultIsDuplicate,BaseVaultHasData,QuoteVaultIsDuplicate,QuoteVaultHasData)system_program_idpointer on the frame and use itin both INIT-MARKET-PDA and INIT-VAULT for CreateAccount
CPI program ID (previously set directly on
sol_instruction)program_id,lamports_per_byte,mint,token_account_data_size,get_return_data_program_id,and
get_account_data_size_datafields toRegisterMarketFramefor vault creation stateprogram ID
interface/src/token.rsmodule with SPL Token constants(
ACCOUNT_SIZE,GET_ACCOUNT_DATA_SIZE_DISC)common/token.sassembly file with injected tokenconstants
lamports_per_byteon theframe and populate
signers_seedsin its ensure contractINIT-MARKET-PDA, INIT-VAULT) with new require/ensure
annotations and vault creation pseudocode
check_vault!macro to integration tests for verifyingvault owner, data length, and rent exemption after
successful registration
error paths (
BaseVaultIsDuplicate,BaseVaultHasData,QuoteVaultIsDuplicate{Dup,NonDup},QuoteVaultHasData{Dup,NonDup})mollusk-svm-programs-tokenandspl-token-interfaceinto the test harness for real token program execution
layout.mddirectory tree and add Token constantssection