Created
August 10, 2025 14:11
-
-
Save target-san/4aae9f437a0d74af771447a68987cec5 to your computer and use it in GitHub Desktop.
Try parse "sign message" result as ERC-6492 payload
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
//! Compatible with `cargo eval` | |
//! ```cargo | |
//! [dependencies] | |
//! alloy-primitives = { version = "1.3.0", features=["k256"] } | |
//! alloy-sol-types = "1.3.0" | |
//! anyhow = "1.0.98" | |
//! ``` | |
use alloy_primitives::{Address, Bytes, Signature}; | |
use alloy_sol_types::SolValue as _; | |
const ADDRESS: &str = "0x181cD97461ACf9e863fE5cCf8f432E0Fbba678bC"; | |
const CHALLENGE: &str = "Hello Reown AppKit!"; | |
const SIGNATURE: &str = concat!( | |
"0x", | |
"0000000000000000000000004e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67", | |
"0000000000000000000000000000000000000000000000000000000000000060", | |
"00000000000000000000000000000000000000000000000000000000000003c0", | |
"0000000000000000000000000000000000000000000000000000000000000324", | |
"1688f0b900000000000000000000000041675c099f32341bf84bfc5382af534d", | |
"f5c7461a00000000000000000000000000000000000000000000000000000000", | |
"00000060000000000000000000000000000000000000000000007a6733696a79", | |
"3000000000000000000000000000000000000000000000000000000000000000", | |
"00000284b63e800d000000000000000000000000000000000000000000000000", | |
"0000000000000100000000000000000000000000000000000000000000000000", | |
"000000000000000100000000000000000000000038869bf66a61cf6bdb996a6a", | |
"e40d5853fd43b526000000000000000000000000000000000000000000000000", | |
"0000000000000140000000000000000000000000a581c4a4db7175302464ff3c", | |
"06380bc3270b4037000000000000000000000000000000000000000000000000", | |
"0000000000000000000000000000000000000000000000000000000000000000", | |
"0000000000000000000000000000000000000000000000000000000000000000", | |
"0000000000000000000000000000000000000000000000000000000000000000", | |
"0000000000000001000000000000000000000000f3100e7a820ffa74a1b00fbe", | |
"cabb0d8a7c6db41e000000000000000000000000000000000000000000000000", | |
"00000000000001048d80ff0a0000000000000000000000000000000000000000", | |
"0000000000000000000000200000000000000000000000000000000000000000", | |
"0000000000000000000000b9018ecd4ec46d4d2a6b64fe960b3d64e8b94b2234", | |
"eb00000000000000000000000000000000000000000000000000000000000000", | |
"0000000000000000000000000000000000000000000000000000000000000000", | |
"648d0dc49f000000000000000000000000000000000000000000000000000000", | |
"0000000020000000000000000000000000000000000000000000000000000000", | |
"0000000001000000000000000000000000a581c4a4db7175302464ff3c06380b", | |
"c3270b4037000000000000000000000000000000000000000000000000000000", | |
"0000000000000000000000000000000000000000000000000000000000000000", | |
"0000000000000000000000000000000000000000000000000000000000000000", | |
"0000000000000000000000000000000000000000000000000000000000000041", | |
"475d96f8e71b808d5097743020f9e163fdeef769608fb5640c202d8a82f34b6d", | |
"05c1676631b16751e9144028a76e2d4ce46908ff7c812daac946ea7fd5fa9d19", | |
"2000000000000000000000000000000000000000000000000000000000000000", | |
"6492649264926492649264926492649264926492649264926492649264926492" | |
); | |
fn main() { | |
let sig_bytes: Bytes = SIGNATURE.parse().unwrap(); | |
let (address, calldata, signature) = | |
<(Address, Bytes, Bytes)>::abi_decode_params(&sig_bytes[..]).unwrap(); | |
println!("Address: {address}"); | |
println!("Calldata: {calldata}"); | |
let signature = Signature::from_raw(&signature[..]).unwrap(); | |
println!("Signature: {signature}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment