# "$1" is expanded when argument to eval is constructed by main command parser.
# but "${foo}" is not expanded at this stage, because the "$" has been quoted.
# instead, it's expanded when eval evaluates its argument.
# perfectly safe:
foo='hello; rm -rf /'
dest=bar
eval "$dest=\$foo"
func() {
  body here
  eval "$1=\${foo}"
}
