         (testing "on-offering event should fire"
           (is (not (nil? offering))))
 
-        (let [balance-of-1 (web3-eth/get-balance @web3 addr1)
+        (let [;; starting account balances
+              balance-of-1 (web3-eth/get-balance @web3 addr1)
               balance-of-2 (web3-eth/get-balance @web3 addr2)
-              balance-of-3 (web3-eth/get-balance @web3 addr3)]
-          (testing "Transferrnig ownership to the offer"
-            (is (registrar/transfer! {:ens.record/label "abc" :ens.record/owner offering}
-                                     {:from addr1})))
+              balance-of-3 (web3-eth/get-balance @web3 addr3)
+              
+              ;; bid values
+              bid-value-user-2 (web3/to-wei 0.1 :ether)
+              bid-value-user-3 (web3/to-wei 0.2 :ether)
+              bid-value-user-3-overbid (web3/to-wei 0.3 :ether)
+
+              ;; A temporary transaction log store
+              transaction-log (atom {})
+              log-tx! (fn [id result] (swap! transaction-log assoc id result) result)]
+
+          (testing "Transferring ownership to the offer"
+            (is (log-tx! :t1-register
+                         (registrar/transfer! {:ens.record/label "abc" :ens.record/owner offering}
+                                              {:from addr1}))))
 
           (testing "User 2 can place a proper bid"
-            (is (auction-offering/bid! {:offering/address offering}
-                                       {:value (web3/to-wei 0.1 :ether)
-                                        :from addr2})))
+            (is (log-tx! :t2-user2-place-bid
+                         (auction-offering/bid! {:offering/address offering}
+                                                {:value bid-value-user-2
+                                                 :from addr2}))))
+
+          (testing "Ensure User 2 has made the appropriate bid transaction with gas costs."
+            (let [bid-tx (:t2-user2-place-bid @transaction-log)
+                  tx-total-cost (get-transaction-cost bid-tx)
+                  expected-balance (bn/- balance-of-2 tx-total-cost)
+                  expected-balance (bn/- expected-balance bid-value-user-2)
+                  actual-balance (web3-eth/get-balance @web3 addr2)]
+              (is (bn/zero? (bn/- expected-balance actual-balance)))))
 
           (testing "User 3 can place a proper bid too"
-            (is (auction-offering/bid! {:offering/address offering}
-                                       {:value (web3/to-wei 0.2 :ether)
-                                        :from addr3})))
+            (is (log-tx! :t3-user3-place-bid
+                         (auction-offering/bid! {:offering/address offering}
+                                                {:value bid-value-user-3
+                                                 :from addr3}))))
 
           (testing "User 2, who was overbid, should have his funds back from auction offering."
-            (is (< (- balance-of-2 (web3-eth/get-balance @web3 addr2))
-                   spent-gas-threshold)))
+            (let [;; The user will have his funds back, but he would still have paid a gas price
+                  bid-tx (:t2-user2-place-bid @transaction-log)
+                  tx-total-cost (get-transaction-cost bid-tx)
+                  expected-balance (bn/- balance-of-2 tx-total-cost)
+                  actual-balance (web3-eth/get-balance @web3 addr2)]
+              (is (bn/zero? (bn/- expected-balance actual-balance)))))
 
           (testing "User 3 funds are spent on the bid"
-            (is (< (- balance-of-3
-                      (bn/+ (web3-eth/get-balance @web3 addr3) (web3/to-wei 0.2 :ether)))
-                   spent-gas-threshold)))
+            (let [bid-tx (:t3-user3-place-bid @transaction-log)
+                  tx-total-cost (get-transaction-cost bid-tx)
+                  expected-balance (bn/- balance-of-3 tx-total-cost)
+                  expected-balance (bn/- expected-balance bid-value-user-3)
+                  actual-balance (web3-eth/get-balance @web3 addr3)]
+              (is (bn/zero? (bn/- expected-balance actual-balance)))))
 
           (testing "User 3 can overbid in order to afk himself"
-            (is (auction-offering/bid! {:offering/address offering}
-                                       {:value (web3/to-wei 0.3 :ether)
-                                        :from addr3})))
+            (is (log-tx! :t4-user3-place-overbid
+                         (auction-offering/bid! {:offering/address offering}
+                                                {:value bid-value-user-3-overbid
+                                                 :from addr3}))))
 
           (testing "User 3 who overbid himself, gets back only his own previous bids."
-            (is (< (- balance-of-3
-                      (bn/+ (web3-eth/get-balance @web3 addr3) (web3/to-wei 0.3 :ether)))
-                   spent-gas-threshold)))
+            (let [bid-tx-3 (:t3-user3-place-bid @transaction-log)
+                  bid-tx-4 (:t4-user3-place-overbid @transaction-log)
+                  tx-total-cost (bn/+ (get-transaction-cost bid-tx-3)
+                                      (get-transaction-cost bid-tx-4))
+                  expected-balance (bn/- balance-of-3 tx-total-cost)
+                  expected-balance (bn/- expected-balance bid-value-user-3-overbid)
+                  actual-balance (web3-eth/get-balance @web3 addr3)]
+              (is (bn/zero? (bn/- expected-balance actual-balance)))))
 
           (web3-evm/increase-time! @web3 [(time/in-seconds (time/days 15))])
 

                               {:from addr0})))
    (testing "Offering the name with overdue endtime fails"
      (is (thrown? :default (auction-offering-factory/create-offering!
                              {:offering/name "abc.eth"
                               :offering/price (eth->wei 0.1)
                               :auction-offering/end-time (to-epoch (time/minus (now) (time/seconds 1)))
                               :auction-offering/extension-duration 0
                               :auction-offering/min-bid-increase (web3/to-wei 0.1 :ether)}
                              {:from addr0}))))
    (testing "Offering the name with 0 bidincrease fails"
      (is (thrown? :default (auction-offering-factory/create-offering!
                              {:offering/name "abc.eth"
                               :offering/price (eth->wei 0.1)
                               :auction-offering/end-time (to-epoch (time/plus (now) (time/weeks 1)))
                               :auction-offering/extension-duration 0
                               :auction-offering/min-bid-increase (web3/to-wei 0 :ether)}
                              {:from addr0}))))
    (let [tx-hash (auction-offering-factory/create-offering!
                    {:offering/name "abc.eth"
                     :offering/price (eth->wei 0.1)
                     :auction-offering/end-time (to-epoch (time/plus (now) (time/weeks 2)))
                     :auction-offering/extension-duration 0
                     :auction-offering/min-bid-increase (web3/to-wei 0.1 :ether)}
                    {:from addr0})]
      (testing "Offering the name for a bid"
        (is tx-hash))

      (let [{{:keys [:offering]} :args}
            (offering-registry/on-offering-added-in-tx tx-hash {:node (namehash "abc.eth")
                                                                :from-block 0
                                                                :owner addr0})]
        (testing "on-offering event should fire"
          (is (not (nil? offering))))
        (when offering

           {:web3 {:port 8549}
            :smart-contracts {:contracts-var #'name-bazaar.shared.smart-contracts/smart-contracts
                              :auto-mining? true}})
         (mount/only [#'district.server.web3
                      #'district.server.smart-contracts/smart-contracts
                      #'name-bazaar.server.deployer/deployer])
         (mount/start)))
   :after
   (fn []
     (mount/stop)
