Add method to contract.