update contract state