Open
Conversation
dev-jodee
requested changes
Mar 25, 2026
| # It also serves as a reference for the commands used for building & deploying Solana programs. | ||
| # Run this bad boy with "bash cicd.sh" or "./cicd.sh" | ||
|
|
||
| cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so |
Collaborator
There was a problem hiding this comment.
same issue as the other 2
| "test": "pnpm ts-mocha -p ./tsconfig.json -t 1000000 ./tests/test.ts", | ||
| "build-and-test": "sbpf build --deploy-dir ./tests/fixtures && pnpm test", | ||
| "build": "sbpf build", | ||
| "deploy": "solana program deploy ./program/target/so/program.so" |
Collaborator
There was a problem hiding this comment.
pathing issue here as well
| # instruction data | ||
| .equ INSTRUCTION_DATA_LEN, 0xa188 | ||
| .equ INSTRUCTION_DATA, 0xa190 | ||
| .equ PROGRAM_ID, 0xa198 |
| ### Validations | ||
|
|
||
| # Check number of accounts. | ||
| ldxdw r2, [r1 + NUM_ACCOUNTS] |
Collaborator
There was a problem hiding this comment.
it's not really a problem for this sample use case, but this won't handle duplicate accounts (like if I send account to change and account to create with the same pubkey), the serialization is compacted, so I think it would break the hardcoded offsets
| jne r2, 0, error_initialized # jump if initialized | ||
|
|
||
| # Check account_to_change is already initialized | ||
| ldxdw r2, [r1 + ACCOUNT_TO_CHANGE_LAMPORTS] # load lamports of account to change |
Collaborator
There was a problem hiding this comment.
in the native example of it, we check owner of account to change, would be best to do it here as well for parity
// If we want to modify an account's data, it must be owned by our program.
if account_to_change.owner != program_id {
msg!("Account to change does not have the correct program id.");
return Err(ProgramError::IncorrectProgramId);
};
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.
No description provided.