               (assoc-state-for username state))}
      (when (and name (= :valid state))
        (let [{:keys [multiaccount]}        db
-             {:keys [address public-key]}     multiaccount
+             {:keys [public-key]}     multiaccount
+             address (ethereum/default-address db)
              registry (get ens/ens-registries (ethereum/chain-keyword db))]
          {:ens/resolve-address [registry name #(on-resolve registry custom-domain? username address public-key %)]})))))
 

    (re-frame/dispatch [:ens/set-state username :unregistrable])))

(fx/defn register-name
  [{:keys [db] :as cofx} contract custom-domain? username address public-key]
  (let [{:keys [x y]} (ethereum/coordinates public-key)]
    (signing/eth-transaction-call
     cofx

  [{:keys [db]} username]
  {:db (assoc-state-for db username :registration-failed)})

(fx/defn store-name-detail
  {:events [:ens/store-name-detail]}
  [{:keys [db]} name k v]
