;; mini-nodes
;; contractType: public

(impl-trait 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait)

(define-non-fungible-token mini-nodes uint)

;; Constants
(define-constant DEPLOYER tx-sender)
(define-constant COMM u1000)
(define-constant COMM-ADDR 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S)

(define-constant ERR-NO-MORE-NFTS u100)
(define-constant ERR-NOT-ENOUGH-PASSES u101)
(define-constant ERR-PUBLIC-SALE-DISABLED u102)
(define-constant ERR-CONTRACT-INITIALIZED u103)
(define-constant ERR-NOT-AUTHORIZED u104)
(define-constant ERR-INVALID-USER u105)
(define-constant ERR-LISTING u106)
(define-constant ERR-WRONG-COMMISSION u107)
(define-constant ERR-NOT-FOUND u108)
(define-constant ERR-PAUSED u109)
(define-constant ERR-MINT-LIMIT u110)
(define-constant ERR-METADATA-FROZEN u111)
(define-constant ERR-AIRDROP-CALLED u112)
(define-constant ERR-NO-MORE-MINTS u113)
(define-constant ERR-INVALID-PERCENTAGE u114)

;; Internal variables
(define-data-var mint-limit uint u744)
(define-data-var last-id uint u1)
(define-data-var total-price uint u2000000)
(define-data-var artist-address principal 'SP34V64PNDN1535R0DP60EBSXASJHKJ5NH8JPHBQH)
(define-data-var ipfs-root (string-ascii 80) "ipfs://ipfs/QmSewwJGJX4r6x8sXB91kgHKtyyL94QtsGQQm6A8T9P99N/json/")
(define-data-var mint-paused bool false)
(define-data-var premint-enabled bool false)
(define-data-var sale-enabled bool false)
(define-data-var metadata-frozen bool false)
(define-data-var airdrop-called bool false)
(define-data-var mint-cap uint u25)

(define-map mints-per-user principal uint)
(define-map mint-passes principal uint)

(define-public (claim) 
  (mint (list true)))

(define-public (claim-three) (mint (list true true true)))

(define-public (claim-five) (mint (list true true true true true)))

(define-public (claim-ten) (mint (list true true true true true true true true true true)))

(define-public (claim-twentyfive) (mint (list true true true true true true true true true true true true true true true true true true true true true true true true true)))

;; Default Minting
(define-private (mint (orders (list 25 bool)))
  (mint-many orders))

(define-private (mint-many (orders (list 25 bool )))  
  (let 
    (
      (last-nft-id (var-get last-id))
      (enabled (asserts! (<= last-nft-id (var-get mint-limit)) (err ERR-NO-MORE-NFTS)))
      (art-addr (var-get artist-address))
      (id-reached (fold mint-many-iter orders last-nft-id))
      (price (* (var-get total-price) (- id-reached last-nft-id)))
      (total-commission (/ (* price COMM) u10000))
      (current-balance (get-balance tx-sender))
      (total-artist (- price total-commission))
      (capped (> (var-get mint-cap) u0))
      (user-mints (get-mints tx-sender))
    )
    (asserts! (or (is-eq false (var-get mint-paused)) (is-eq tx-sender DEPLOYER)) (err ERR-PAUSED))
    (asserts! (or (not capped) (is-eq tx-sender DEPLOYER) (is-eq tx-sender art-addr) (>= (var-get mint-cap) (+ (len orders) user-mints))) (err ERR-NO-MORE-MINTS))
    (map-set mints-per-user tx-sender (+ (len orders) user-mints))
    (if (or (is-eq tx-sender art-addr) (is-eq tx-sender DEPLOYER) (is-eq (var-get total-price) u0000000))
      (begin
        (var-set last-id id-reached)
        (map-set token-count tx-sender (+ current-balance (- id-reached last-nft-id)))
      )
      (begin
        (var-set last-id id-reached)
        (map-set token-count tx-sender (+ current-balance (- id-reached last-nft-id)))
        (try! (stx-transfer? total-artist tx-sender (var-get artist-address)))
        (try! (stx-transfer? total-commission tx-sender COMM-ADDR))
      )    
    )
    (ok id-reached)))

(define-private (mint-many-iter (ignore bool) (next-id uint))
  (if (<= next-id (var-get mint-limit))
    (begin
      (unwrap! (nft-mint? mini-nodes next-id tx-sender) next-id)
      (+ next-id u1)    
    )
    next-id))

(define-public (set-artist-address (address principal))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (ok (var-set artist-address address))))

(define-public (set-price (price uint))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (ok (var-set total-price price))))

(define-public (toggle-pause)
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (ok (var-set mint-paused (not (var-get mint-paused))))))

(define-public (set-mint-limit (limit uint))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (asserts! (< limit (var-get mint-limit)) (err ERR-MINT-LIMIT))
    (ok (var-set mint-limit limit))))

(define-public (burn (token-id uint))
  (begin 
    (asserts! (is-owner token-id tx-sender) (err ERR-NOT-AUTHORIZED))
    (asserts! (is-none (map-get? market token-id)) (err ERR-LISTING))
    (nft-burn? mini-nodes token-id tx-sender)))

(define-private (is-owner (token-id uint) (user principal))
    (is-eq user (unwrap! (nft-get-owner? mini-nodes token-id) false)))

(define-public (set-base-uri (new-base-uri (string-ascii 80)))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (asserts! (not (var-get metadata-frozen)) (err ERR-METADATA-FROZEN))
    (print { notification: "token-metadata-update", payload: { token-class: "nft", contract-id: (as-contract tx-sender) }})
    (var-set ipfs-root new-base-uri)
    (ok true)))

(define-public (freeze-metadata)
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (var-set metadata-frozen true)
    (ok true)))

;; Non-custodial SIP-009 transfer function
(define-public (transfer (id uint) (sender principal) (recipient principal))
  (begin
    (asserts! (is-eq tx-sender sender) (err ERR-NOT-AUTHORIZED))
    (asserts! (is-none (map-get? market id)) (err ERR-LISTING))
    (trnsfr id sender recipient)))

;; read-only functions
(define-read-only (get-owner (token-id uint))
  (ok (nft-get-owner? mini-nodes token-id)))

(define-read-only (get-last-token-id)
  (ok (- (var-get last-id) u1)))

(define-read-only (get-token-uri (token-id uint))
  (ok (some (concat (concat (var-get ipfs-root) "{id}") ".json"))))

