Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function verifyDestination(server: string, address: string): Promise {
const contract = await TezosNodeReader.getAccountForBlock(server, 'head', address);
if (!!!contract.script) { throw new Error(`No code found at ${address}`); }
const k = Buffer.from(blakejs.blake2s(contract['script'].toString(), null, 16)).toString('hex');
if (k !== '1527ddf08bdf582dce0b28c051044897') { throw new Error(`Contract at ${address} does not match the expected code hash`); }
return true;
}