Retrieving and listening to contract events