Port ContractGenerator to new attachments #1014