raydium-io / raydium-amm

Constant product AMM integrated with the OpenBook CLOB
Apache License 2.0
92 stars 85 forks source link

bug: change of arguments #12

Closed benjiqq closed 4 months ago

benjiqq commented 5 months ago

this line and other places where number of arguments are dynamic causes bugs, solscan has it wrong to. https://github.com/raydium-io/raydium-amm/blob/master/program/src/processor.rs#L1585

workaround example checking number of arguments

let mut index = SERUM_MARKET_INDEX as usize;
    if ray_accs.len() == 17 {
        index -= 1;
    } 
RainRaydium commented 5 months ago

this line and other places where number of arguments are dynamic causes bugs, solscan has it wrong to. https://github.com/raydium-io/raydium-amm/blob/master/program/src/processor.rs#L1585

workaround example checking number of arguments

let mut index = SERUM_MARKET_INDEX as usize;
    if ray_accs.len() == 17 {
        index -= 1;
    } 

There is nothing wrong with here, because the variable input_account_len is assigned at the beginning of the function.

RainRaydium commented 4 months ago

No problem, close.