fix accounts len check
This commit is contained in:
8
pump.go
8
pump.go
@@ -173,9 +173,17 @@ func CreateParser(tx *Tx, instr Instruction, innerInstructions InnerInstructions
|
||||
}
|
||||
userIndex := 0
|
||||
if bytes.HasPrefix(instr.Data, pumpCreateV2Discriminator[:]) {
|
||||
if len(instr.Accounts) < 6 {
|
||||
return nil, increaseOffset(offset), InstructionIgnoredError
|
||||
}
|
||||
userIndex = instr.Accounts[5]
|
||||
} else if bytes.HasPrefix(instr.Data, pumpCreateDiscriminator[:]) {
|
||||
if len(instr.Accounts) < 8 {
|
||||
return nil, increaseOffset(offset), InstructionIgnoredError
|
||||
}
|
||||
userIndex = instr.Accounts[7]
|
||||
} else {
|
||||
return nil, increaseOffset(offset), InstructionIgnoredError
|
||||
}
|
||||
userBase := getAccountBalanceAfterTx(result, userIndex)
|
||||
userQuote, _ := GetSolAfterTx(result, userIndex)
|
||||
|
||||
Reference in New Issue
Block a user