Convert `writeEntry` to Cadence.

See #375.