(mod (CURRENT_METADATA METADATA_UPDATER_PUZZLE_HASH solution)

  ; solution is (new_url new_metadata_updater_puzhash)

  ; METADATA and METADATA_UPDATER_PUZZLE_HASH are passed in as truths from the layer above
  ; This program returns ((new_metadata new_metadata_updater_puzhash) conditions)

  ; NOTE THIS PROGRAM IS FOR TESTING ONLY - USE IN DEPLOYMENT AT YOUR OWN PERIL

  ; once we find 'u' we don't need to continue looping
  (defun add_url (METADATA new_url)
    (if METADATA
      (if (= (f (f METADATA)) 'u')
        (c (c 'u' (c new_url (r (f METADATA)))) (r METADATA))
        (c (f METADATA) (add_url (r METADATA) new_url))
      )
      ()
    )
  )

  (defun-inline assert_bytes32 (value)
    (= (strlen value) 32)
  )

  ; main
  ; returns ((new_metadata new_metadata_updater_puzhash) conditions)
  (list (list (if (f solution) (add_url CURRENT_METADATA (f solution)) CURRENT_METADATA) (if (assert_bytes32 (f (r solution))) (f (r solution)) METADATA_UPDATER_PUZZLE_HASH)) 0)
)
