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

(define-constant agent-1 'SP12VXAS7H2MT7R8116F4RA1FCS21DZ86B4DTN80J)
(define-constant agent-2 'SP1JF9VSNJBP4YZVC7AJ9CE6CXBD2ZV0W67T0E4T0)
(define-constant agent-3 'SP1JQCYDVHKE8RWBJ9JSX8ZH6TVTX0TH2F7D3A8YJ)
(define-constant agent-4 'SP1N41GX5EVPR9SD7JM8T1165YP5G279JE9V9XFH0)
(define-constant agent-5 'SP1XJ6GNTDVF6HR1VHPQDMFZJY87D9W6TGMH3QCP)
(define-constant agent-6 'SP247RS63PWW7ZQZ9EYYA9CXKKPWEP71M14W8N294)
(define-constant agent-7 'SP2791RKSYJJ39MVHC09J8NARWBMK5G9C79EJB0RV)
(define-constant agent-8 'SP2TW1D8YF5CE0NDP5VCR5NMTPHQ4PQR1KBB4NQ5Q)
(define-constant agent-9 'SP31WTJ415SNJM9H6202S3WK9AFQXQZMT48PESBQE)
(define-constant agent-10 'SP329G766AV8Z01X9EEAHPDQ4WDJXT2A0XB383MGP)
(define-constant agent-11 'SP3C5JYPB8YE5H9WC2SM196RVJ0JXN2GHCWXJWSES)
(define-constant agent-12 'SP3CRGM0QHHD36B57FXZW60EQS7NM6XJK8WC7T34S)
(define-constant agent-13 'SP3MMG05H6T48W5NJEEST0RR3FTPGKPM7C19X5M16)
(define-constant agent-14 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6)
(define-constant agent-15 'SPH9YG28V53YATFKTJHMDG19RRJT74YFNS2MYTGF)
(define-constant agent-16 'SPM1Q7YG18378H6W254YN8PABEVRPT38ZCY01SJD)
(define-constant agent-17 'SPP28QCMZ51GVN9933VFH9TXKQ3XCT4WE5A07533)
(define-constant agent-18 'SPV00QHST52GD7D0SEWV3R5N04RD4Q1PMA3TE2MP)
(define-constant agent-19 'SPV48Q8E5WP4TCQ63E9TV6KF9R4HP01Z8WS3FBTG)
(define-constant agent-0 'SP1PJ0M4N981B47GT6KERPKHN1APJH2T5NWZSV7GS)

(define-data-var agent-1-status bool false)
(define-data-var agent-2-status bool false)
(define-data-var agent-3-status bool false)
(define-data-var agent-4-status bool false)
(define-data-var agent-5-status bool false)
(define-data-var agent-6-status bool false)
(define-data-var agent-7-status bool false)
(define-data-var agent-8-status bool false)
(define-data-var agent-9-status bool false)
(define-data-var agent-10-status bool false)
(define-data-var agent-11-status bool false)
(define-data-var agent-12-status bool false)
(define-data-var agent-13-status bool false)
(define-data-var agent-14-status bool false)
(define-data-var agent-15-status bool false)
(define-data-var agent-16-status bool false)
(define-data-var agent-17-status bool false)
(define-data-var agent-18-status bool false)
(define-data-var agent-19-status bool false)


(define-data-var flag bool false)

(define-data-var deal bool false)

(define-constant deal-closed (err u300))
(define-constant cannot-escrow-nft (err u301))
(define-constant cannot-escrow-stx (err u302))
(define-constant sender-already-confirmed (err u303))
(define-constant non-tradable-agent (err u304))
(define-constant release-escrow-failed (err u305))
(define-constant deal-cancelled (err u306))
(define-constant escrow-not-ready (err u307))


;; u501 - Progress ; u502 - Cancelled ; u503 - Finished ; u504 - Escrow Ready
(define-data-var contract-status uint u501)


(define-read-only (check-contract-status) (ok (var-get contract-status)))

(define-private (check-deal) (if (and  (var-get agent-1-status) (var-get agent-2-status) (var-get agent-3-status) (var-get agent-4-status) (var-get agent-5-status) (var-get agent-6-status) (var-get agent-7-status) (var-get agent-8-status) (var-get agent-9-status) (var-get agent-10-status) (var-get agent-11-status) (var-get agent-12-status) (var-get agent-13-status) (var-get agent-14-status) (var-get agent-15-status) (var-get agent-16-status) (var-get agent-17-status) (var-get agent-18-status) (var-get agent-19-status) true) (ok true) (ok false)))

(define-private (check-deal-status) (unwrap-panic (if (and  (var-get agent-1-status) (var-get agent-2-status) (var-get agent-3-status) (var-get agent-4-status) (var-get agent-5-status) (var-get agent-6-status) (var-get agent-7-status) (var-get agent-8-status) (var-get agent-9-status) (var-get agent-10-status) (var-get agent-11-status) (var-get agent-12-status) (var-get agent-13-status) (var-get agent-14-status) (var-get agent-15-status) (var-get agent-16-status) (var-get agent-17-status) (var-get agent-18-status) (var-get agent-19-status)) deal-closed (ok true))))

(define-private (release-escrow)
(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u536250 tx-sender agent-1)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u40000000 tx-sender agent-2)))
	)
	(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.stx-youth transfer u3202 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u1269 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u2640 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u3312 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u3119 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u6611 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u4367 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u2325 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u538 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u536 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u3319 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u3105 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SPMS4E9RQ4GCGG68R6D15PKV01TYNCBPYZG1ZMFE.boomboxes-cycle-40 transfer u34 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SPDGT8F3WZCMWE4HTRXC7E5PM0CHE11SXAWRJ403.mosaic transfer u8 tx-sender agent-3)))
	(unwrap-panic (begin
		(as-contract (stx-transfer? u1400000 tx-sender agent-4)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u1072500 tx-sender agent-5)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u45011875 tx-sender agent-6)))
	)
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u1 tx-sender agent-7)))
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u8 tx-sender agent-7)))
	(unwrap-panic (as-contract (contract-call? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.the-smiley-collection transfer u49 tx-sender agent-8)))
	(unwrap-panic (as-contract (contract-call? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.the-smiley-collection transfer u243 tx-sender agent-8)))
	(unwrap-panic (begin
		(as-contract (stx-transfer? u18000000 tx-sender agent-9)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u21547500 tx-sender agent-10)))
	)
	(unwrap-panic (as-contract (contract-call? 'SP22GHCK5W3EK5VC1PEB3VVCBVFRQNTQXV9306QA0.bear-market-buddies transfer u110 tx-sender agent-11)))
	(unwrap-panic (as-contract (contract-call? 'SP2507VNQZC9VBXM7X7KB4SF4QJDJRSWHG4V39WPY.punk-donuts transfer u68 tx-sender agent-11)))
	(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.citadels transfer u580 tx-sender agent-11)))
	(unwrap-panic (begin
		(as-contract (stx-transfer? u1023750 tx-sender agent-12)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u100826000 tx-sender agent-13)))
	)
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.stackspy-nft transfer u26 tx-sender agent-14)))
		(as-contract (stx-transfer? u985827500 tx-sender agent-14)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u31687500 tx-sender agent-15)))
	)
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u3 tx-sender agent-16)))
	(unwrap-panic (as-contract (contract-call? 'SP2F2KH0RVX6GF1Y9FWMMSR9RHG0TW3NN72D724NX.the-purple-pill transfer u127 tx-sender agent-17)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.byzantion-cyborg transfer u17 tx-sender agent-17)))
	(unwrap-panic (as-contract (contract-call? 'SP2P6KSAJ4JVV8PFSNKJ9BNG5PEPR4RT71VXZHWBK.tiger-force transfer u204 tx-sender agent-17)))
	(unwrap-panic (begin
		(as-contract (stx-transfer? u101692750 tx-sender agent-18)))
	)
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u2 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u4 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u5 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u6 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u9 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u7 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u192 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u144 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP1XJ6GNTDVF6HR1VHPQDMFZJY87D9W6TGMH3QCP.meta-structures transfer u5 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u143 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.byte-fighters transfer u217 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.byte-fighters transfer u56 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u8602 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u3889 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u1892 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.slime-components-and-minions transfer u1661 tx-sender agent-19)))
	(unwrap-panic (as-contract (contract-call? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.slime-components-and-minions transfer u1373 tx-sender agent-19)))
	(unwrap-panic (begin
		(as-contract (stx-transfer? u78651628 tx-sender agent-0)))
	)

	(var-set deal true)
	(var-set contract-status u503)
	(ok true)
))

(define-private (cancel-escrow)
(begin        
	(if (is-eq (var-get agent-1-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP1XJ6GNTDVF6HR1VHPQDMFZJY87D9W6TGMH3QCP.meta-structures transfer u5 tx-sender agent-1)))
	(var-set agent-1-status false))
	true)
	(if (is-eq (var-get agent-2-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.byzantion-cyborg transfer u17 tx-sender agent-2)))
	(var-set agent-2-status false))
	true)
	(if (is-eq (var-get agent-3-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u162188355 tx-sender agent-3)))
	)
	(var-set agent-3-status false)
	)
	true
	)
	(if (is-eq (var-get agent-4-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.citadels transfer u580 tx-sender agent-4)))
	(var-set agent-4-status false))
	true)
	(if (is-eq (var-get agent-5-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u144 tx-sender agent-5)))
		(unwrap-panic (as-contract (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u192 tx-sender agent-5)))
	(var-set agent-5-status false))
	true)
	(if (is-eq (var-get agent-6-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP2P6KSAJ4JVV8PFSNKJ9BNG5PEPR4RT71VXZHWBK.tiger-force transfer u204 tx-sender agent-6)))
		(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u536 tx-sender agent-6)))
		(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u538 tx-sender agent-6)))
	(var-set agent-6-status false))
	true)
	(if (is-eq (var-get agent-7-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u256250000 tx-sender agent-7)))
	)
	(var-set agent-7-status false)
	)
	true
	)
	(if (is-eq (var-get agent-8-status) true)
	(begin
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP22GHCK5W3EK5VC1PEB3VVCBVFRQNTQXV9306QA0.bear-market-buddies transfer u110 tx-sender agent-8)))
		(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u1269 tx-sender agent-8)))
		(unwrap-panic (as-contract (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u1892 tx-sender agent-8)))
		(unwrap-panic (as-contract (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u3889 tx-sender agent-8)))
		(as-contract (stx-transfer? u42533500 tx-sender agent-8)))
	)
	(var-set agent-8-status false)
	)
	true
	)
	(if (is-eq (var-get agent-9-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.stackspy-nft transfer u26 tx-sender agent-9)))
	(var-set agent-9-status false))
	true)
	(if (is-eq (var-get agent-10-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u4367 tx-sender agent-10)))
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u6611 tx-sender agent-10)))
	(var-set agent-10-status false))
	true)
	(if (is-eq (var-get agent-11-status) true)
	(begin
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u2640 tx-sender agent-11)))
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u3319 tx-sender agent-11)))
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u3105 tx-sender agent-11)))
		(as-contract (stx-transfer? u23634148 tx-sender agent-11)))
	)
	(var-set agent-11-status false)
	)
	true
	)
	(if (is-eq (var-get agent-12-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u143 tx-sender agent-12)))
	(var-set agent-12-status false))
	true)
	(if (is-eq (var-get agent-13-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u2325 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u8602 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.slime-components-and-minions transfer u1661 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.slime-components-and-minions transfer u1373 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SPMS4E9RQ4GCGG68R6D15PKV01TYNCBPYZG1ZMFE.boomboxes-cycle-40 transfer u34 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SP2507VNQZC9VBXM7X7KB4SF4QJDJRSWHG4V39WPY.punk-donuts transfer u68 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.stx-youth transfer u3202 tx-sender agent-13)))
	(var-set agent-13-status false))
	true)
	(if (is-eq (var-get agent-14-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u1 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u2 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u3 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u4 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u5 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u6 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u7 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u8 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u9 tx-sender agent-14)))
	(var-set agent-14-status false))
	true)
	(if (is-eq (var-get agent-15-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP2F2KH0RVX6GF1Y9FWMMSR9RHG0TW3NN72D724NX.the-purple-pill transfer u127 tx-sender agent-15)))
	(var-set agent-15-status false))
	true)
	(if (is-eq (var-get agent-16-status) true)
	(begin
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.the-smiley-collection transfer u49 tx-sender agent-16)))
		(as-contract (stx-transfer? u145000000 tx-sender agent-16)))
	)
	(var-set agent-16-status false)
	)
	true
	)
	(if (is-eq (var-get agent-17-status) true)
	(begin
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SPDGT8F3WZCMWE4HTRXC7E5PM0CHE11SXAWRJ403.mosaic transfer u8 tx-sender agent-17)))
		(as-contract (stx-transfer? u99953750 tx-sender agent-17)))
	)
	(var-set agent-17-status false)
	)
	true
	)
	(if (is-eq (var-get agent-18-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.the-smiley-collection transfer u243 tx-sender agent-18)))
		(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.byte-fighters transfer u217 tx-sender agent-18)))
		(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.byte-fighters transfer u56 tx-sender agent-18)))
		(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u3119 tx-sender agent-18)))
		(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u3312 tx-sender agent-18)))
	(var-set agent-18-status false))
	true)
	(if (is-eq (var-get agent-19-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u697717500 tx-sender agent-19)))
	)
	(var-set agent-19-status false)
	)
	true
	)

	(var-set contract-status u502)
	(ok true)
))

