Convert `operate` to Cadence.

See #375.