tx · 9tih9QUyoYcE4Upfv9Eq3z3T4d1EVnt1rEcgTy7GLCvX 3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y: -0.04000000 Waves 2022.04.20 01:15 [2016027] smart account 3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y > SELF 0.00000000 Waves
{ "type": 13, "id": "9tih9QUyoYcE4Upfv9Eq3z3T4d1EVnt1rEcgTy7GLCvX", "fee": 4000000, "feeAssetId": null, "timestamp": 1650406564982, "version": 2, "chainId": 84, "sender": "3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y", "senderPublicKey": "AyAwWbMPM7a4VYkn1bhEBftC5WZgfvUXgrYDe98mvLsv", "proofs": [ "3dFkrWnnabaXdfMo3rj8s5SLXGVwwuftvAVC89FQTVmrwjFqSVUsQXqtyLBDaeVxazFK1uNVG2gXHb17wn81zPVQ" ], "script": "base64:AAIFAAAAAAAAABkIAhIFCgMICAESAwoBCBIECgIICBIDCgEIAAAACAAAAAAOZEFwcEFkZHJlc3NTdHICAAAAIzNON0o2bU1Na2pWVmlCUkV6OXk1M0ptY1g3cjdLWlJYUXBMAAAAAA1kQXBwUHVibGljS2V5AQAAACDgTQYFOGrUwRh8WaYap6j/gLstB4hjfa6yi718/WSaLAAAAAALZEFwcEFkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAADWRBcHBQdWJsaWNLZXkAAAAAEmhvbGRpbmdzQWRkcmVzc1N0cgIAAAAjM013UHNMeTlGMW1VUXJkUDM3c0NBS3ZIdUU1SHZQRTY3NFkAAAAAEWhvbGRpbmdzUHVibGljS2V5AQAAACCUHPJXjFSZKhe4nfSREpS677760EMCVtx/1OcRvCWqHQAAAAAPaG9sZGluZ3NBZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABFob2xkaW5nc1B1YmxpY0tleQAAAAAPdHJhbnNmZXJDb3N0UGN0AAAAAAAAAAAyAQAAAAhidXJ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AAAAAAYQAAAAAAAAAAYgAAAAAAAAAAYwAAAAAAAAAAZAAAAAAAAAAAZQAAAAAAAAAAZgAAAAAAAAAAZwAAAAAAAAAAaAAAAAAAAAAAaQAAAAAAAAAAagAAAAAAAAAAawAAAAAAAAAAbAAAAAAAAAAAbQAAAAAAAAAAbgAAAAAAAAAAbwAAAAAAAAAAcAAAAAAAAAAAcQAAAAAAAAAAcgAAAAAAAAAAcwAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAADAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkGCQAAAAAAAAIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkFAAAAD2hvbGRpbmdzQWRkcmVzcwYJAAAAAAAAAgkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQUAAAALZEFwcEFkZHJlc3M8KSEV", "height": 2016027, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Gm8JB9YSrucif8a1X7rGkWvFp4WvTpU4yStdyxKeenVr Next: 5JuRprkaNi8XDMkwvBM7yyEs7nvg5tRPGNMRCBi8WaYQ Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | let holdingsAddress = addressFromPublicKey(holdingsPublicKey) | |
15 | 15 | ||
16 | 16 | let transferCostPct = 50 | |
17 | + | ||
18 | + | func burnFold (accum,next) = { | |
19 | + | let resolvedNext = match next { | |
20 | + | case _: Unit => | |
21 | + | "unset" | |
22 | + | case val: String => | |
23 | + | val | |
24 | + | case _ => | |
25 | + | throw("Match error") | |
26 | + | } | |
27 | + | if ((resolvedNext == "unset")) | |
28 | + | then accum | |
29 | + | else { | |
30 | + | let assetId = match getString(this, (resolvedNext + "_assetId")) { | |
31 | + | case _: Unit => | |
32 | + | "unset" | |
33 | + | case val: String => | |
34 | + | val | |
35 | + | case _ => | |
36 | + | throw("Match error") | |
37 | + | } | |
38 | + | if ((assetId == "unset")) | |
39 | + | then accum | |
40 | + | else (accum ++ [Burn(fromBase58String(assetId), 1)]) | |
41 | + | } | |
42 | + | } | |
43 | + | ||
17 | 44 | ||
18 | 45 | @Callable(i) | |
19 | 46 | func addOwnerAndAmount (ownerId,assetId,amount) = [StringEntry((("sale_" + assetId) + "_originalOwner"), ownerId), IntegerEntry((("sale_" + assetId) + "_amount"), amount)] | |
87 | 114 | ||
88 | 115 | ||
89 | 116 | @Callable(i) | |
90 | - | func burnTest (assetId) = [Burn(fromBase58String(assetId), 1)] | |
117 | + | func burnSquares (coordsToBurn) = { | |
118 | + | let callerId = toBase58String(i.caller.bytes) | |
119 | + | if (if ((callerId != holdingsAddressStr)) | |
120 | + | then (callerId != dAppAddressStr) | |
121 | + | else false) | |
122 | + | then throw("This can only be triggering internally") | |
123 | + | else { | |
124 | + | let $l = split(coordsToBurn, "|") | |
125 | + | let $s = size($l) | |
126 | + | let $acc0 = nil | |
127 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
128 | + | then $a | |
129 | + | else burnFold($a, $l[$i]) | |
130 | + | ||
131 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
132 | + | then $a | |
133 | + | else throw("List size exceeds 115") | |
134 | + | ||
135 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100), 101), 102), 103), 104), 105), 106), 107), 108), 109), 110), 111), 112), 113), 114), 115) | |
136 | + | } | |
137 | + | } | |
91 | 138 | ||
92 | 139 | ||
93 | 140 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let dAppAddressStr = "3N7J6mMMkjVViBREz9y53JmcX7r7KZRXQpL" | |
5 | 5 | ||
6 | 6 | let dAppPublicKey = base58'G6aSmaqLJ4p7jzm7BnQcZuqa2NRRLVtzqdYNjYErnEZZ' | |
7 | 7 | ||
8 | 8 | let dAppAddress = addressFromPublicKey(dAppPublicKey) | |
9 | 9 | ||
10 | 10 | let holdingsAddressStr = "3MwPsLy9F1mUQrdP37sCAKvHuE5HvPE674Y" | |
11 | 11 | ||
12 | 12 | let holdingsPublicKey = base58'AyAwWbMPM7a4VYkn1bhEBftC5WZgfvUXgrYDe98mvLsv' | |
13 | 13 | ||
14 | 14 | let holdingsAddress = addressFromPublicKey(holdingsPublicKey) | |
15 | 15 | ||
16 | 16 | let transferCostPct = 50 | |
17 | + | ||
18 | + | func burnFold (accum,next) = { | |
19 | + | let resolvedNext = match next { | |
20 | + | case _: Unit => | |
21 | + | "unset" | |
22 | + | case val: String => | |
23 | + | val | |
24 | + | case _ => | |
25 | + | throw("Match error") | |
26 | + | } | |
27 | + | if ((resolvedNext == "unset")) | |
28 | + | then accum | |
29 | + | else { | |
30 | + | let assetId = match getString(this, (resolvedNext + "_assetId")) { | |
31 | + | case _: Unit => | |
32 | + | "unset" | |
33 | + | case val: String => | |
34 | + | val | |
35 | + | case _ => | |
36 | + | throw("Match error") | |
37 | + | } | |
38 | + | if ((assetId == "unset")) | |
39 | + | then accum | |
40 | + | else (accum ++ [Burn(fromBase58String(assetId), 1)]) | |
41 | + | } | |
42 | + | } | |
43 | + | ||
17 | 44 | ||
18 | 45 | @Callable(i) | |
19 | 46 | func addOwnerAndAmount (ownerId,assetId,amount) = [StringEntry((("sale_" + assetId) + "_originalOwner"), ownerId), IntegerEntry((("sale_" + assetId) + "_amount"), amount)] | |
20 | 47 | ||
21 | 48 | ||
22 | 49 | ||
23 | 50 | @Callable(i) | |
24 | 51 | func revokeForSale (assetId) = { | |
25 | 52 | let callerId = toBase58String(i.caller.bytes) | |
26 | 53 | let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) { | |
27 | 54 | case _: Unit => | |
28 | 55 | "unset" | |
29 | 56 | case x: String => | |
30 | 57 | x | |
31 | 58 | case _ => | |
32 | 59 | throw("Match error") | |
33 | 60 | } | |
34 | 61 | if ((callerId != ownerId)) | |
35 | 62 | then throw("Owners do not match") | |
36 | 63 | else [StringEntry((("sale_" + assetId) + "_originalOwner"), ""), IntegerEntry((("sale_" + assetId) + "_amount"), 0), ScriptTransfer(i.caller, 1, fromBase58String(assetId))] | |
37 | 64 | } | |
38 | 65 | ||
39 | 66 | ||
40 | 67 | ||
41 | 68 | @Callable(i) | |
42 | 69 | func buyFromHoldings (assetId,userText) = { | |
43 | 70 | let ownerId = match getString(this, (("sale_" + assetId) + "_originalOwner")) { | |
44 | 71 | case _: Unit => | |
45 | 72 | "unset" | |
46 | 73 | case x: String => | |
47 | 74 | x | |
48 | 75 | case _ => | |
49 | 76 | throw("Match error") | |
50 | 77 | } | |
51 | 78 | let paymentAmount = valueOrElse(i.payments[0].amount, 0) | |
52 | 79 | let amount = match getInteger(this, (("sale_" + assetId) + "_amount")) { | |
53 | 80 | case _: Unit => | |
54 | 81 | 0 | |
55 | 82 | case x: Int => | |
56 | 83 | x | |
57 | 84 | case _ => | |
58 | 85 | throw("Match error") | |
59 | 86 | } | |
60 | 87 | if (if ((ownerId == "unset")) | |
61 | 88 | then true | |
62 | 89 | else (ownerId == "")) | |
63 | 90 | then throw("Original owner not found ") | |
64 | 91 | else if (if ((amount == 0)) | |
65 | 92 | then true | |
66 | 93 | else (amount > paymentAmount)) | |
67 | 94 | then throw(((("Payment and amount do not match. This assets costs " + toString(amount)) + "but you sent ") + toString(paymentAmount))) | |
68 | 95 | else { | |
69 | 96 | let callerId = toBase58String(i.caller.bytes) | |
70 | 97 | let res = invoke(dAppAddress, "finalizeSale", [assetId, callerId, userText], [AttachedPayment(unit, 0)]) | |
71 | 98 | if ((res == res)) | |
72 | 99 | then { | |
73 | 100 | let transfer = [ScriptTransfer(i.caller, 1, fromBase58String(assetId)), StringEntry((("sale_" + assetId) + "_originalOwner"), ""), IntegerEntry((("sale_" + assetId) + "_amount"), 0)] | |
74 | 101 | if ((ownerId != holdingsAddressStr)) | |
75 | 102 | then { | |
76 | 103 | let amountToRemainInHoldings = (paymentAmount / transferCostPct) | |
77 | 104 | let amountToTransferToOwner = (paymentAmount - amountToRemainInHoldings) | |
78 | 105 | let ownerAddress = Address(fromBase58String(ownerId)) | |
79 | 106 | (transfer ++ [ScriptTransfer(ownerAddress, amountToTransferToOwner, unit)]) | |
80 | 107 | } | |
81 | 108 | else transfer | |
82 | 109 | } | |
83 | 110 | else throw("Strict value is not equal to itself.") | |
84 | 111 | } | |
85 | 112 | } | |
86 | 113 | ||
87 | 114 | ||
88 | 115 | ||
89 | 116 | @Callable(i) | |
90 | - | func burnTest (assetId) = [Burn(fromBase58String(assetId), 1)] | |
117 | + | func burnSquares (coordsToBurn) = { | |
118 | + | let callerId = toBase58String(i.caller.bytes) | |
119 | + | if (if ((callerId != holdingsAddressStr)) | |
120 | + | then (callerId != dAppAddressStr) | |
121 | + | else false) | |
122 | + | then throw("This can only be triggering internally") | |
123 | + | else { | |
124 | + | let $l = split(coordsToBurn, "|") | |
125 | + | let $s = size($l) | |
126 | + | let $acc0 = nil | |
127 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
128 | + | then $a | |
129 | + | else burnFold($a, $l[$i]) | |
130 | + | ||
131 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
132 | + | then $a | |
133 | + | else throw("List size exceeds 115") | |
134 | + | ||
135 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100), 101), 102), 103), 104), 105), 106), 107), 108), 109), 110), 111), 112), 113), 114), 115) | |
136 | + | } | |
137 | + | } | |
91 | 138 | ||
92 | 139 | ||
93 | 140 | @Verifier(tx) | |
94 | 141 | func verify () = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
95 | 142 | then true | |
96 | 143 | else (addressFromPublicKey(tx.senderPublicKey) == holdingsAddress)) | |
97 | 144 | then true | |
98 | 145 | else (addressFromPublicKey(tx.senderPublicKey) == dAppAddress) | |
99 | 146 |
github/deemru/w8io/169f3d6 31.44 ms ◑