import { generateErc1167 } from '@tevm/voltaire/Proxy';
import { Address } from '@tevm/voltaire/Address';
import { keccak256 } from '@tevm/voltaire/crypto';
// Generate bytecode
const implementation = Address.from('0x1234...');
const bytecode = generateErc1167(implementation);
// Calculate deterministic address
const factory = Address.from('0xabcd...');
const salt = keccak256(new TextEncoder().encode('my-salt'));
const cloneAddress = Address.calculateCreate2Address(
factory,
salt,
bytecode
);
console.log('Clone will be deployed at:', cloneAddress.toHex());
// Deploy with CREATE2
await deployCreate2(factory, salt, bytecode);