SWAP-410 feat: add transfer check validation when receiver is different than taker - #77
Merged
Merged
Conversation
Coverage report
|
Coverage report
|
Collaborator
Author
|
/bot review |
|
Bot Agent progress:
Progress:
|
There was a problem hiding this comment.
Verdict
Comment
Review coverage
Findings: P0:0 P1:1 P2:1 P3:0
Reviewed by: Codex single reviewer + Codex
Summary
Receiver-transfer validation was added, but the patch introduces a clippy-blocking test helper and leaves native SOL receiver transfers order-insensitive relative to the fill instruction.
Findings
- [P1]
order-engine-sdk/src/fill.rs:643New test helper fails clippy with too many arguments - [P2]
order-engine-sdk/src/fill.rs:161Native receiver transfer can be validated before the fill (via Codex)
Repo checks
Repo Checks
- rustup component add --toolchain 1.87.0-x86_64-unknown-linux-gnu rustfmt: ok
info: component rustfmt is up to date
- rustup component add --toolchain 1.87.0-x86_64-unknown-linux-gnu clippy: ok
info: component clippy is up to date
- cargo fetch --locked: ok
p-table-program v2.2.7
Downloaded solana-tls-utils v2.2.7
Downloaded solana-type-overrides v2.2.7
Downloaded solana-program-runtime v2.2.7
Downloaded solana-account-decoder-client-types v2.2.7
Downloaded arbitrary v1.4.1
Downloaded utoipa-gen v5.3.1
Downloaded solana-vote v2.2.7
Downloaded solana-builtins-default-costs v2.2.7
Downloaded solana-thin-client v2.2.7
Downloaded solana-zk-token-sdk v2.2.7
Downloaded solana-zk-sdk v2.2.7
Downloaded solana-rpc-client-api v2.2.7
Downloaded solana-tpu-client v2.2.7
Downloaded solana-transaction-metrics-tracker v2.2.7
Downloaded solana-sdk v2.2.2
Downloaded solana-metrics v2.2.7
Downloaded solana-ed25519-program v2.2.2
Downloaded derive_arbitrary v1.4.1
Downloaded solana-cost-model v2.2.7
Downloaded solana-stake-program v2.2.7
Downloaded solana-quic-client v2.2.7
Downloaded solana-pubsub-client v2.2.7
Downloaded solana-rpc-client v2.2.7
Downloaded solana-inline-spl v2.2.7
Downloaded solana-version v2.2.7
Downloaded solana-rayon-threadlimit v2.2.7
Downloaded solana-perf v2.2.7
Downloaded solana-streamer v2.2.7
Downloaded solana-udp-client v2.2.7
Downloaded solana-client v2.2.7
Downloaded tracing-core v0.1.33
Downloaded solana-precompile-error v2.2.1
Downloaded solana-vote-interface v2.2.3
Downloaded toml_edit v0.22.26
Downloaded bytemuck_derive v1.9.3
Downloaded miniz_oxide v0.8.8
Downloaded tokio v1.45.0
Downloaded errno v0.3.12
Downloaded solana-compute-budget-program v2.2.7
Downloaded solana-svm-rent-collector v2.2.7
Downloaded solana-svm-transaction v2.2.7
Downloaded spl-token-confidential-transfer-proof-extraction v0.4.0
Downloaded tracing-attributes v0.1.28
Downloaded icu_properties_data v2.0.0
Downloaded solana-transaction-status v2.2.7
Downloaded toml_write v0.1.1
Downloaded agave-transaction-view v2.2.7
Downloaded agave-reserved-account-keys v2.2.7
Downloaded agave-precompiles v2.2.7
Downloaded openssl-src v300.5.0+3.5.0
- cargo check --workspace: ok
nu-ansi-term v0.46.0
Checking indicatif v0.17.11
Checking clap_builder v4.5.38
Checking matchers v0.1.0
Checking solana-account-decoder-client-types v2.2.7
Checking spl-elgamal-registry v0.3.0
Checking async-channel v1.9.0
Compiling utoipauto-macro v0.2.0
Checking async-global-executor v2.4.1
Checking spl-transfer-hook-interface v0.10.0
Checking rust-embed v8.7.2
Checking spl-token-metadata-interface v0.7.0
Compiling clap_derive v4.5.32
Checking agave-reserved-account-keys v2.2.7
Checking spl-token v8.0.0
Checking spl-token-group-interface v0.6.0
Checking spl-token-confidential-transfer-ciphertext-arithmetic v0.3.0
Checking solana-transaction-status-client-types v2.2.7
Checking spl-token-confidential-transfer-proof-generation v0.4.0
Checking tracing-log v0.2.0
Compiling async-attributes v1.1.2
Checking kv-log-macro v1.0.7
Checking sharded-slab v0.1.7
Checking utoipa v5.3.1
Checking uuid v1.16.0
Checking thread_local v1.1.8
Checking tower-http v0.6.4
Checking async-std v1.13.1
Checking strum v0.26.3
Checking spl-token-2022 v9.0.0
Checking tracing-subscriber v0.3.19
Checking solana-rpc-client-api v2.2.7
Checking utoipauto v0.2.0
Checking order-engine-sdk v0.1.0 (/data/workdir/2803415/jup-ag/rfq-webhook-toolkit/order-engine-sdk)
Checking axum-extra v0.10.1
Checking dotenvy v0.15.7
Checking clap v4.5.38
Checking squads-sdk v0.1.0 (/data/workdir/2803415/jup-ag/rfq-webhook-toolkit/squads-sdk)
Checking utoipa-axum v0.2.0
Checking webhook-api v0.1.0 (/data/workdir/2803415/jup-ag/rfq-webhook-toolkit/webhook-api)
Checking solana-rpc-client v2.2.7
Checking order-engine v0.1.0 (/data/workdir/2803415/jup-ag/rfq-webhook-toolkit/programs/order-engine)
Checking server-example v0.1.0 (/data/workdir/2803415/jup-ag/rfq-webhook-toolkit/server-example)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 47.62s
- cargo fmt --check: ok
- cargo clippy --workspace --all-targets -- -D warnings: failed
Checking solana-address-lookup-table-program v2.2.7
Checking solana-zk-token-proof-program v2.2.7
Checking solana-zk-elgamal-proof-program v2.2.7
Checking solana-banks-client v2.2.7
Checking solana-account-decoder v2.2.7
Checking squads-sdk v0.1.0 (/data/workdir/2803415/jup-ag/rfq-webhook-toolkit/squads-sdk)
Checking solana-rpc-client-api v2.2.7
error: used `unwrap_or()` on `Some` value
--> order-engine-sdk/src/fill.rs:517:45
|
517 | taker_input_mint_token_account: taker_input_mint_token_account
| _____________________________________________^
518 | | .unwrap_or(order_engine::ID),
| |____________________________________________^
|
help: remove the `Some` and `unwrap_or()`
--> order-engine-sdk/src/fill.rs:483:46
|
483 | let taker_input_mint_token_account = Some(Pubkey::new_unique());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap
= note: `-D clippy::unnecessary-literal-unwrap` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_literal_unwrap)]`
error: this function has too many arguments (9/7)
--> order-engine-sdk/src/fill.rs:643:5
|
643 | / fn build_fill_ix(
644 | | taker: Pubkey,
645 | | maker: Pubkey,
646 | | input_mint: Pubkey,
... |
652 | | expire_at: i64,
653 | | ) -> Instruction {
| |____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `-D clippy::too-many-arguments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::too_many_arguments)]`
error: could not compile `order-engine-sdk` (lib test) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
yan-wl
approved these changes
May 6, 2026
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.
Summary
Short summary of the change and impact.
Audit Status
If Required
If Not Required (Justification)
Deployment Intent