Scoping of variables

I don’t know about best, but right now if you want to pass a parameter to a [function that returns a] Script, you have two options:

  1. Your [function that returns a] Script is invoked in Daml code: it behaves just like any other function, you can pass Daml values to it normally.
  2. You want your [function that returns a] Script to be an entry point for daml script commands. In that case, it has to take exactly one argument, and that argument can be provided through --input-file using its JSON representation (complete example here).