(define-read-only (get-paused)
  (ok (var-get mint-paused)))

(define-read-only (get-price)
  (ok (var-get total-price)))

(define-read-only (get-artist-address)
  (ok (var-get artist-address)))

(define-read-only (get-mints (caller principal))
  (default-to u0 (map-get? mints-per-user caller)))

(define-read-only (get-mint-limit)
  (ok (var-get mint-limit)))

(define-data-var license-uri (string-ascii 80) "https://arweave.net/zmc1WTspIhFyVY82bwfAIcIExLFH5lUcHHUN0wXg4W8/2")
(define-data-var license-name (string-ascii 40) "COMMERCIAL")

(define-read-only (get-license-uri)
  (ok (var-get license-uri)))
  
(define-read-only (get-license-name)
  (ok (var-get license-name)))
  
(define-public (set-license-uri (uri (string-ascii 80)))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (ok (var-set license-uri uri))))
    
(define-public (set-license-name (name (string-ascii 40)))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (ok (var-set license-name name))))

;; Non-custodial marketplace extras
(use-trait commission-trait 'SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335.commission-trait.commission)

(define-map token-count principal uint)
(define-map market uint {price: uint, commission: principal, royalty: uint})

(define-read-only (get-balance (account principal))
  (default-to u0
    (map-get? token-count account)))

(define-private (trnsfr (id uint) (sender principal) (recipient principal))
  (match (nft-transfer? mini-nodes id sender recipient)
    success
      (let
        ((sender-balance (get-balance sender))
        (recipient-balance (get-balance recipient)))
          (map-set token-count
            sender
            (- sender-balance u1))
          (map-set token-count
            recipient
            (+ recipient-balance u1))
          (ok success))
    error (err error)))

(define-private (is-sender-owner (id uint))
  (let ((owner (unwrap! (nft-get-owner? mini-nodes id) false)))
    (or (is-eq tx-sender owner) (is-eq contract-caller owner))))

(define-read-only (get-listing-in-ustx (id uint))
  (map-get? market id))

(define-public (list-in-ustx (id uint) (price uint) (comm-trait <commission-trait>))
  (let ((listing  {price: price, commission: (contract-of comm-trait), royalty: (var-get royalty-percent)}))
    (asserts! (is-sender-owner id) (err ERR-NOT-AUTHORIZED))
    (map-set market id listing)
    (print (merge listing {a: "list-in-ustx", id: id}))
    (ok true)))

(define-public (unlist-in-ustx (id uint))
  (begin
    (asserts! (is-sender-owner id) (err ERR-NOT-AUTHORIZED))
    (map-delete market id)
    (print {a: "unlist-in-ustx", id: id})
    (ok true)))

(define-public (buy-in-ustx (id uint) (comm-trait <commission-trait>))
  (let ((owner (unwrap! (nft-get-owner? mini-nodes id) (err ERR-NOT-FOUND)))
      (listing (unwrap! (map-get? market id) (err ERR-LISTING)))
      (price (get price listing))
      (royalty (get royalty listing)))
    (asserts! (is-eq (contract-of comm-trait) (get commission listing)) (err ERR-WRONG-COMMISSION))
    (try! (stx-transfer? price tx-sender owner))
    (try! (pay-royalty price royalty))
    (try! (contract-call? comm-trait pay id price))
    (try! (trnsfr id owner tx-sender))
    (map-delete market id)
    (print {a: "buy-in-ustx", id: id})
    (ok true)))
    
(define-data-var royalty-percent uint u500)

(define-read-only (get-royalty-percent)
  (ok (var-get royalty-percent)))

(define-public (set-royalty-percent (royalty uint))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (asserts! (and (>= royalty u0) (<= royalty u1000)) (err ERR-INVALID-PERCENTAGE))
    (ok (var-set royalty-percent royalty))))

(define-private (pay-royalty (price uint) (royalty uint))
  (let (
    (royalty-amount (/ (* price royalty) u10000))
  )
  (if (and (> royalty-amount u0) (not (is-eq tx-sender (var-get artist-address))))
    (try! (stx-transfer? royalty-amount tx-sender (var-get artist-address)))
    (print false)
  )
  (ok true)))
  

