Yeah, if it were easy codify an objectively correct non-contradictory and universally applicable moral framework, we would have done so in the last eight or so thousand years since we started caring about such things. There are reasons human law is incredibly complex and purposely vague.
Isaac Asimov made a career out of pointing out the hubris of it. Three simple laws, what can go wrong?