tx · FVFJBeiCVa4Qz8kaAY1GxYSehi3i8zeaohgRBDTDSPGF

3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r:  -0.04000000 Waves

2022.03.29 17:37 [1985344] smart account 3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r > SELF 0.00000000 Waves

{ "type": 13, "id": "FVFJBeiCVa4Qz8kaAY1GxYSehi3i8zeaohgRBDTDSPGF", "fee": 4000000, "feeAssetId": null, "timestamp": 1648564647849, "version": 2, "chainId": 84, "sender": "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r", "senderPublicKey": "GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY", "proofs": [ "2t6HFMSRJF5dgxzoDUP8qwQzcN6DMVjbsi6hNfwDqk57mRA9VCS3jJEw1MZ95Yz65aqBN6SjH8mMA5kHReLKL82V" ], "script": "base64:AAIFAAAAAAAAACMIAhIECgIICBIECgIICBIFCgMICAgSBgoECAgICBIECgIIAQAAAA8AAAAABENPTFMAAAAAAAAABAAAAAAABFJPV1MAAAAAAAAABAAAAAAACW5mdERvbWFpbgIAAAAYaHR0cHM6Ly9uZnQuZ3JpZGdhbmcuaW8vAAAAABVhZGRPd25lckFuZEFtb3VudEZ1bmMCAAAAEWFkZE93bmVyQW5kQW1vdW50AAAAAAVERUJVRwYAAAAAEW1pbkZvclNhbGVXYXZsZXRzAAAAAAAF9eEAAAAAABBtaW5QdXJjaGFzZVByaWNlAAAAAAAAD0JAAAAAABFob2xkaW5nc1B1YmxpY0tleQkAAlkAAAABAgAAACxHVUh3MWprc3ROV1RzOVNYMUtNM3BNdHE5SFhqdXB2eGlUZDF1ck5oTm95WQAAAAAIaG9sZGluZ3MCAAAAIzNOOVI3dTQ0OVoxYjc2UXBKcDl1M2d6UGpNWVFZbnAzVjdyAAAAAA9ob2xkaW5nc0FkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAhob2xkaW5ncwEAAAAMZ2V0Q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AAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAPaG9sZGluZ3NBZGRyZXNzAAAAAAAAAAABCQACWQAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAARaG9sZGluZ3NQdWJsaWNLZXlM4GZi", "height": 1985344, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GogCgj5geErfEwGCbWqwpq6E72SLtFhzDLrQzWVEikyr Next: FhMinnN3MVQCa79guFG6Qpv1Nj8g52QjB9LsZHQhU5J9 Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let dAppAddressStr = "3N4vqUXWw8tf23LDWDbSEpJZH6dent3ETFu"
4+let COLS = 1024
55
6-let dAppPublicKey = base58'D4v2S9mjah7eEEmuQVBNd4WipC3scs8V4PjuDBweWatE'
6+let ROWS = 1024
77
8-let dAppAddress = addressFromPublicKey(dAppPublicKey)
8+let nftDomain = "https://nft.gridgang.io/"
99
10-let holdingsAddressStr = "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r"
10+let addOwnerAndAmountFunc = "addOwnerAndAmount"
1111
12-let holdingsPublicKey = base58'GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY'
12+let DEBUG = true
1313
14-let holdingsAddress = addressFromPublicKey(holdingsPublicKey)
14+let minForSaleWavlets = 100000000
1515
16-let transferCostPct = 50
16+let minPurchasePrice = 1000000
17+
18+let holdingsPublicKey = fromBase58String("GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY")
19+
20+let holdings = "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r"
21+
22+let holdingsAddress = Address(fromBase58String(holdings))
23+
24+func getAssetName (x,y) = {
25+ let name = ((x + ",") + y)
26+ name
27+ }
28+
29+
30+func getDataKeyPrefix (x,y,gen) = {
31+ let name = getAssetName(x, y)
32+ let prefix = ((name + ",") + gen)
33+ prefix
34+ }
35+
36+
37+func getXYGenFromName (name) = {
38+ let parts = split(name, ",")
39+ let tuple = $Tuple3(parts[0], parts[1], parts[2])
40+ tuple
41+ }
42+
43+
44+func getDataKeyPrefixFromAssetName (name) = {
45+ let $t0920960 = getXYGenFromName(name)
46+ let x = $t0920960._1
47+ let y = $t0920960._2
48+ let gen = $t0920960._3
49+ let prefix = getDataKeyPrefix(x, y, gen)
50+ prefix
51+ }
52+
53+
54+func claimSquare (x,y,gen,ownerId,transactionId) = {
55+ let resolvedXStr = x
56+ let resolvedYStr = y
57+ let resolvedGenStr = gen
58+ let assetName = getAssetName(resolvedXStr, resolvedYStr)
59+ let assetUrl = ((nftDomain + transactionId) + ".png")
60+ let asset = Issue(((assetName + ",") + resolvedGenStr), assetUrl, 1, 0, false)
61+ let assetId = calculateAssetId(asset)
62+ let dataKeyPrefix = getDataKeyPrefix(resolvedXStr, resolvedYStr, gen)
63+ $Tuple4(asset, assetId, assetUrl, dataKeyPrefix)
64+ }
65+
1766
1867 @Callable(i)
19-func addOwnerAndAmount (ownerId,assetId,amount) = [StringEntry((("sale_" + assetId) + "_originalOwner"), ownerId), IntegerEntry((("sale_" + assetId) + "_amount"), amount)]
68+func purchase (x,y) = {
69+ let prefix = getDataKeyPrefix(x, y, "1")
70+ let paymentAmount = valueOrElse(i.payments[0].amount, 0)
71+ let existingAssetId = match getString(this, (prefix + "_assetId")) {
72+ case _: Unit =>
73+ "unset"
74+ case err: String =>
75+ throw("This square has already been purchased")
76+ case _ =>
77+ throw("Match error")
78+ }
79+ if ((minPurchasePrice > paymentAmount))
80+ then throw((("You need to send at least " + toString(minPurchasePrice)) + "WAVLETS to purchase a square"))
81+ else {
82+ let ownerId = toBase58String(i.caller.bytes)
83+ let transactionId = toBase58String(i.transactionId)
84+ let $t021342229 = claimSquare(x, y, "1", ownerId, transactionId)
85+ let asset = $t021342229._1
86+ let assetId = $t021342229._2
87+ let assetUrl = $t021342229._3
88+ let dataKeyPrefix = $t021342229._4
89+[asset, StringEntry((dataKeyPrefix + "_assetId"), toBase58String(assetId)), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), ownerId), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(i.caller, 1, assetId)]
90+ }
91+ }
2092
2193
2294
2395 @Callable(i)
24-func revokeForSale (assetId) = {
96+func autoBuy (x,y) = {
2597 let callerId = toBase58String(i.caller.bytes)
26- let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
27- case _: Unit =>
28- "unset"
29- case x: String =>
30- x
31- case _ =>
32- throw("Match error")
33- }
34- if ((callerId != ownerId))
35- then throw("Owners do not match")
98+ if ((callerId != holdings))
99+ then throw("This can only be triggering internally")
36100 else {
37- let res = invoke(dAppAddress, "addOwnerAndAmount", ["", assetId, 0], [AttachedPayment(unit, 0)])
101+ let transactionId = toBase58String(i.transactionId)
102+ let $t027852881 = claimSquare(x, y, "1", holdings, transactionId)
103+ let asset = $t027852881._1
104+ let assetId = $t027852881._2
105+ let assetUrl = $t027852881._3
106+ let dataKeyPrefix = $t027852881._4
107+ let assetIdStr = toBase58String(assetId)
108+ let res = invoke(holdingsAddress, addOwnerAndAmountFunc, [holdings, assetId, 3], [AttachedPayment(unit, 0)])
38109 if ((res == res))
39- then [ScriptTransfer(i.caller, 1, fromBase58String(assetId))]
110+ then [asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), holdings), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(holdingsAddress, 1, assetId)]
40111 else throw("Strict value is not equal to itself.")
41112 }
42113 }
44115
45116
46117 @Callable(i)
47-func buyFromHoldings (assetId) = {
48- let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
49- case _: Unit =>
50- "unset"
51- case x: String =>
52- x
118+func promotionPurchase (x,y,desinationAddress) = {
119+ let callerId = toBase58String(i.caller.bytes)
120+ if ((callerId != holdings))
121+ then throw("This can only be triggering internally")
122+ else {
123+ let transactionId = toBase58String(i.transactionId)
124+ let $t036343739 = claimSquare(x, y, "1", desinationAddress, transactionId)
125+ let asset = $t036343739._1
126+ let assetId = $t036343739._2
127+ let assetUrl = $t036343739._3
128+ let dataKeyPrefix = $t036343739._4
129+ let assetIdStr = toBase58String(assetId)
130+[asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), desinationAddress), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(Address(fromBase58String(desinationAddress)), 1, assetId)]
131+ }
132+ }
133+
134+
135+
136+@Callable(i)
137+func evolve (x,y,gen,ownerId) = {
138+ let callerId = toBase58String(i.caller.bytes)
139+ if ((callerId != holdings))
140+ then throw("This can only be triggering internally")
141+ else {
142+ let transactionId = toBase58String(i.transactionId)
143+ let $t044024497 = claimSquare(x, y, gen, ownerId, transactionId)
144+ let asset = $t044024497._1
145+ let assetId = $t044024497._2
146+ let assetUrl = $t044024497._3
147+ let dataKeyPrefix = $t044024497._4
148+[asset, StringEntry((dataKeyPrefix + "_assetId"), toBase58String(assetId)), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), ownerId), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(Address(fromBase58String(ownerId)), 1, assetId)]
149+ }
150+ }
151+
152+
153+
154+@Callable(i)
155+func putForSale (assetId,amount) = {
156+ let callerId = toBase58String(i.caller.bytes)
157+ let assetData = match assetInfo(fromBase58String(assetId)) {
158+ case ass: Asset =>
159+ ass
53160 case _ =>
54- throw("Match error")
161+ throw("Asset not found")
55162 }
56- let paymentAmount = valueOrElse(i.payments[0].amount, 0)
57- let amount = match getInteger(this, (("sale_" + assetId) + "_amount")) {
58- case _: Unit =>
59- 0
60- case x: Int =>
61- x
163+ let dataPrefix = getDataKeyPrefixFromAssetName(assetData.name)
164+ let ownerId = match getString(this, (dataPrefix + "_owner")) {
165+ case s: String =>
166+ s
62167 case _ =>
63- throw("Match error")
168+ throw("Owner not found in data")
64169 }
65- if (if ((ownerId == "unset"))
66- then true
67- else (ownerId == ""))
68- then throw("Original owner not found ")
69- else if (if ((amount == 0))
70- then true
71- else (amount > paymentAmount))
72- then throw(((("Payment and amount do not match. This assets costs " + toString(amount)) + "but you sent ") + toString(paymentAmount)))
170+ if ((minForSaleWavlets > amount))
171+ then throw("Amount needs to be more than 1 wave")
172+ else if (if ((callerId != ownerId))
173+ then (callerId != holdings)
174+ else false)
175+ then throw("You are not able to put this asset up for sale")
73176 else {
74- let transfer = [ScriptTransfer(i.caller, 1, fromBase58String(assetId)), StringEntry((("sale_" + assetId) + "_originalOwner"), ""), IntegerEntry((("sale_" + assetId) + "_amount"), 0)]
75- if ((ownerId != holdingsAddressStr))
76- then {
77- let amountToRemainInHoldings = (paymentAmount / transferCostPct)
78- let amountToTransferToOwner = (paymentAmount - amountToRemainInHoldings)
79- let ownerAddress = Address(fromBase58String(ownerId))
80- (transfer ++ [ScriptTransfer(ownerAddress, amountToTransferToOwner, unit)])
81- }
82- else transfer
177+ let res = invoke(holdingsAddress, addOwnerAndAmountFunc, [callerId, assetId, amount], [AttachedPayment(unit, 0)])
178+ if ((res == res))
179+ then [ScriptTransfer(holdingsAddress, 1, fromBase58String(assetId))]
180+ else throw("Strict value is not equal to itself.")
83181 }
84182 }
85183
86184
87185 @Verifier(tx)
88-func verify () = true
186+func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
187+ then true
188+ else sigVerify(tx.bodyBytes, tx.proofs[0], holdingsPublicKey)
89189
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let dAppAddressStr = "3N4vqUXWw8tf23LDWDbSEpJZH6dent3ETFu"
4+let COLS = 1024
55
6-let dAppPublicKey = base58'D4v2S9mjah7eEEmuQVBNd4WipC3scs8V4PjuDBweWatE'
6+let ROWS = 1024
77
8-let dAppAddress = addressFromPublicKey(dAppPublicKey)
8+let nftDomain = "https://nft.gridgang.io/"
99
10-let holdingsAddressStr = "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r"
10+let addOwnerAndAmountFunc = "addOwnerAndAmount"
1111
12-let holdingsPublicKey = base58'GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY'
12+let DEBUG = true
1313
14-let holdingsAddress = addressFromPublicKey(holdingsPublicKey)
14+let minForSaleWavlets = 100000000
1515
16-let transferCostPct = 50
16+let minPurchasePrice = 1000000
17+
18+let holdingsPublicKey = fromBase58String("GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY")
19+
20+let holdings = "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r"
21+
22+let holdingsAddress = Address(fromBase58String(holdings))
23+
24+func getAssetName (x,y) = {
25+ let name = ((x + ",") + y)
26+ name
27+ }
28+
29+
30+func getDataKeyPrefix (x,y,gen) = {
31+ let name = getAssetName(x, y)
32+ let prefix = ((name + ",") + gen)
33+ prefix
34+ }
35+
36+
37+func getXYGenFromName (name) = {
38+ let parts = split(name, ",")
39+ let tuple = $Tuple3(parts[0], parts[1], parts[2])
40+ tuple
41+ }
42+
43+
44+func getDataKeyPrefixFromAssetName (name) = {
45+ let $t0920960 = getXYGenFromName(name)
46+ let x = $t0920960._1
47+ let y = $t0920960._2
48+ let gen = $t0920960._3
49+ let prefix = getDataKeyPrefix(x, y, gen)
50+ prefix
51+ }
52+
53+
54+func claimSquare (x,y,gen,ownerId,transactionId) = {
55+ let resolvedXStr = x
56+ let resolvedYStr = y
57+ let resolvedGenStr = gen
58+ let assetName = getAssetName(resolvedXStr, resolvedYStr)
59+ let assetUrl = ((nftDomain + transactionId) + ".png")
60+ let asset = Issue(((assetName + ",") + resolvedGenStr), assetUrl, 1, 0, false)
61+ let assetId = calculateAssetId(asset)
62+ let dataKeyPrefix = getDataKeyPrefix(resolvedXStr, resolvedYStr, gen)
63+ $Tuple4(asset, assetId, assetUrl, dataKeyPrefix)
64+ }
65+
1766
1867 @Callable(i)
19-func addOwnerAndAmount (ownerId,assetId,amount) = [StringEntry((("sale_" + assetId) + "_originalOwner"), ownerId), IntegerEntry((("sale_" + assetId) + "_amount"), amount)]
68+func purchase (x,y) = {
69+ let prefix = getDataKeyPrefix(x, y, "1")
70+ let paymentAmount = valueOrElse(i.payments[0].amount, 0)
71+ let existingAssetId = match getString(this, (prefix + "_assetId")) {
72+ case _: Unit =>
73+ "unset"
74+ case err: String =>
75+ throw("This square has already been purchased")
76+ case _ =>
77+ throw("Match error")
78+ }
79+ if ((minPurchasePrice > paymentAmount))
80+ then throw((("You need to send at least " + toString(minPurchasePrice)) + "WAVLETS to purchase a square"))
81+ else {
82+ let ownerId = toBase58String(i.caller.bytes)
83+ let transactionId = toBase58String(i.transactionId)
84+ let $t021342229 = claimSquare(x, y, "1", ownerId, transactionId)
85+ let asset = $t021342229._1
86+ let assetId = $t021342229._2
87+ let assetUrl = $t021342229._3
88+ let dataKeyPrefix = $t021342229._4
89+[asset, StringEntry((dataKeyPrefix + "_assetId"), toBase58String(assetId)), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), ownerId), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(i.caller, 1, assetId)]
90+ }
91+ }
2092
2193
2294
2395 @Callable(i)
24-func revokeForSale (assetId) = {
96+func autoBuy (x,y) = {
2597 let callerId = toBase58String(i.caller.bytes)
26- let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
27- case _: Unit =>
28- "unset"
29- case x: String =>
30- x
31- case _ =>
32- throw("Match error")
33- }
34- if ((callerId != ownerId))
35- then throw("Owners do not match")
98+ if ((callerId != holdings))
99+ then throw("This can only be triggering internally")
36100 else {
37- let res = invoke(dAppAddress, "addOwnerAndAmount", ["", assetId, 0], [AttachedPayment(unit, 0)])
101+ let transactionId = toBase58String(i.transactionId)
102+ let $t027852881 = claimSquare(x, y, "1", holdings, transactionId)
103+ let asset = $t027852881._1
104+ let assetId = $t027852881._2
105+ let assetUrl = $t027852881._3
106+ let dataKeyPrefix = $t027852881._4
107+ let assetIdStr = toBase58String(assetId)
108+ let res = invoke(holdingsAddress, addOwnerAndAmountFunc, [holdings, assetId, 3], [AttachedPayment(unit, 0)])
38109 if ((res == res))
39- then [ScriptTransfer(i.caller, 1, fromBase58String(assetId))]
110+ then [asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), holdings), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(holdingsAddress, 1, assetId)]
40111 else throw("Strict value is not equal to itself.")
41112 }
42113 }
43114
44115
45116
46117 @Callable(i)
47-func buyFromHoldings (assetId) = {
48- let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) {
49- case _: Unit =>
50- "unset"
51- case x: String =>
52- x
118+func promotionPurchase (x,y,desinationAddress) = {
119+ let callerId = toBase58String(i.caller.bytes)
120+ if ((callerId != holdings))
121+ then throw("This can only be triggering internally")
122+ else {
123+ let transactionId = toBase58String(i.transactionId)
124+ let $t036343739 = claimSquare(x, y, "1", desinationAddress, transactionId)
125+ let asset = $t036343739._1
126+ let assetId = $t036343739._2
127+ let assetUrl = $t036343739._3
128+ let dataKeyPrefix = $t036343739._4
129+ let assetIdStr = toBase58String(assetId)
130+[asset, StringEntry((dataKeyPrefix + "_assetId"), assetIdStr), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), desinationAddress), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(Address(fromBase58String(desinationAddress)), 1, assetId)]
131+ }
132+ }
133+
134+
135+
136+@Callable(i)
137+func evolve (x,y,gen,ownerId) = {
138+ let callerId = toBase58String(i.caller.bytes)
139+ if ((callerId != holdings))
140+ then throw("This can only be triggering internally")
141+ else {
142+ let transactionId = toBase58String(i.transactionId)
143+ let $t044024497 = claimSquare(x, y, gen, ownerId, transactionId)
144+ let asset = $t044024497._1
145+ let assetId = $t044024497._2
146+ let assetUrl = $t044024497._3
147+ let dataKeyPrefix = $t044024497._4
148+[asset, StringEntry((dataKeyPrefix + "_assetId"), toBase58String(assetId)), StringEntry((dataKeyPrefix + "_asset"), assetUrl), StringEntry((dataKeyPrefix + "_owner"), ownerId), StringEntry(transactionId, dataKeyPrefix), ScriptTransfer(Address(fromBase58String(ownerId)), 1, assetId)]
149+ }
150+ }
151+
152+
153+
154+@Callable(i)
155+func putForSale (assetId,amount) = {
156+ let callerId = toBase58String(i.caller.bytes)
157+ let assetData = match assetInfo(fromBase58String(assetId)) {
158+ case ass: Asset =>
159+ ass
53160 case _ =>
54- throw("Match error")
161+ throw("Asset not found")
55162 }
56- let paymentAmount = valueOrElse(i.payments[0].amount, 0)
57- let amount = match getInteger(this, (("sale_" + assetId) + "_amount")) {
58- case _: Unit =>
59- 0
60- case x: Int =>
61- x
163+ let dataPrefix = getDataKeyPrefixFromAssetName(assetData.name)
164+ let ownerId = match getString(this, (dataPrefix + "_owner")) {
165+ case s: String =>
166+ s
62167 case _ =>
63- throw("Match error")
168+ throw("Owner not found in data")
64169 }
65- if (if ((ownerId == "unset"))
66- then true
67- else (ownerId == ""))
68- then throw("Original owner not found ")
69- else if (if ((amount == 0))
70- then true
71- else (amount > paymentAmount))
72- then throw(((("Payment and amount do not match. This assets costs " + toString(amount)) + "but you sent ") + toString(paymentAmount)))
170+ if ((minForSaleWavlets > amount))
171+ then throw("Amount needs to be more than 1 wave")
172+ else if (if ((callerId != ownerId))
173+ then (callerId != holdings)
174+ else false)
175+ then throw("You are not able to put this asset up for sale")
73176 else {
74- let transfer = [ScriptTransfer(i.caller, 1, fromBase58String(assetId)), StringEntry((("sale_" + assetId) + "_originalOwner"), ""), IntegerEntry((("sale_" + assetId) + "_amount"), 0)]
75- if ((ownerId != holdingsAddressStr))
76- then {
77- let amountToRemainInHoldings = (paymentAmount / transferCostPct)
78- let amountToTransferToOwner = (paymentAmount - amountToRemainInHoldings)
79- let ownerAddress = Address(fromBase58String(ownerId))
80- (transfer ++ [ScriptTransfer(ownerAddress, amountToTransferToOwner, unit)])
81- }
82- else transfer
177+ let res = invoke(holdingsAddress, addOwnerAndAmountFunc, [callerId, assetId, amount], [AttachedPayment(unit, 0)])
178+ if ((res == res))
179+ then [ScriptTransfer(holdingsAddress, 1, fromBase58String(assetId))]
180+ else throw("Strict value is not equal to itself.")
83181 }
84182 }
85183
86184
87185 @Verifier(tx)
88-func verify () = true
186+func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
187+ then true
188+ else sigVerify(tx.bodyBytes, tx.proofs[0], holdingsPublicKey)
89189

github/deemru/w8io/169f3d6 
60.44 ms