constant "DeployContract" {
	EcFixedPointBase NULLIFIER_K,
}

contract "DeployContract" {
	# Amount of bytes to store on-chain
	Base bytes,
	# Deploy key used for signing and contract reference
	Base deploy_key,
}

circuit "DeployContract" {
	# Derive a public key used for the signature and constrain
	# its coordinates:
	signature_public = ec_mul_base(deploy_key, NULLIFIER_K);
	signature_x = ec_get_x(signature_public);
	signature_y = ec_get_y(signature_public);
	constrain_instance(signature_x);
	constrain_instance(signature_y);

	# Derive the contract address from the public key's coordinates
	address = poseidon_hash(signature_x, signature_y);
	constrain_instance(address);

	# Constrain the byte size of the deployed binaries
	constrain_instance(bytes);

	# TODO: Fee cost for storing this data on-chain
}
