fn verify(signer: H256, addr: H256, amount: U256, sig: Vec<u8>) -> bool {
        let mut msg = addr.to_vec();
        msg.extend_from_slice(&amount.as_u64().to_be_bytes());

        let mut new_sig: [u8; 65] = [0u8; 65];
        new_sig.copy_from_slice(&sig[..65]);

        let accepted_pubkey = KeyPair::recover(&msg, new_sig).unwrap();
        *signer == *accepted_pubkey.keccak256()
    }
/// verify if the address that is sending the tokens is the one who actually sent the transfer.
verify if the address that is sending the tokens is the one who actually sent the transfer.
verify if the address that is sending the tokens is the one who actually sent the transfer .
fn verify(signer: H256, addr: H256, amount: U256, sig: Vec<u8>) -> bool {
        let mut msg = addr.to_vec();
        msg.extend_from_slice(&amount.as_u64().to_be_bytes());
        let mut new_sig: [u8; 65] = [0u8; 65];
        new_sig.copy_from_slice(&sig[..65]);
        let accepted_pubkey = KeyPair::recover(&msg, new_sig).unwrap();
        *signer == *accepted_pubkey.keccak256()
    }
fn verify ( signer : H256 , addr : H256 , amount : U256 , sig : Vec < u8 > ) -> bool { let mut msg = addr . to_vec ( ) ; msg . extend_from_slice ( & amount . as_u64 ( ) . to_be_bytes ( ) ) ; let mut new_sig : [ u8 ; 65 ] = [ 0u8 ; 65 ] ; new_sig . copy_from_slice ( & sig [ .. 65 ] ) ; let accepted_pubkey = KeyPair :: recover ( & msg , new_sig ) . unwrap ( ) ; * signer == * accepted_pubkey . keccak256 ( ) }
verify if the address that is sending the tokens is the one who actually sent the transfer.
verify if the address that is sending the tokens is the one who actually sent the transfer .
signer
H256
addr
H256
amount
U256
sig
Vec<u8>
signer
H256
addr
H256
amount
U256
sig
Vec<u8>