Skip to content

What this page showsOne instruction (an action a wallet lists) of Drift Protocol v2: whether the code that runs it is the code an audit reviewed, why, and the recorded transactions that called it.

Verdict

Partial

Some evidence exists, but one required link is missing, for example the live source is only claimed by a provider or the report names no files.

Checked against the snapshot at slot 471,652,414

The proof chain
  1. Instruction decoded

    Established

    The instruction bytes match one entry in a pinned IDL or schema, with no collision.

  2. Live code rebuilt by POA

    Not established

    POA rebuilt a source commit and its hash equals the on-chain executable.

  3. Report names the handler file

    Established

    A published audit report's scope covers the file that implements this instruction.

  4. Reviewed commit printed

    Not established

    That report prints the scope and the exact commit it reviewed.

  5. Reviewed code is the live code

    Not established

    The reviewed commit and the rebuilt live commit hold the same program code.

Every link must hold before POA says Matched. A missing link is not a failure, and never an approval.

Reasons

  1. Program snapshot at slot 471652414: executable, RPC agree, hash 8299a9b85540….
  2. Decoded by anchor-sighash-derived f223c68952e1f2b6.
  3. Handler programs/drift/src/instructions/user.rs#L322 (handle_deposit).
  4. Only partly reviewed per drift-neodyme-2024 (Changes made during the audit timeframe (between start commit b828310 and last revision 0ee9e96) were only partially reviewed: a time-boxed review focused on core logic (p.5)), drift-tob-2022 (Admin instructions were only cursorily examined, for the admin signer and its tie to the state account (p.12, Coverage Limitations)); these reports give neither MATCHED nor CHANGED for this instruction.
  5. The report(s) whose printed scope covers the handler file (drift-neodyme-2024) say it was only partly reviewed.
  6. Live source not independently established (POA build state: reproduced_mismatch). A provider or docs claim does not count.

What would be needed for a stronger verdict

  1. A report whose printed scope paths cover the handler file.
  2. A POA reproducible build whose hash equals the current executable hash.

Checks

Decoded
Yes
Handler located
Yes
Handler in report-named files
Yes
Review scope established
No
Reviewed commit known
Yes
Live source rebuilt by POA
No
Live source equals reviewed
Not established
Handler changed since review
Not established
Program crate changed since review
Not established
Program immutable
No
Evidence fresh
Yes

Discriminator and decoding

Discriminator
f223c68952e1f2b6
Method
Derived Anchor sighash
IDL SHA-256
dfd61e9ea1d160321f83f5c7729199ea03c509d63fe8baf35743fd2a87a2dd2a
Collisions
None

Arguments

NameType
marketIndexu16
amountu64
reduceOnlybool

Accounts

Signer and writable flags from the interface definition.

AccountFlagsFixed addressNotes
stateRead-only
userWritable
userStatsWritable
authoritySigner
spotMarketVaultWritable
userTokenAccountWritable
tokenProgramRead-only

Handler source

Handler source at the pinned commitprograms/drift/src/instructions/user.rs#L322-L488Source on GitHub · fee7bfa ↗ (opens in a new tab)
Function
handle_deposit
File
programs/drift/src/instructions/user.rs · lines 322–488
At commit
fee7bfa60f52274969500c37acbbe79bea847ba1
Mapping
Anchor program module

Audit relations

How each report relates to this instruction's handler file.

AuditorRelationReviewed commitScope confidence
NeodymeSecurity Audit: Drift Protocol (opens in a new tab)Handler file is in the named scope0ee9e96Printed in the report
Trail of BitsDrift Protocol Security Assessment (opens in a new tab)Program covered, no paths named57dd5c6Printed in the report

Changed files since review

Files changed between the reviewed commit and the live source, as recorded.

No changed file is recorded for this instruction.

Call trees

The static tree comes from the handler source. The observed tree comes from a finalized transaction. They are separate evidence and are not merged.

Instruction
The instruction itself, with its own verdict.
Static
A source file read at the handler map's pinned commit.
Observed
A call seen in a finalized mainnet transaction.
Inferred
A call read from the handler source, not observed on chain.

Static, from source at fee7bfa

  • Signer
    • InstructionPartial
      • StaticPartial
      • StaticPartial
      • InferredUnknown

Observed in transaction HctYAMSSb1… at slot 304,999,846

  • Signer
    • InstructionUnknown
    • InstructionUnknown
    • InstructionPartial
      • ObservedUnknown

Program upgraded after this transaction: the executable that ran is not established. Deployment slot 429,731,225, transaction slot 304,999,846, snapshot slot 471,652,414.

Open on Solana Explorer (opens in a new tab)

Observed in transaction 3NZEQh8ypB… at slot 304,999,780

  • Signer
    • InstructionUnknown
    • InstructionUnknown
    • InstructionPartial
      • ObservedUnknown

Program upgraded after this transaction: the executable that ran is not established. Deployment slot 429,731,225, transaction slot 304,999,780, snapshot slot 471,652,414.

Open on Solana Explorer (opens in a new tab)

Transactions

Each curated transaction that calls this instruction, with what is known about the code that ran.

  1. 01

    Transaction at slot 304,999,846

    Program upgraded after this transaction: the executable that ran is not established. Deployment slot 429,731,225, transaction slot 304,999,846, snapshot slot 471,652,414.

    Signature
    HctYAMSSb1XXiUtSwhv8Mbd155veY1BLbzYGtrVa4HeLtgoVCbAF1SWfrbzr7tAmMCEJfTLwpcpyg2GE3jKN2rf
    Slot
    304,999,846
    Block time
    2024-12-02 18:40 UTC
    Status
    Succeeded
    Fee
    207,113 lamports
    Compute units
    41,489
    Message version
    0
    RPC response SHA-256
    d14772cf974c91eaf2bed17f8461c53714905341bd178e1d148244805070708b

    Open on Solana Explorer (opens in a new tab)

  2. 02

    Transaction at slot 304,999,780

    Program upgraded after this transaction: the executable that ran is not established. Deployment slot 429,731,225, transaction slot 304,999,780, snapshot slot 471,652,414.

    Signature
    3NZEQh8ypBs1njP6YtUF5vCP7W2W3YRY8SczZL2h8fgmomZKUZwWCR3sgzAJGUJSxXN6KTm2XtUudLW9y7BQWBDr
    Slot
    304,999,780
    Block time
    2024-12-02 18:39 UTC
    Status
    Succeeded
    Fee
    60,736 lamports
    Compute units
    62,032
    Message version
    0
    RPC response SHA-256
    4a10f2686ae78637d3bcfab96a87a19e3d7a1eeec6b18a0da0b2f872fed0c949

    Open on Solana Explorer (opens in a new tab)