(define-public (confirm-and-escrow)
(begin
	(asserts! (not (is-eq (var-get contract-status) u503)) deal-closed)
	(asserts! (not (is-eq (var-get contract-status) u502)) deal-cancelled)
	(var-set flag false)
	(unwrap-panic (begin
		(if (is-eq tx-sender agent-1)
		(begin
		(asserts! (is-eq (var-get agent-1-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP1XJ6GNTDVF6HR1VHPQDMFZJY87D9W6TGMH3QCP.meta-structures transfer u5 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-1-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-2)
		(begin
		(asserts! (is-eq (var-get agent-2-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.byzantion-cyborg transfer u17 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-2-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-3)
		(begin
		(asserts! (is-eq (var-get agent-3-status) false) sender-already-confirmed)
		(asserts! (is-ok (stx-transfer? u162188355 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-3-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-4)
		(begin
		(asserts! (is-eq (var-get agent-4-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.citadels transfer u580 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-4-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-5)
		(begin
		(asserts! (is-eq (var-get agent-5-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u144 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u192 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-5-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-6)
		(begin
		(asserts! (is-eq (var-get agent-6-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP2P6KSAJ4JVV8PFSNKJ9BNG5PEPR4RT71VXZHWBK.tiger-force transfer u204 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u536 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u538 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-6-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-7)
		(begin
		(asserts! (is-eq (var-get agent-7-status) false) sender-already-confirmed)
		(asserts! (is-ok (stx-transfer? u256250000 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-7-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-8)
		(begin
		(asserts! (is-eq (var-get agent-8-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP22GHCK5W3EK5VC1PEB3VVCBVFRQNTQXV9306QA0.bear-market-buddies transfer u110 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u1269 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u1892 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u3889 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (stx-transfer? u42533500 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-8-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-9)
		(begin
		(asserts! (is-eq (var-get agent-9-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.stackspy-nft transfer u26 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-9-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-10)
		(begin
		(asserts! (is-eq (var-get agent-10-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u4367 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u6611 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-10-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-11)
		(begin
		(asserts! (is-eq (var-get agent-11-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u2640 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u3319 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u3105 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (stx-transfer? u23634148 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-11-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-12)
		(begin
		(asserts! (is-eq (var-get agent-12-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP1XPG9QFX5M95G36SGN9R8YJ4KJ0JB7ZXNH892N6.consensus-2022 transfer u143 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-12-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-13)
		(begin
		(asserts! (is-eq (var-get agent-13-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u2325 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u8602 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.slime-components-and-minions transfer u1661 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.slime-components-and-minions transfer u1373 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPMS4E9RQ4GCGG68R6D15PKV01TYNCBPYZG1ZMFE.boomboxes-cycle-40 transfer u34 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2507VNQZC9VBXM7X7KB4SF4QJDJRSWHG4V39WPY.punk-donuts transfer u68 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.stx-youth transfer u3202 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-13-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-14)
		(begin
		(asserts! (is-eq (var-get agent-14-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u1 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u2 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u3 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u4 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u5 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u6 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u7 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u8 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3SC5PSKQM9ABTYPNYDV1J7SBGHA08VRW1DKTJK6.swapmeet-guests transfer u9 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-14-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-15)
		(begin
		(asserts! (is-eq (var-get agent-15-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP2F2KH0RVX6GF1Y9FWMMSR9RHG0TW3NN72D724NX.the-purple-pill transfer u127 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-15-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-16)
		(begin
		(asserts! (is-eq (var-get agent-16-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.the-smiley-collection transfer u49 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (stx-transfer? u145000000 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-16-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-17)
		(begin
		(asserts! (is-eq (var-get agent-17-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SPDGT8F3WZCMWE4HTRXC7E5PM0CHE11SXAWRJ403.mosaic transfer u8 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (stx-transfer? u99953750 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-17-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-18)
		(begin
		(asserts! (is-eq (var-get agent-18-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.the-smiley-collection transfer u243 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.byte-fighters transfer u217 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.byte-fighters transfer u56 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u3119 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u3312 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-18-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-19)
		(begin
		(asserts! (is-eq (var-get agent-19-status) false) sender-already-confirmed)
		(asserts! (is-ok (stx-transfer? u697717500 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-19-status true)
		(var-set flag true))
		true)

	(ok true)))

	(if (and  (var-get agent-1-status) (var-get agent-2-status) (var-get agent-3-status) (var-get agent-4-status) (var-get agent-5-status) (var-get agent-6-status) (var-get agent-7-status) (var-get agent-8-status) (var-get agent-9-status) (var-get agent-10-status) (var-get agent-11-status) (var-get agent-12-status) (var-get agent-13-status) (var-get agent-14-status) (var-get agent-15-status) (var-get agent-16-status) (var-get agent-17-status) (var-get agent-18-status) (var-get agent-19-status) true)
		(var-set contract-status u504)
		true)
	(if (is-eq (var-get flag) true) (ok true) non-tradable-agent)
))

(define-public (cancel)
(begin (check-deal-status)
	(if (or  (is-eq tx-sender agent-1) (is-eq tx-sender agent-2) (is-eq tx-sender agent-3) (is-eq tx-sender agent-4) (is-eq tx-sender agent-5) (is-eq tx-sender agent-6) (is-eq tx-sender agent-7) (is-eq tx-sender agent-8) (is-eq tx-sender agent-9) (is-eq tx-sender agent-10) (is-eq tx-sender agent-11) (is-eq tx-sender agent-12) (is-eq tx-sender agent-13) (is-eq tx-sender agent-14) (is-eq tx-sender agent-15) (is-eq tx-sender agent-16) (is-eq tx-sender agent-17) (is-eq tx-sender agent-18) (is-eq tx-sender agent-19))
	(begin
	(unwrap-panic (cancel-escrow))
	(ok true))
	non-tradable-agent)
))

(define-public (complete-neoswap)
(begin
	(asserts! (not (is-eq (var-get contract-status) u501)) escrow-not-ready)
	(asserts! (not (is-eq (var-get contract-status) u503)) deal-closed)
	(asserts! (not (is-eq (var-get contract-status) u502)) deal-cancelled)
	(unwrap-panic (release-escrow))
	(ok true)
))
