| 1006 | } |
| 1007 | |
| 1008 | fn classify_authenticator(auth: &[u8]) -> &'static str { |
| 1009 | let Some(selector) = auth.get(..20).map(Address::from_slice) else { |
| 1010 | return "other"; |
| 1011 | }; |
| 1012 | if selector == Eip8130Constants::K1_AUTHENTICATOR { |
| 1013 | "k1" |
| 1014 | } else if selector == Eip8130Contracts::P256_AUTHENTICATOR { |
| 1015 | "p256" |
| 1016 | } else if selector == Eip8130Contracts::WEBAUTHN_AUTHENTICATOR { |
| 1017 | "passkey" |
| 1018 | } else if selector == Eip8130Contracts::DELEGATE_AUTHENTICATOR { |
| 1019 | match auth.get(40..60).map(Address::from_slice) { |
| 1020 | Some(nested) if nested == Eip8130Constants::K1_AUTHENTICATOR => "delegate-k1", |
| 1021 | Some(nested) if nested == Eip8130Contracts::P256_AUTHENTICATOR => "delegate-p256", |
| 1022 | Some(nested) if nested == Eip8130Contracts::WEBAUTHN_AUTHENTICATOR => { |
| 1023 | "delegate-passkey" |
| 1024 | } |
| 1025 | _ => "delegate", |
| 1026 | } |
| 1027 | } else { |
| 1028 | "other" |
| 1029 | } |
| 1030 | } |
| 1031 | |
| 1032 | /// Runs full EIP-8130 admission checks that require account/precompile state: |
| 1033 | /// actor authorization, nonce/replay state, intrinsic gas, create-entry safety, |