Convert `drainRoot` to Cadence.

See #375.