;; Airdrop
(define-public (admin-airdrop)
  (let
    (
      (last-nft-id (var-get last-id))
    )
    (begin
      (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
      (asserts! (is-eq false (var-get airdrop-called)) (err ERR-AIRDROP-CALLED))
      (try! (nft-mint? mini-nodes (+ last-nft-id u0) 'SP1012WHN0TRB47B1Q3JGF7VYGMC2Q6DW46WAKPE3))
      (map-set token-count 'SP1012WHN0TRB47B1Q3JGF7VYGMC2Q6DW46WAKPE3 (+ (get-balance 'SP1012WHN0TRB47B1Q3JGF7VYGMC2Q6DW46WAKPE3) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u1) 'SP12BEEDG31J0AH68DFDJJYZ36D002PKDZCP1DZQE))
      (map-set token-count 'SP12BEEDG31J0AH68DFDJJYZ36D002PKDZCP1DZQE (+ (get-balance 'SP12BEEDG31J0AH68DFDJJYZ36D002PKDZCP1DZQE) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u2) 'SP14W78Q821B3HQ3ED30624Z1F13X4JMFZY3N5SK4))
      (map-set token-count 'SP14W78Q821B3HQ3ED30624Z1F13X4JMFZY3N5SK4 (+ (get-balance 'SP14W78Q821B3HQ3ED30624Z1F13X4JMFZY3N5SK4) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u3) 'SP162D87CY84QVVCMJKNKGHC7GGXFGA0TAR9D0XJW))
      (map-set token-count 'SP162D87CY84QVVCMJKNKGHC7GGXFGA0TAR9D0XJW (+ (get-balance 'SP162D87CY84QVVCMJKNKGHC7GGXFGA0TAR9D0XJW) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u4) 'SP16KX6P2NH67K3HXZPDXN4WY1C7RFYND6ZS41R6W))
      (map-set token-count 'SP16KX6P2NH67K3HXZPDXN4WY1C7RFYND6ZS41R6W (+ (get-balance 'SP16KX6P2NH67K3HXZPDXN4WY1C7RFYND6ZS41R6W) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u5) 'SP18WRH4SF7F1M5QZZ2BQDZZYBCJWT9VWQMDSTFY5))
      (map-set token-count 'SP18WRH4SF7F1M5QZZ2BQDZZYBCJWT9VWQMDSTFY5 (+ (get-balance 'SP18WRH4SF7F1M5QZZ2BQDZZYBCJWT9VWQMDSTFY5) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u6) 'SP19HG5FVG53E03XXGBNDC2KX5KCD1RHHM398RZ8T))
      (map-set token-count 'SP19HG5FVG53E03XXGBNDC2KX5KCD1RHHM398RZ8T (+ (get-balance 'SP19HG5FVG53E03XXGBNDC2KX5KCD1RHHM398RZ8T) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u7) 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H))
      (map-set token-count 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H (+ (get-balance 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u8) 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H))
      (map-set token-count 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H (+ (get-balance 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u9) 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H))
      (map-set token-count 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H (+ (get-balance 'SP19WKA4H1ZVCWRCY82SPGJHJ3GXD02D60YQT7Y7H) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u10) 'SP1A7GR8CANQJQRMNHYV1HXV50089EHJTA9N1SGG1))
      (map-set token-count 'SP1A7GR8CANQJQRMNHYV1HXV50089EHJTA9N1SGG1 (+ (get-balance 'SP1A7GR8CANQJQRMNHYV1HXV50089EHJTA9N1SGG1) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u11) 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY))
      (map-set token-count 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY (+ (get-balance 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u12) 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY))
      (map-set token-count 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY (+ (get-balance 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u13) 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY))
      (map-set token-count 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY (+ (get-balance 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u14) 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY))
      (map-set token-count 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY (+ (get-balance 'SP1B576BH3WB6PN0TMX115JGBJC4X0YRT0X688CCY) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u15) 'SP1CE3NQXDKCJ2KEFFGCVFA5C196S9F0RRX93HY87))
      (map-set token-count 'SP1CE3NQXDKCJ2KEFFGCVFA5C196S9F0RRX93HY87 (+ (get-balance 'SP1CE3NQXDKCJ2KEFFGCVFA5C196S9F0RRX93HY87) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u16) 'SP1DPNP3RRD6JG1557SP6JMX68W5BV6R2Z74BQEXV))
      (map-set token-count 'SP1DPNP3RRD6JG1557SP6JMX68W5BV6R2Z74BQEXV (+ (get-balance 'SP1DPNP3RRD6JG1557SP6JMX68W5BV6R2Z74BQEXV) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u17) 'SP1DPNP3RRD6JG1557SP6JMX68W5BV6R2Z74BQEXV))
      (map-set token-count 'SP1DPNP3RRD6JG1557SP6JMX68W5BV6R2Z74BQEXV (+ (get-balance 'SP1DPNP3RRD6JG1557SP6JMX68W5BV6R2Z74BQEXV) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u18) 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF))
      (map-set token-count 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF (+ (get-balance 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u19) 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF))
      (map-set token-count 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF (+ (get-balance 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u20) 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF))
      (map-set token-count 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF (+ (get-balance 'SP1F0QN7Z7N2DJEAB2THK0KBX7GY675QEMFWMWKXF) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u21) 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2))
      (map-set token-count 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2 (+ (get-balance 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u22) 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2))
      (map-set token-count 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2 (+ (get-balance 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u23) 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2))
      (map-set token-count 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2 (+ (get-balance 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u24) 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2))
      (map-set token-count 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2 (+ (get-balance 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u25) 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2))
      (map-set token-count 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2 (+ (get-balance 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u26) 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2))
      (map-set token-count 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2 (+ (get-balance 'SP1FVRY1HAP2CAY6B0CX6ZS9C8C6TGXKWQWBTTNX2) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u27) 'SP1JF9VSNJBP4YZVC7AJ9CE6CXBD2ZV0W67T0E4T0))
      (map-set token-count 'SP1JF9VSNJBP4YZVC7AJ9CE6CXBD2ZV0W67T0E4T0 (+ (get-balance 'SP1JF9VSNJBP4YZVC7AJ9CE6CXBD2ZV0W67T0E4T0) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u28) 'SP1JM5Y9J4T7J5XY9NX34SG1Z1BNAJT4H4NBHTPYD))
      (map-set token-count 'SP1JM5Y9J4T7J5XY9NX34SG1Z1BNAJT4H4NBHTPYD (+ (get-balance 'SP1JM5Y9J4T7J5XY9NX34SG1Z1BNAJT4H4NBHTPYD) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u29) 'SP1NBDQSZ5YQ9KGEZZQ8FNDMT26RDZ4JG5GR4T1BV))
      (map-set token-count 'SP1NBDQSZ5YQ9KGEZZQ8FNDMT26RDZ4JG5GR4T1BV (+ (get-balance 'SP1NBDQSZ5YQ9KGEZZQ8FNDMT26RDZ4JG5GR4T1BV) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u30) 'SP1P0E50XPE15MZ8HG0YBES99TW1RNCC1GSWTBSCD))
      (map-set token-count 'SP1P0E50XPE15MZ8HG0YBES99TW1RNCC1GSWTBSCD (+ (get-balance 'SP1P0E50XPE15MZ8HG0YBES99TW1RNCC1GSWTBSCD) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u31) 'SP1PY9RPSMS0STZKX6JM91NRPMRCKN428BSRJJEXV))
      (map-set token-count 'SP1PY9RPSMS0STZKX6JM91NRPMRCKN428BSRJJEXV (+ (get-balance 'SP1PY9RPSMS0STZKX6JM91NRPMRCKN428BSRJJEXV) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u32) 'SP1QZT85MFT8HBAG3XEK7K6QY4GGP3MSG5C3H9PQ1))
      (map-set token-count 'SP1QZT85MFT8HBAG3XEK7K6QY4GGP3MSG5C3H9PQ1 (+ (get-balance 'SP1QZT85MFT8HBAG3XEK7K6QY4GGP3MSG5C3H9PQ1) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u33) 'SP1S68REQ0F879TQ1ASSVS6QK81FYF23B27RAH7ZH))
      (map-set token-count 'SP1S68REQ0F879TQ1ASSVS6QK81FYF23B27RAH7ZH (+ (get-balance 'SP1S68REQ0F879TQ1ASSVS6QK81FYF23B27RAH7ZH) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u34) 'SP1VRYN3NA31GQY42AAGTAR5Q0VX2XMR1ZV8JBQF6))
      (map-set token-count 'SP1VRYN3NA31GQY42AAGTAR5Q0VX2XMR1ZV8JBQF6 (+ (get-balance 'SP1VRYN3NA31GQY42AAGTAR5Q0VX2XMR1ZV8JBQF6) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u35) 'SP1VRYN3NA31GQY42AAGTAR5Q0VX2XMR1ZV8JBQF6))
      (map-set token-count 'SP1VRYN3NA31GQY42AAGTAR5Q0VX2XMR1ZV8JBQF6 (+ (get-balance 'SP1VRYN3NA31GQY42AAGTAR5Q0VX2XMR1ZV8JBQF6) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u36) 'SP1X19CZ26M439AFEYGZG42KTZAJVP3H8KW6HZ94K))
      (map-set token-count 'SP1X19CZ26M439AFEYGZG42KTZAJVP3H8KW6HZ94K (+ (get-balance 'SP1X19CZ26M439AFEYGZG42KTZAJVP3H8KW6HZ94K) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u37) 'SP1XY24C7AJ8XZ2QQ5BMD43YWJBYAM388G00P354V))
      (map-set token-count 'SP1XY24C7AJ8XZ2QQ5BMD43YWJBYAM388G00P354V (+ (get-balance 'SP1XY24C7AJ8XZ2QQ5BMD43YWJBYAM388G00P354V) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u38) 'SP1ZCYG0D3HCK2F7SY8VH9ZREB0JWCBSAPFNS8V5Z))
      (map-set token-count 'SP1ZCYG0D3HCK2F7SY8VH9ZREB0JWCBSAPFNS8V5Z (+ (get-balance 'SP1ZCYG0D3HCK2F7SY8VH9ZREB0JWCBSAPFNS8V5Z) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u39) 'SP201DF0HP6KRJPABA6TR4NE8XBQZ7H1DHD8WRP0C))
      (map-set token-count 'SP201DF0HP6KRJPABA6TR4NE8XBQZ7H1DHD8WRP0C (+ (get-balance 'SP201DF0HP6KRJPABA6TR4NE8XBQZ7H1DHD8WRP0C) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u40) 'SP23B41ZYGNSJ22JCWJJ4P39KQC5RW10E1R4Q8PJW))
      (map-set token-count 'SP23B41ZYGNSJ22JCWJJ4P39KQC5RW10E1R4Q8PJW (+ (get-balance 'SP23B41ZYGNSJ22JCWJJ4P39KQC5RW10E1R4Q8PJW) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u41) 'SP24ZBZ8ZE6F48JE9G3F3HRTG9FK7E2H6K2QZ3Q1K))
      (map-set token-count 'SP24ZBZ8ZE6F48JE9G3F3HRTG9FK7E2H6K2QZ3Q1K (+ (get-balance 'SP24ZBZ8ZE6F48JE9G3F3HRTG9FK7E2H6K2QZ3Q1K) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u42) 'SP25HAV8ZKNE8B7QCT1FPKPD8JQF2KK06VKQE6JSE))
      (map-set token-count 'SP25HAV8ZKNE8B7QCT1FPKPD8JQF2KK06VKQE6JSE (+ (get-balance 'SP25HAV8ZKNE8B7QCT1FPKPD8JQF2KK06VKQE6JSE) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u43) 'SP267TMY9MTMP98AW05X8RFQ43JRMTPGDWFKFCPTH))
      (map-set token-count 'SP267TMY9MTMP98AW05X8RFQ43JRMTPGDWFKFCPTH (+ (get-balance 'SP267TMY9MTMP98AW05X8RFQ43JRMTPGDWFKFCPTH) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u44) 'SP26GZCVY8FYHNZ6C73W68TCFJHS8F8C9E772XX7X))
      (map-set token-count 'SP26GZCVY8FYHNZ6C73W68TCFJHS8F8C9E772XX7X (+ (get-balance 'SP26GZCVY8FYHNZ6C73W68TCFJHS8F8C9E772XX7X) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u45) 'SP2791RKSYJJ39MVHC09J8NARWBMK5G9C79EJB0RV))
      (map-set token-count 'SP2791RKSYJJ39MVHC09J8NARWBMK5G9C79EJB0RV (+ (get-balance 'SP2791RKSYJJ39MVHC09J8NARWBMK5G9C79EJB0RV) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u46) 'SP27ANV45PCAG98PGFA2GVN9K7QYY1KWWS1V6RFSX))
      (map-set token-count 'SP27ANV45PCAG98PGFA2GVN9K7QYY1KWWS1V6RFSX (+ (get-balance 'SP27ANV45PCAG98PGFA2GVN9K7QYY1KWWS1V6RFSX) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u47) 'SP27FV479JFQBPVAKJ6BN8HMBWQ657KFVYTG05236))
      (map-set token-count 'SP27FV479JFQBPVAKJ6BN8HMBWQ657KFVYTG05236 (+ (get-balance 'SP27FV479JFQBPVAKJ6BN8HMBWQ657KFVYTG05236) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u48) 'SP27JJS3774KPR0MMB5FH77VWBD8KD0SVNZ4QNX5X))
      (map-set token-count 'SP27JJS3774KPR0MMB5FH77VWBD8KD0SVNZ4QNX5X (+ (get-balance 'SP27JJS3774KPR0MMB5FH77VWBD8KD0SVNZ4QNX5X) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u49) 'SP28KP3Z8B2DYRB71AWVT8ZHTBN5WVWZPAXHKTV2W))
      (map-set token-count 'SP28KP3Z8B2DYRB71AWVT8ZHTBN5WVWZPAXHKTV2W (+ (get-balance 'SP28KP3Z8B2DYRB71AWVT8ZHTBN5WVWZPAXHKTV2W) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u50) 'SP28NCDY6V4T7NJBMYGTJ55NHMXMC0GG806JW1ZTB))
      (map-set token-count 'SP28NCDY6V4T7NJBMYGTJ55NHMXMC0GG806JW1ZTB (+ (get-balance 'SP28NCDY6V4T7NJBMYGTJ55NHMXMC0GG806JW1ZTB) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u51) 'SP28RZ1QXMXJXVKRRCR3D7GR5D48XY0NNA9MZWHJB))
      (map-set token-count 'SP28RZ1QXMXJXVKRRCR3D7GR5D48XY0NNA9MZWHJB (+ (get-balance 'SP28RZ1QXMXJXVKRRCR3D7GR5D48XY0NNA9MZWHJB) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u52) 'SP28T44V5QKEKY5HK826M4Y35HC5AMP6F8VN3V9HY))
      (map-set token-count 'SP28T44V5QKEKY5HK826M4Y35HC5AMP6F8VN3V9HY (+ (get-balance 'SP28T44V5QKEKY5HK826M4Y35HC5AMP6F8VN3V9HY) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u53) 'SP28T44V5QKEKY5HK826M4Y35HC5AMP6F8VN3V9HY))
      (map-set token-count 'SP28T44V5QKEKY5HK826M4Y35HC5AMP6F8VN3V9HY (+ (get-balance 'SP28T44V5QKEKY5HK826M4Y35HC5AMP6F8VN3V9HY) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u54) 'SP2BB1ZVZ21V90CR9B1FYE5E6ADMKQS7K3JABHNNQ))
      (map-set token-count 'SP2BB1ZVZ21V90CR9B1FYE5E6ADMKQS7K3JABHNNQ (+ (get-balance 'SP2BB1ZVZ21V90CR9B1FYE5E6ADMKQS7K3JABHNNQ) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u55) 'SP2CXXSX6D1VXBAN6PPXZ2PGHFPJ5A0900EMA61MR))
      (map-set token-count 'SP2CXXSX6D1VXBAN6PPXZ2PGHFPJ5A0900EMA61MR (+ (get-balance 'SP2CXXSX6D1VXBAN6PPXZ2PGHFPJ5A0900EMA61MR) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u56) 'SP2CZMH9A6FH5QPAJAR8ZG091Z15JKAGY1X0F3EJ0))
      (map-set token-count 'SP2CZMH9A6FH5QPAJAR8ZG091Z15JKAGY1X0F3EJ0 (+ (get-balance 'SP2CZMH9A6FH5QPAJAR8ZG091Z15JKAGY1X0F3EJ0) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u57) 'SP2DABEA5Q3NXYKR8TTXFVDFTX666Y5HX13GPS3ZR))
      (map-set token-count 'SP2DABEA5Q3NXYKR8TTXFVDFTX666Y5HX13GPS3ZR (+ (get-balance 'SP2DABEA5Q3NXYKR8TTXFVDFTX666Y5HX13GPS3ZR) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u58) 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS))
      (map-set token-count 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS (+ (get-balance 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u59) 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS))
      (map-set token-count 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS (+ (get-balance 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u60) 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS))
      (map-set token-count 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS (+ (get-balance 'SP2DFX28F1S3CB46B5XH9M5JQ7N4SMCE7CQY1TNYS) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u61) 'SP2FFG62G6GTKW1M2CEFWW5HC17WV4026QK6RGA2Z))
      (map-set token-count 'SP2FFG62G6GTKW1M2CEFWW5HC17WV4026QK6RGA2Z (+ (get-balance 'SP2FFG62G6GTKW1M2CEFWW5HC17WV4026QK6RGA2Z) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u62) 'SP2GM3SM283BKBQTAZREDJ30JT6NNX4W2TJFA58YF))
      (map-set token-count 'SP2GM3SM283BKBQTAZREDJ30JT6NNX4W2TJFA58YF (+ (get-balance 'SP2GM3SM283BKBQTAZREDJ30JT6NNX4W2TJFA58YF) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u63) 'SP2GW58XTW54T7GFY1PMDQRWQTM3PRRV5YGTKW7NV))
      (map-set token-count 'SP2GW58XTW54T7GFY1PMDQRWQTM3PRRV5YGTKW7NV (+ (get-balance 'SP2GW58XTW54T7GFY1PMDQRWQTM3PRRV5YGTKW7NV) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u64) 'SP2HJA54TZ1JRSBC9SFNP3B5N31H54WZXE975N6N9))
      (map-set token-count 'SP2HJA54TZ1JRSBC9SFNP3B5N31H54WZXE975N6N9 (+ (get-balance 'SP2HJA54TZ1JRSBC9SFNP3B5N31H54WZXE975N6N9) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u65) 'SP2HJVJQS0TRBTQ1WAWWN9H9W2HKGDZ7H5EZCEAQC))
      (map-set token-count 'SP2HJVJQS0TRBTQ1WAWWN9H9W2HKGDZ7H5EZCEAQC (+ (get-balance 'SP2HJVJQS0TRBTQ1WAWWN9H9W2HKGDZ7H5EZCEAQC) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u66) 'SP2N65XG5NHHZQB50X119YMZ018AP0FCSXDJPNE05))
      (map-set token-count 'SP2N65XG5NHHZQB50X119YMZ018AP0FCSXDJPNE05 (+ (get-balance 'SP2N65XG5NHHZQB50X119YMZ018AP0FCSXDJPNE05) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u67) 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX))
      (map-set token-count 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX (+ (get-balance 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u68) 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX))
      (map-set token-count 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX (+ (get-balance 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u69) 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX))
      (map-set token-count 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX (+ (get-balance 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u70) 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX))
      (map-set token-count 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX (+ (get-balance 'SP2NHZDAMMEEASE4DKHYYCVAG8RF8PA7YHPPW40BX) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u71) 'SP2RDZXTJNZRNCV9SECA5JPAQ2T4C8S8520QSQ20))
      (map-set token-count 'SP2RDZXTJNZRNCV9SECA5JPAQ2T4C8S8520QSQ20 (+ (get-balance 'SP2RDZXTJNZRNCV9SECA5JPAQ2T4C8S8520QSQ20) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u72) 'SP2SJAKR3SAA2S46WMNSPQBB0K2VMV6SYYDJC0JWB))
      (map-set token-count 'SP2SJAKR3SAA2S46WMNSPQBB0K2VMV6SYYDJC0JWB (+ (get-balance 'SP2SJAKR3SAA2S46WMNSPQBB0K2VMV6SYYDJC0JWB) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u73) 'SP2SPK0V82BJ3MBR1B5JR9GFS7K5ETJ64YZET2MJ3))
      (map-set token-count 'SP2SPK0V82BJ3MBR1B5JR9GFS7K5ETJ64YZET2MJ3 (+ (get-balance 'SP2SPK0V82BJ3MBR1B5JR9GFS7K5ETJ64YZET2MJ3) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u74) 'SP2TW1D8YF5CE0NDP5VCR5NMTPHQ4PQR1KBB4NQ5Q))
      (map-set token-count 'SP2TW1D8YF5CE0NDP5VCR5NMTPHQ4PQR1KBB4NQ5Q (+ (get-balance 'SP2TW1D8YF5CE0NDP5VCR5NMTPHQ4PQR1KBB4NQ5Q) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u75) 'SP2W6J5GGRKS7TTA8FCDFK0XNQSJTG4NNEDCSJ0S0))
      (map-set token-count 'SP2W6J5GGRKS7TTA8FCDFK0XNQSJTG4NNEDCSJ0S0 (+ (get-balance 'SP2W6J5GGRKS7TTA8FCDFK0XNQSJTG4NNEDCSJ0S0) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u76) 'SP2WZ1SP3GF5E65ZD778HQDERP08S6VSAEP14BP04))
      (map-set token-count 'SP2WZ1SP3GF5E65ZD778HQDERP08S6VSAEP14BP04 (+ (get-balance 'SP2WZ1SP3GF5E65ZD778HQDERP08S6VSAEP14BP04) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u77) 'SP2ZKEYFP4TS99FVNMA7A6BDY9T6QK91BNPBTJFPT))
      (map-set token-count 'SP2ZKEYFP4TS99FVNMA7A6BDY9T6QK91BNPBTJFPT (+ (get-balance 'SP2ZKEYFP4TS99FVNMA7A6BDY9T6QK91BNPBTJFPT) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u78) 'SP31AQS0KHPJ5QN1ND4JCC5N8ARQSWED3JKH0H5KK))
      (map-set token-count 'SP31AQS0KHPJ5QN1ND4JCC5N8ARQSWED3JKH0H5KK (+ (get-balance 'SP31AQS0KHPJ5QN1ND4JCC5N8ARQSWED3JKH0H5KK) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u79) 'SP31AQS0KHPJ5QN1ND4JCC5N8ARQSWED3JKH0H5KK))
      (map-set token-count 'SP31AQS0KHPJ5QN1ND4JCC5N8ARQSWED3JKH0H5KK (+ (get-balance 'SP31AQS0KHPJ5QN1ND4JCC5N8ARQSWED3JKH0H5KK) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u80) 'SP31WTJ415SNJM9H6202S3WK9AFQXQZMT48PESBQE))
      (map-set token-count 'SP31WTJ415SNJM9H6202S3WK9AFQXQZMT48PESBQE (+ (get-balance 'SP31WTJ415SNJM9H6202S3WK9AFQXQZMT48PESBQE) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u81) 'SP3273YEPG4QZWX0ENQ98FBT1N2Y06XW820STP7NN))
      (map-set token-count 'SP3273YEPG4QZWX0ENQ98FBT1N2Y06XW820STP7NN (+ (get-balance 'SP3273YEPG4QZWX0ENQ98FBT1N2Y06XW820STP7NN) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u82) 'SP35MER4PHM6XGB99YDRQAK0M0JQ8F9CVF04VZ1VX))
      (map-set token-count 'SP35MER4PHM6XGB99YDRQAK0M0JQ8F9CVF04VZ1VX (+ (get-balance 'SP35MER4PHM6XGB99YDRQAK0M0JQ8F9CVF04VZ1VX) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u83) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u84) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u85) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u86) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u87) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u88) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u89) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u90) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u91) 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82))
      (map-set token-count 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82 (+ (get-balance 'SP37FPAYBQ03NRTST46BZC47BJ221M6KSF23SZX82) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u92) 'SP3AJC728JY0Y43E8RT6K4VDWPT265RDMXJ8M0VH0))
      (map-set token-count 'SP3AJC728JY0Y43E8RT6K4VDWPT265RDMXJ8M0VH0 (+ (get-balance 'SP3AJC728JY0Y43E8RT6K4VDWPT265RDMXJ8M0VH0) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u93) 'SP3CF4JWY44MWYFCC6BMV6K9NTEVCQ9CGE9EF1WZT))
      (map-set token-count 'SP3CF4JWY44MWYFCC6BMV6K9NTEVCQ9CGE9EF1WZT (+ (get-balance 'SP3CF4JWY44MWYFCC6BMV6K9NTEVCQ9CGE9EF1WZT) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u94) 'SP3CF4JWY44MWYFCC6BMV6K9NTEVCQ9CGE9EF1WZT))
      (map-set token-count 'SP3CF4JWY44MWYFCC6BMV6K9NTEVCQ9CGE9EF1WZT (+ (get-balance 'SP3CF4JWY44MWYFCC6BMV6K9NTEVCQ9CGE9EF1WZT) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u95) 'SP3DCV25CKJAGQ0KG7EATN43RV9CPQ3WM8X36VYY7))
      (map-set token-count 'SP3DCV25CKJAGQ0KG7EATN43RV9CPQ3WM8X36VYY7 (+ (get-balance 'SP3DCV25CKJAGQ0KG7EATN43RV9CPQ3WM8X36VYY7) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u96) 'SP3EWSRH657Z45VZKJAMG7CQ195C96E7GE0BG8TBD))
      (map-set token-count 'SP3EWSRH657Z45VZKJAMG7CQ195C96E7GE0BG8TBD (+ (get-balance 'SP3EWSRH657Z45VZKJAMG7CQ195C96E7GE0BG8TBD) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u97) 'SP3GGYKH2G14DB7P7XAKKRBRW9KRW3HY7K169K31J))
      (map-set token-count 'SP3GGYKH2G14DB7P7XAKKRBRW9KRW3HY7K169K31J (+ (get-balance 'SP3GGYKH2G14DB7P7XAKKRBRW9KRW3HY7K169K31J) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u98) 'SP3HYXVFXRRNWR22B2P8PWXH7C2RBP3BBC631F5XY))
      (map-set token-count 'SP3HYXVFXRRNWR22B2P8PWXH7C2RBP3BBC631F5XY (+ (get-balance 'SP3HYXVFXRRNWR22B2P8PWXH7C2RBP3BBC631F5XY) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u99) 'SP3JHVDACF5MCKCGJTHMGHXT03YDKAGD7WH5H04C5))
      (map-set token-count 'SP3JHVDACF5MCKCGJTHMGHXT03YDKAGD7WH5H04C5 (+ (get-balance 'SP3JHVDACF5MCKCGJTHMGHXT03YDKAGD7WH5H04C5) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u100) 'SP3JN7BM02SF49A6VBZ2VDT1V6BBAF0GKDPVT01E))
      (map-set token-count 'SP3JN7BM02SF49A6VBZ2VDT1V6BBAF0GKDPVT01E (+ (get-balance 'SP3JN7BM02SF49A6VBZ2VDT1V6BBAF0GKDPVT01E) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u101) 'SP3MNFJ5G8754WER9R5F3XXTRY0YZJN47R0QMF4Q5))
      (map-set token-count 'SP3MNFJ5G8754WER9R5F3XXTRY0YZJN47R0QMF4Q5 (+ (get-balance 'SP3MNFJ5G8754WER9R5F3XXTRY0YZJN47R0QMF4Q5) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u102) 'SP3P8PMKMYJQ9V16A6EZW2XHH1P29JN58R31VQ4VJ))
      (map-set token-count 'SP3P8PMKMYJQ9V16A6EZW2XHH1P29JN58R31VQ4VJ (+ (get-balance 'SP3P8PMKMYJQ9V16A6EZW2XHH1P29JN58R31VQ4VJ) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u103) 'SP3R8BWPZGQC89RWVKR1HAG5ZJSZ8Z6ZTNYEAX5V9))
      (map-set token-count 'SP3R8BWPZGQC89RWVKR1HAG5ZJSZ8Z6ZTNYEAX5V9 (+ (get-balance 'SP3R8BWPZGQC89RWVKR1HAG5ZJSZ8Z6ZTNYEAX5V9) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u104) 'SP3RJJ9E0F0SRKYEKKRSZZ0FNYSPX0W7TKMNSWMJ9))
      (map-set token-count 'SP3RJJ9E0F0SRKYEKKRSZZ0FNYSPX0W7TKMNSWMJ9 (+ (get-balance 'SP3RJJ9E0F0SRKYEKKRSZZ0FNYSPX0W7TKMNSWMJ9) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u105) 'SP3SW3X4C7AJPQKQ1V5YCHWPYV4NHABRH3V51KWHQ))
      (map-set token-count 'SP3SW3X4C7AJPQKQ1V5YCHWPYV4NHABRH3V51KWHQ (+ (get-balance 'SP3SW3X4C7AJPQKQ1V5YCHWPYV4NHABRH3V51KWHQ) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u106) 'SP3SZQWEWSR404Z7XHF1VCFCTTVD0EA8YFVSMDM29))
      (map-set token-count 'SP3SZQWEWSR404Z7XHF1VCFCTTVD0EA8YFVSMDM29 (+ (get-balance 'SP3SZQWEWSR404Z7XHF1VCFCTTVD0EA8YFVSMDM29) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u107) 'SP3TZ3BCB16A0W0PPFYMGTTWTT3DVWTQEP8DFRAG1))
      (map-set token-count 'SP3TZ3BCB16A0W0PPFYMGTTWTT3DVWTQEP8DFRAG1 (+ (get-balance 'SP3TZ3BCB16A0W0PPFYMGTTWTT3DVWTQEP8DFRAG1) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u108) 'SP3WBYAEWN0JER1VPBW8TRT1329BGP9RGC5S2519W))
      (map-set token-count 'SP3WBYAEWN0JER1VPBW8TRT1329BGP9RGC5S2519W (+ (get-balance 'SP3WBYAEWN0JER1VPBW8TRT1329BGP9RGC5S2519W) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u109) 'SP5G3VY7MZT8BNB6FHXZE9JD4PPF8WRT3H6JSBWW))
      (map-set token-count 'SP5G3VY7MZT8BNB6FHXZE9JD4PPF8WRT3H6JSBWW (+ (get-balance 'SP5G3VY7MZT8BNB6FHXZE9JD4PPF8WRT3H6JSBWW) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u110) 'SP79X94Z3PYJZHT8Y5PF34NDP8C76JAQYEZZ1ZS6))
      (map-set token-count 'SP79X94Z3PYJZHT8Y5PF34NDP8C76JAQYEZZ1ZS6 (+ (get-balance 'SP79X94Z3PYJZHT8Y5PF34NDP8C76JAQYEZZ1ZS6) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u111) 'SP7STVARCTQVQ96S5A86T922HPFQWVN6PTJWP6KT))
      (map-set token-count 'SP7STVARCTQVQ96S5A86T922HPFQWVN6PTJWP6KT (+ (get-balance 'SP7STVARCTQVQ96S5A86T922HPFQWVN6PTJWP6KT) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u112) 'SPB82MPT9419SR83A2FYHXJ4W8DDDQEY0AE2WDFT))
      (map-set token-count 'SPB82MPT9419SR83A2FYHXJ4W8DDDQEY0AE2WDFT (+ (get-balance 'SPB82MPT9419SR83A2FYHXJ4W8DDDQEY0AE2WDFT) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u113) 'SPB82MPT9419SR83A2FYHXJ4W8DDDQEY0AE2WDFT))
      (map-set token-count 'SPB82MPT9419SR83A2FYHXJ4W8DDDQEY0AE2WDFT (+ (get-balance 'SPB82MPT9419SR83A2FYHXJ4W8DDDQEY0AE2WDFT) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u114) 'SPDPBBYXWV7H4NJV8A2NP1WW0VW9V8TFRBVG8C3H))
      (map-set token-count 'SPDPBBYXWV7H4NJV8A2NP1WW0VW9V8TFRBVG8C3H (+ (get-balance 'SPDPBBYXWV7H4NJV8A2NP1WW0VW9V8TFRBVG8C3H) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u115) 'SPDPBBYXWV7H4NJV8A2NP1WW0VW9V8TFRBVG8C3H))
      (map-set token-count 'SPDPBBYXWV7H4NJV8A2NP1WW0VW9V8TFRBVG8C3H (+ (get-balance 'SPDPBBYXWV7H4NJV8A2NP1WW0VW9V8TFRBVG8C3H) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u116) 'SPE0XEK7HS9JWSDK2MT03K3P08PMC7YJB0R737KF))
      (map-set token-count 'SPE0XEK7HS9JWSDK2MT03K3P08PMC7YJB0R737KF (+ (get-balance 'SPE0XEK7HS9JWSDK2MT03K3P08PMC7YJB0R737KF) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u117) 'SPFD0Z2W50QMWRQ27ERW7KNGNHK6Q74EPD4C4TNQ))
      (map-set token-count 'SPFD0Z2W50QMWRQ27ERW7KNGNHK6Q74EPD4C4TNQ (+ (get-balance 'SPFD0Z2W50QMWRQ27ERW7KNGNHK6Q74EPD4C4TNQ) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u118) 'SPGRTZX64QM5YW6WWEPSB8WQRGJ32HK57CMS7J75))
      (map-set token-count 'SPGRTZX64QM5YW6WWEPSB8WQRGJ32HK57CMS7J75 (+ (get-balance 'SPGRTZX64QM5YW6WWEPSB8WQRGJ32HK57CMS7J75) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u119) 'SPHK8A7P61C6ASWKYDX1PCDX9YA54DKVJN49EXGJ))
      (map-set token-count 'SPHK8A7P61C6ASWKYDX1PCDX9YA54DKVJN49EXGJ (+ (get-balance 'SPHK8A7P61C6ASWKYDX1PCDX9YA54DKVJN49EXGJ) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u120) 'SPHK8A7P61C6ASWKYDX1PCDX9YA54DKVJN49EXGJ))
      (map-set token-count 'SPHK8A7P61C6ASWKYDX1PCDX9YA54DKVJN49EXGJ (+ (get-balance 'SPHK8A7P61C6ASWKYDX1PCDX9YA54DKVJN49EXGJ) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u121) 'SPHWCHVHRY2Q4884XNNSV8B3J1T41PBN0GQE16A9))
      (map-set token-count 'SPHWCHVHRY2Q4884XNNSV8B3J1T41PBN0GQE16A9 (+ (get-balance 'SPHWCHVHRY2Q4884XNNSV8B3J1T41PBN0GQE16A9) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u122) 'SPHZM2R9EJ483AW3GTEK6RVY1C7W9F8VBKKDZ1QB))
      (map-set token-count 'SPHZM2R9EJ483AW3GTEK6RVY1C7W9F8VBKKDZ1QB (+ (get-balance 'SPHZM2R9EJ483AW3GTEK6RVY1C7W9F8VBKKDZ1QB) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u123) 'SPKYH33Q3E3Y925S6EJYEE5D6MQDCJF5ZBXS3QAG))
      (map-set token-count 'SPKYH33Q3E3Y925S6EJYEE5D6MQDCJF5ZBXS3QAG (+ (get-balance 'SPKYH33Q3E3Y925S6EJYEE5D6MQDCJF5ZBXS3QAG) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u124) 'SPP1CFQC9T1Q1MNVTGE4BTG9EG6P411ATXTWBT2X))
      (map-set token-count 'SPP1CFQC9T1Q1MNVTGE4BTG9EG6P411ATXTWBT2X (+ (get-balance 'SPP1CFQC9T1Q1MNVTGE4BTG9EG6P411ATXTWBT2X) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u125) 'SPPMGZTRGMBVCFW3RMEVQJEF26MW9G6EKT51EMD8))
      (map-set token-count 'SPPMGZTRGMBVCFW3RMEVQJEF26MW9G6EKT51EMD8 (+ (get-balance 'SPPMGZTRGMBVCFW3RMEVQJEF26MW9G6EKT51EMD8) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u126) 'SPPP2A2SHFNMEVFGY04KG2R1Z8XJRAH09VXH3C91))
      (map-set token-count 'SPPP2A2SHFNMEVFGY04KG2R1Z8XJRAH09VXH3C91 (+ (get-balance 'SPPP2A2SHFNMEVFGY04KG2R1Z8XJRAH09VXH3C91) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u127) 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D))
      (map-set token-count 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D (+ (get-balance 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u128) 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D))
      (map-set token-count 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D (+ (get-balance 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u129) 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D))
      (map-set token-count 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D (+ (get-balance 'SPQE3J7XMMK0DN0BWJZHGE6B05VDYQRXRMDV734D) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u130) 'SPT7KN0PTQNZNZC6MCXV2C0WVCXTEKJ68JZRQ89Z))
      (map-set token-count 'SPT7KN0PTQNZNZC6MCXV2C0WVCXTEKJ68JZRQ89Z (+ (get-balance 'SPT7KN0PTQNZNZC6MCXV2C0WVCXTEKJ68JZRQ89Z) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u131) 'SPTDZTWN5P7H2JFKFZGF4EDG73823JNQXB19SJSS))
      (map-set token-count 'SPTDZTWN5P7H2JFKFZGF4EDG73823JNQXB19SJSS (+ (get-balance 'SPTDZTWN5P7H2JFKFZGF4EDG73823JNQXB19SJSS) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u132) 'SPXFNPGBR4F4JJ3ZDEVC47BF54AE12NKFDM6TV1C))
      (map-set token-count 'SPXFNPGBR4F4JJ3ZDEVC47BF54AE12NKFDM6TV1C (+ (get-balance 'SPXFNPGBR4F4JJ3ZDEVC47BF54AE12NKFDM6TV1C) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u133) 'SPXRRH54YTJ39YRY5MYR5CGJEG2SZ83JYJ2HQYHV))
      (map-set token-count 'SPXRRH54YTJ39YRY5MYR5CGJEG2SZ83JYJ2HQYHV (+ (get-balance 'SPXRRH54YTJ39YRY5MYR5CGJEG2SZ83JYJ2HQYHV) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u134) 'SPY6HFEWRG719Q3Y147N0CBM1XHK0PKQG112JETV))
      (map-set token-count 'SPY6HFEWRG719Q3Y147N0CBM1XHK0PKQG112JETV (+ (get-balance 'SPY6HFEWRG719Q3Y147N0CBM1XHK0PKQG112JETV) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u135) 'SPYCKVJK4BNMGBKE2HDZCC8AFP80EVSB5FNBMD6S))
      (map-set token-count 'SPYCKVJK4BNMGBKE2HDZCC8AFP80EVSB5FNBMD6S (+ (get-balance 'SPYCKVJK4BNMGBKE2HDZCC8AFP80EVSB5FNBMD6S) u1))
      (try! (nft-mint? mini-nodes (+ last-nft-id u136) 'SPYD2E5MYVXE5V84BX8V202E5DD4R3D2X0V6D4XP))
      (map-set token-count 'SPYD2E5MYVXE5V84BX8V202E5DD4R3D2X0V6D4XP (+ (get-balance 'SPYD2E5MYVXE5V84BX8V202E5DD4R3D2X0V6D4XP) u1))

      (var-set last-id (+ last-nft-id u137))
      (var-set airdrop-called true)
      (ok true))))