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

(define-constant agent-1 'SP12VXAS7H2MT7R8116F4RA1FCS21DZ86B4DTN80J)
(define-constant agent-2 'SP13J4QQAWZCB64ZFQH8Y1BY9VD49VEJ30TJMRK1D)
(define-constant agent-3 'SP15B9DHAWWBDNNAF7B63T1TXJYQMB3FQTGWMQRGG)
(define-constant agent-4 'SP1JM5Y9J4T7J5XY9NX34SG1Z1BNAJT4H4NBHTPYD)
(define-constant agent-5 'SP1KBVBP3AZP7YA968Y3G14A17P9XXFPBPEVF5EG9)
(define-constant agent-6 'SP1Q6N226KFMA496MVWSB0VZC0T0R9FSKTYYYZ403)
(define-constant agent-7 'SP1T07GK9H4M0WP4N1DSSA7NJ7GNTQZ0GBZM0GAR2)
(define-constant agent-8 'SP1XJ6GNTDVF6HR1VHPQDMFZJY87D9W6TGMH3QCP)
(define-constant agent-9 'SP1XY24C7AJ8XZ2QQ5BMD43YWJBYAM388G00P354V)
(define-constant agent-10 'SP25KJH4N4YNKTVXSWSHDPVCWDFAN2BA4H2VQVN0G)
(define-constant agent-11 'SP2M63YGBZCTWBWBCG77RET0RMP42C08T73MKAPNP)
(define-constant agent-12 'SP2NM9ZX3A1NWJN5Q8X97RTC0AMG4FHBWSCZSYRPV)
(define-constant agent-13 'SP2TW1D8YF5CE0NDP5VCR5NMTPHQ4PQR1KBB4NQ5Q)
(define-constant agent-14 'SP31WTJ415SNJM9H6202S3WK9AFQXQZMT48PESBQE)
(define-constant agent-15 'SP3BTPH354JEM3E8AYAHQS9SWJ591TJQYD9QK0MCF)
(define-constant agent-16 'SP3C5JYPB8YE5H9WC2SM196RVJ0JXN2GHCWXJWSES)
(define-constant agent-17 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C)
(define-constant agent-18 'SP3QBRHQF4BN8HNNGFHCJMQZDB8V20BMGF2VS3MJ2)
(define-constant agent-19 'SP5G3VY7MZT8BNB6FHXZE9JD4PPF8WRT3H6JSBWW)
(define-constant agent-20 'SPH9YG28V53YATFKTJHMDG19RRJT74YFNS2MYTGF)
(define-constant agent-21 'SPHK8A7P61C6ASWKYDX1PCDX9YA54DKVJN49EXGJ)
(define-constant agent-22 'SPN3Y24JD5B17DN9Y8AEQGQV4VVWA644ACXBE3XE)
(define-constant agent-23 'SPV48Q8E5WP4TCQ63E9TV6KF9R4HP01Z8WS3FBTG)
(define-constant agent-24 'SPVDF4YJER5QZD2PEY7WEDY6ZX6EQ36V1WN5XME)
(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 agent-20-status bool false)
(define-data-var agent-21-status bool false)
(define-data-var agent-22-status bool false)
(define-data-var agent-23-status bool false)
(define-data-var agent-24-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) (var-get agent-20-status) (var-get agent-21-status) (var-get agent-22-status) (var-get agent-23-status) (var-get agent-24-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) (var-get agent-20-status) (var-get agent-21-status) (var-get agent-22-status) (var-get agent-23-status) (var-get agent-24-status)) deal-closed (ok true))))

(define-private (release-escrow)
(begin
	(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u64 tx-sender agent-1)))
	(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u65 tx-sender agent-1)))
	(unwrap-panic (as-contract (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u1890 tx-sender agent-2)))
	(unwrap-panic (as-contract (contract-call? 'SPERQB4H1J2RMFH105766940WT6K3R6RE6ZKMT9A.mr-wagmis-adventure transfer u19 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP2F2KH0RVX6GF1Y9FWMMSR9RHG0TW3NN72D724NX.the-purple-pill transfer u143 tx-sender agent-3)))
	(unwrap-panic (as-contract (contract-call? 'SP1MX3R99FENJJJVKW27DSA6X2M6SDSVJH4Y0HE23.pepepunks transfer u550 tx-sender agent-3)))
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP1CSHTKVHMMQJ7PRQRFYW6SB4QAW6SR3XY2F81PA.groober-city transfer u15 tx-sender agent-4)))
		(as-contract (stx-transfer? u18872500 tx-sender agent-4)))
	)
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u2724 tx-sender agent-5)))
		(as-contract (stx-transfer? u24548000 tx-sender agent-5)))
	)
	(unwrap-panic (as-contract (contract-call? 'SP3273YEPG4QZWX0ENQ98FBT1N2Y06XW820STP7NN.stacks-seductress-series-1 transfer u11 tx-sender agent-6)))
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u1104 tx-sender agent-7)))
		(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u2006 tx-sender agent-7)))
		(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u2015 tx-sender agent-7)))
		(as-contract (stx-transfer? u12400500 tx-sender agent-7)))
	)
	(unwrap-panic (as-contract (contract-call? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.stacculents transfer u165 tx-sender agent-8)))
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1132 tx-sender agent-9)))
		(as-contract (stx-transfer? u8750000 tx-sender agent-9)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u50000000 tx-sender agent-10)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u26000000 tx-sender agent-11)))
	)
	(unwrap-panic (as-contract (contract-call? 'SPGGAEQWA7Y9HRZY5T0XJCEYEZ28J6RKCCC1HP9M.worry-nft-music transfer u159 tx-sender agent-12)))
	(unwrap-panic (as-contract (contract-call? 'SPP28QCMZ51GVN9933VFH9TXKQ3XCT4WE5A07533.warrior-pigeons transfer u10 tx-sender agent-12)))
	(unwrap-panic (as-contract (contract-call? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.game-on-coins transfer u98 tx-sender agent-13)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.minotauri-nft transfer u533 tx-sender agent-13)))
	(unwrap-panic (begin
		(as-contract (stx-transfer? u29000000 tx-sender agent-14)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u90437500 tx-sender agent-15)))
	)
	(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u32 tx-sender agent-16)))
	(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u33 tx-sender agent-16)))
	(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1996 tx-sender agent-16)))
	(unwrap-panic (as-contract (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u6541 tx-sender agent-16)))
	(unwrap-panic (as-contract (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u6602 tx-sender agent-16)))
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP1XY24C7AJ8XZ2QQ5BMD43YWJBYAM388G00P354V.bitcoin-army transfer u13 tx-sender agent-17)))
		(unwrap-panic (as-contract (contract-call? 'SPFRNSJ3T6HSW1PJN2TAJZVKY3REYFCFDHETWJWG.stacks-punk-reloaded transfer u363 tx-sender agent-17)))
		(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u2667 tx-sender agent-17)))
		(unwrap-panic (as-contract (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u3823 tx-sender agent-17)))
		(as-contract (stx-transfer? u586510 tx-sender agent-17)))
	)
	(unwrap-panic (as-contract (contract-call? 'SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335.megapont-space-agency transfer u3188 tx-sender agent-18)))
	(unwrap-panic (as-contract (contract-call? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.blocks transfer u1710 tx-sender agent-18)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.wasteland-apes-nft transfer u4456 tx-sender agent-18)))
	(unwrap-panic (as-contract (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u1397 tx-sender agent-18)))
	(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1663 tx-sender agent-18)))
	(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u66 tx-sender agent-19)))
	(unwrap-panic (begin
		(as-contract (stx-transfer? u20000000 tx-sender agent-20)))
	)
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.stackspy-nft transfer u23 tx-sender agent-21)))
	(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u1224 tx-sender agent-21)))
	(unwrap-panic (as-contract (contract-call? 'SPJJYJVZ4H7B34GG8D3SSN70WVWDYSHCC9E9ZV4V.bitcoin-toadz transfer u2043 tx-sender agent-22)))
	(unwrap-panic (as-contract (contract-call? 'SPJJYJVZ4H7B34GG8D3SSN70WVWDYSHCC9E9ZV4V.bitcoin-toadz transfer u2939 tx-sender agent-22)))
	(unwrap-panic (as-contract (contract-call? 'SP3R8APMXYQRQC6JZAE376ZDVKJAQG5KYMTPV3F9E.bitcoin-flowers transfer u239 tx-sender agent-23)))
	(unwrap-panic (begin
		(as-contract (stx-transfer? u13500000 tx-sender agent-24)))
	)
	(unwrap-panic (begin
		(as-contract (stx-transfer? u12906510 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 (begin
		(unwrap-panic (as-contract (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u3823 tx-sender agent-1)))
		(as-contract (stx-transfer? u750000 tx-sender agent-1)))
	)
	(var-set agent-1-status false)
	)
	true
	)
	(if (is-eq (var-get agent-2-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u16912500 tx-sender agent-2)))
	)
	(var-set agent-2-status false)
	)
	true
	)
	(if (is-eq (var-get agent-3-status) true)
	(begin
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u1104 tx-sender agent-3)))
		(unwrap-panic (as-contract (contract-call? 'SP1CSHTKVHMMQJ7PRQRFYW6SB4QAW6SR3XY2F81PA.groober-city transfer u15 tx-sender agent-3)))
		(unwrap-panic (as-contract (contract-call? 'SPJJYJVZ4H7B34GG8D3SSN70WVWDYSHCC9E9ZV4V.bitcoin-toadz transfer u2043 tx-sender agent-3)))
		(unwrap-panic (as-contract (contract-call? 'SPJJYJVZ4H7B34GG8D3SSN70WVWDYSHCC9E9ZV4V.bitcoin-toadz transfer u2939 tx-sender agent-3)))
		(as-contract (stx-transfer? u55118750 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? 'SP1XY24C7AJ8XZ2QQ5BMD43YWJBYAM388G00P354V.bitcoin-army transfer u13 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? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.stacculents transfer u165 tx-sender agent-5)))
		(unwrap-panic (as-contract (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u1890 tx-sender agent-5)))
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.minotauri-nft transfer u533 tx-sender agent-5)))
	(var-set agent-5-status false))
	true)
	(if (is-eq (var-get agent-6-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u10500000 tx-sender agent-6)))
	)
	(var-set agent-6-status false)
	)
	true
	)
	(if (is-eq (var-get agent-7-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1996 tx-sender agent-7)))
		(unwrap-panic (as-contract (contract-call? 'SP3R8APMXYQRQC6JZAE376ZDVKJAQG5KYMTPV3F9E.bitcoin-flowers transfer u239 tx-sender agent-7)))
		(unwrap-panic (as-contract (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u6541 tx-sender agent-7)))
		(unwrap-panic (as-contract (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u6602 tx-sender agent-7)))
	(var-set agent-7-status false))
	true)
	(if (is-eq (var-get agent-8-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u15887500 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? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.game-on-coins transfer u98 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? 'SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335.megapont-space-agency transfer u3188 tx-sender agent-10)))
	(var-set agent-10-status false))
	true)
	(if (is-eq (var-get agent-11-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u1224 tx-sender agent-11)))
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u2724 tx-sender agent-11)))
	(var-set agent-11-status false))
	true)
	(if (is-eq (var-get agent-12-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u20037500 tx-sender agent-12)))
	)
	(var-set agent-12-status false)
	)
	true
	)
	(if (is-eq (var-get agent-13-status) true)
	(begin
	(unwrap-panic (begin
		(unwrap-panic (as-contract (contract-call? 'SPP28QCMZ51GVN9933VFH9TXKQ3XCT4WE5A07533.warrior-pigeons transfer u10 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SPERQB4H1J2RMFH105766940WT6K3R6RE6ZKMT9A.mr-wagmis-adventure transfer u19 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u64 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u65 tx-sender agent-13)))
		(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u66 tx-sender agent-13)))
		(as-contract (stx-transfer? u3287500 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? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.stackspy-nft transfer u23 tx-sender agent-14)))
		(unwrap-panic (as-contract (contract-call? 'SP1MX3R99FENJJJVKW27DSA6X2M6SDSVJH4Y0HE23.pepepunks transfer u550 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? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.blocks transfer u1710 tx-sender agent-15)))
		(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1132 tx-sender agent-15)))
		(unwrap-panic (as-contract (contract-call? 'SP3273YEPG4QZWX0ENQ98FBT1N2Y06XW820STP7NN.stacks-seductress-series-1 transfer u11 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? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u1397 tx-sender agent-16)))
		(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1663 tx-sender agent-16)))
		(unwrap-panic (as-contract (contract-call? 'SPGGAEQWA7Y9HRZY5T0XJCEYEZ28J6RKCCC1HP9M.worry-nft-music transfer u159 tx-sender agent-16)))
		(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u2006 tx-sender agent-16)))
		(unwrap-panic (as-contract (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u2015 tx-sender agent-16)))
		(unwrap-panic (as-contract (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u2667 tx-sender agent-16)))
		(unwrap-panic (as-contract (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.wasteland-apes-nft transfer u4456 tx-sender agent-16)))
		(as-contract (stx-transfer? u35862625 tx-sender agent-16)))
	)
	(var-set agent-16-status false)
	)
	true
	)
	(if (is-eq (var-get agent-17-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u32 tx-sender agent-17)))
		(unwrap-panic (as-contract (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u33 tx-sender agent-17)))
	(var-set agent-17-status false))
	true)
	(if (is-eq (var-get agent-18-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u93695145 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? u10500000 tx-sender agent-19)))
	)
	(var-set agent-19-status false)
	)
	true
	)
	(if (is-eq (var-get agent-20-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SP2F2KH0RVX6GF1Y9FWMMSR9RHG0TW3NN72D724NX.the-purple-pill transfer u143 tx-sender agent-20)))
	(var-set agent-20-status false))
	true)
	(if (is-eq (var-get agent-21-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u32560000 tx-sender agent-21)))
	)
	(var-set agent-21-status false)
	)
	true
	)
	(if (is-eq (var-get agent-22-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u1691250 tx-sender agent-22)))
	)
	(var-set agent-22-status false)
	)
	true
	)
	(if (is-eq (var-get agent-23-status) true)
	(begin
	(unwrap-panic (begin
		(as-contract (stx-transfer? u10198750 tx-sender agent-23)))
	)
	(var-set agent-23-status false)
	)
	true
	)
	(if (is-eq (var-get agent-24-status) true)
	(begin
		(unwrap-panic (as-contract (contract-call? 'SPFRNSJ3T6HSW1PJN2TAJZVKY3REYFCFDHETWJWG.stacks-punk-reloaded transfer u363 tx-sender agent-24)))
	(var-set agent-24-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? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u3823 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (stx-transfer? u750000 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(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 (stx-transfer? u16912500 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(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 (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u1104 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP1CSHTKVHMMQJ7PRQRFYW6SB4QAW6SR3XY2F81PA.groober-city transfer u15 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPJJYJVZ4H7B34GG8D3SSN70WVWDYSHCC9E9ZV4V.bitcoin-toadz transfer u2043 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPJJYJVZ4H7B34GG8D3SSN70WVWDYSHCC9E9ZV4V.bitcoin-toadz transfer u2939 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (stx-transfer? u55118750 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? 'SP1XY24C7AJ8XZ2QQ5BMD43YWJBYAM388G00P354V.bitcoin-army transfer u13 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? 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S.stacculents transfer u165 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP1SCEXE6PMGPAC6B4N5P2MDKX8V4GF9QDE1FNNGJ.SDGU-stackspunks transfer u1890 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.minotauri-nft transfer u533 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 (stx-transfer? u10500000 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(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 (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1996 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3R8APMXYQRQC6JZAE376ZDVKJAQG5KYMTPV3F9E.bitcoin-flowers transfer u239 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u6541 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u6602 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(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 (stx-transfer? u15887500 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? 'SP8HMQP4Q63V3E6SXXPXZ4WJXA263HBD95QY2AM3.game-on-coins transfer u98 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? 'SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335.megapont-space-agency transfer u3188 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? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u1224 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.steady-lads transfer u2724 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(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 (stx-transfer? u20037500 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(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? 'SPP28QCMZ51GVN9933VFH9TXKQ3XCT4WE5A07533.warrior-pigeons transfer u10 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPERQB4H1J2RMFH105766940WT6K3R6RE6ZKMT9A.mr-wagmis-adventure transfer u19 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u64 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u65 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u66 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (stx-transfer? u3287500 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(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? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.stackspy-nft transfer u23 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP1MX3R99FENJJJVKW27DSA6X2M6SDSVJH4Y0HE23.pepepunks transfer u550 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? 'SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.blocks transfer u1710 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1132 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3273YEPG4QZWX0ENQ98FBT1N2Y06XW820STP7NN.stacks-seductress-series-1 transfer u11 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? 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.free-punks-v0 transfer u1397 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u1663 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPGGAEQWA7Y9HRZY5T0XJCEYEZ28J6RKCCC1HP9M.worry-nft-music transfer u159 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u2006 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SPQZF23W7SEYBFG5JQ496NMY0G7379SRYEDREMSV.Candy transfer u2015 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2N3BAG4GBF8NHRPH6AY4YYH1SP6NK5TGCY7RDFA.stacks-mfers transfer u2667 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.wasteland-apes-nft transfer u4456 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (stx-transfer? u35862625 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? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u32 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(asserts! (is-ok (contract-call? 'SP3EB7YHV5NERS2HMCGSGKNMN0BEH52W9H7YE4T9C.pumpkin-heads transfer u33 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(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 (stx-transfer? u93695145 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(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? u10500000 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-19-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-20)
		(begin
		(asserts! (is-eq (var-get agent-20-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SP2F2KH0RVX6GF1Y9FWMMSR9RHG0TW3NN72D724NX.the-purple-pill transfer u143 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-20-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-21)
		(begin
		(asserts! (is-eq (var-get agent-21-status) false) sender-already-confirmed)
		(asserts! (is-ok (stx-transfer? u32560000 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-21-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-22)
		(begin
		(asserts! (is-eq (var-get agent-22-status) false) sender-already-confirmed)
		(asserts! (is-ok (stx-transfer? u1691250 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-22-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-23)
		(begin
		(asserts! (is-eq (var-get agent-23-status) false) sender-already-confirmed)
		(asserts! (is-ok (stx-transfer? u10198750 tx-sender (as-contract tx-sender))) cannot-escrow-stx )
		(var-set agent-23-status true)
		(var-set flag true))
		true)
		(if (is-eq tx-sender agent-24)
		(begin
		(asserts! (is-eq (var-get agent-24-status) false) sender-already-confirmed)
		(asserts! (is-ok (contract-call? 'SPFRNSJ3T6HSW1PJN2TAJZVKY3REYFCFDHETWJWG.stacks-punk-reloaded transfer u363 tx-sender (as-contract tx-sender))) cannot-escrow-nft )
		(var-set agent-24-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) (var-get agent-20-status) (var-get agent-21-status) (var-get agent-22-status) (var-get agent-23-status) (var-get agent-24-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) (is-eq tx-sender agent-20) (is-eq tx-sender agent-21) (is-eq tx-sender agent-22) (is-eq tx-sender agent-23) (is-eq tx-sender agent-24))
	(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)
))
