use alloy::{hex, sol, sol_types::SolCall};
sol! {
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
}
fn main() {
// a perfect valid slot0 returns got by
// cast call 0xb744Abf10B85fd77D46a8B22f71Fc1E059A2e002 "slot0()"
let bs = hex!("000000000000000000000000000000000000007c08ceadc9f453ebfb5551158400000000000000000000000000000000000000000000000000000000000178a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000c800c800000000000000000000000000000000000000000000000000000000000000001");
// panic
let _ = slot0Call::abi_decode_returns(&bs, true).unwrap();
}
Panic with:
thread 'main' panicked at src/main.rs:25:54:
called `Result::unwrap()` on an `Err` value: TypeCheckFail { expected_type: "(uint160,int24,uint16,uint16,uint16,uint8,bool)", data: "000000000000000000000000000000000000007c08ceadc9f453ebfb5551158400000000000000000000000000000000000000000000000000000000000178a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000c800c800000000000000000000000000000000000000000000000000000000000000001" }
Component
dyn-abi
What version of Alloy are you on?
0.2.0
Operating System
Linux
Describe the bug
Component
contract
What version of Alloy are you on?
0.2.0
Operating System
Linux
Describe the bug
Minimum repro:
Panic with:
I can't see why it has type mismatching.