cloud code for contract creation