Account

0x0000000000000000000000006ADAfDa1ce97B8b6DD838ac67e32e3C16f0ed5500x0000...d550

Solana Connector
This connector supports SVM compatible EOA accounts such as Phantom and Backpack.

Source Code
predicate;

use std::{
    crypto:: {
        signature::Signature,
        ed25519::Ed25519,
        message::Message,
        public_key::PublicKey,
    },
    b512::B512,
    hash::{
        Hash,
        sha256,
    },
    ecr::{
        EcRecoverError,
        ed_verify,
    },
    tx::{
        tx_id,
        tx_witness_data,
    },
    bytes::Bytes,
};

const ASCII_MAP: [u8; 16] = [
    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102
];

pub fn b256_to_ascii_bytes(val: b256) -> Bytes {
    let bytes = Bytes::from(val);
    let mut ascii_bytes = Bytes::with_capacity(64);
    let mut idx = 0;

    while idx < 32 {
        let b = bytes.get(idx).unwrap();
        ascii_bytes.push(ASCII_MAP[(b >> 4).as_u64()]);
        ascii_bytes.push(ASCII_MAP[(b & 15).as_u64()]);
	    idx = idx + 1;
    }

    ascii_bytes
}

configurable {
    SIGNER: b256 = b256::zero(),
}

fn main(witness_index: u64) -> bool {
    let witness_signature: B512 = tx_witness_data(witness_index).unwrap();
    let encoded = b256_to_ascii_bytes(tx_id());

    let signature = Signature::Ed25519(Ed25519::from(witness_signature));
    let pub_key = PublicKey::from(SIGNER);
    let message = Message::from(encoded);

    let result = signature.verify(pub_key, message);

    if result.is_ok() {
        return true;
    }

    // Otherwise, an invalid signature has been passed and we invalidate the Tx.
    false
}
Bytecode
0x1a403000504100301a445000ba49000032400481504100205d490000504100083240048220451300524510044a4400003ac5c446f2f99d83d0e2dc773bb77c619783f1389c4d0198bba9b48680b8017700000000000000406c649713094804a8f703a20a826235f4ff7881a5dfc351fb798b47a7684de97830313233343536373839616263646566cccccccccccc00020000000000000330