tx · BTT2t6sVT8BKhZmi7qZUTWYJvyUk3kqBvqyXu53uxLjD

3MxRqURevjNgwbz8kneeUwGPzCtszagdsx4:  -0.01400000 Waves

2020.11.20 11:43 [1273464] smart account 3MxRqURevjNgwbz8kneeUwGPzCtszagdsx4 > SELF 0.00000000 Waves

{ "type": 13, "id": "BTT2t6sVT8BKhZmi7qZUTWYJvyUk3kqBvqyXu53uxLjD", "fee": 1400000, "feeAssetId": null, "timestamp": 1605861809192, "version": 2, "chainId": 84, "sender": "3MxRqURevjNgwbz8kneeUwGPzCtszagdsx4", "senderPublicKey": "2qjcWuL7QitmuhkSTM7CnNxurCYXuqJ9ubswLBGmXfDv", "proofs": [ "5khP8Loqxau9QCbfw5MHrDBrYMzu4oLqd8vhRYPKpGssKaonaPC6qCG2E81feZAqLQHzcJ7WKSU3LcXB267rduTk" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAAAwAAAAARYWNjb3VudDFQdWJsaWNLZXkBAAAAIPeNeDDs4TWVhR1bzOk94lFsHOraL9B/FRj0XfVMj0hOAAAAABFhY2NvdW50MlB1YmxpY0tleQEAAAAgG1e/aEwKrtMkcq9WyiLLAHtKPJgLd/oAoUXcKuUDIhUAAAAADm90aGVyUHVibGljS2V5AQAAACDnblGJprjxGAm9jEz8V5M0TOEG6bhNvbMQquBNrx0dWgAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAABAAAABmNvdXBvbgQAAAADcG10CQEAAAAFdmFsdWUAAAABCAUAAAABaQAAAAhwYXltZW50cwMJAQAAAAlpc0RlZmluZWQAAAABCAkAAZEAAAACBQAAAANwbXQAAAAAAAAAAAAAAAAHYXNzZXRJZAkAAAIAAAABAgAAAAhvbmx5IHd3cwQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAGY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AFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDAwUAAAAQYWNjb3VudDFhY2NvdW50MgYFAAAADWFjY291bnQxb3RoZXIGBQAAAA1hY2NvdW50Mm90aGVy8g6peg==", "height": 1273464, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AvT16XRz5LeDDDYmFhfPZnVEeeoA3VgVrB8wgrF8BCW1 Next: none Diff:
OldNewDifferences
88 let otherPublicKey = base58'GaQkBG6yLLAarb8wvPrEKnQhFqWomD2ZGT1T4vVx24qw'
99
1010 @Callable(i)
11-func purchase () = {
11+func purchase (coupon) = {
1212 let pmt = value(i.payments)
1313 if (isDefined(pmt[0].assetId))
1414 then throw("only wws")
1515 else {
1616 let customerAddress = toBase58String(i.caller.bytes)
17- let price = match getInteger(this, "item_A_coupon_price") {
17+ let price = match getInteger(this, (coupon + "_coupon_price")) {
1818 case a: Int =>
1919 a
2020 case _ =>
2121 0
2222 }
23- if ((price > pmt[0].amount))
24- then throw("moar moeny")
25- else if ((pmt[0].amount > price))
26- then throw(toString(price))
27- else if ((size(pmt) > 1))
28- then throw("single item only")
29- else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)]
23+ if ((price == 0))
24+ then throw("coupon not found")
25+ else if ((price > pmt[0].amount))
26+ then throw("moar moeny")
27+ else if ((pmt[0].amount > price))
28+ then throw(toString(price))
29+ else if ((size(pmt) > 1))
30+ then throw("single item only")
31+ else [StringEntry(((("status:purchase_" + coupon) + "_customer_") + customerAddress), "confirmed"), IntegerEntry(((("price:purchase_" + coupon) + "_customer_") + customerAddress), price)]
3032 }
3133 }
3234
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let account1PublicKey = base58'HfLpRhXtnuCabRyNT6z7soaXcbUpwLUhjyBCVQ4szwzd'
55
66 let account2PublicKey = base58'2qjcWuL7QitmuhkSTM7CnNxurCYXuqJ9ubswLBGmXfDv'
77
88 let otherPublicKey = base58'GaQkBG6yLLAarb8wvPrEKnQhFqWomD2ZGT1T4vVx24qw'
99
1010 @Callable(i)
11-func purchase () = {
11+func purchase (coupon) = {
1212 let pmt = value(i.payments)
1313 if (isDefined(pmt[0].assetId))
1414 then throw("only wws")
1515 else {
1616 let customerAddress = toBase58String(i.caller.bytes)
17- let price = match getInteger(this, "item_A_coupon_price") {
17+ let price = match getInteger(this, (coupon + "_coupon_price")) {
1818 case a: Int =>
1919 a
2020 case _ =>
2121 0
2222 }
23- if ((price > pmt[0].amount))
24- then throw("moar moeny")
25- else if ((pmt[0].amount > price))
26- then throw(toString(price))
27- else if ((size(pmt) > 1))
28- then throw("single item only")
29- else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)]
23+ if ((price == 0))
24+ then throw("coupon not found")
25+ else if ((price > pmt[0].amount))
26+ then throw("moar moeny")
27+ else if ((pmt[0].amount > price))
28+ then throw(toString(price))
29+ else if ((size(pmt) > 1))
30+ then throw("single item only")
31+ else [StringEntry(((("status:purchase_" + coupon) + "_customer_") + customerAddress), "confirmed"), IntegerEntry(((("price:purchase_" + coupon) + "_customer_") + customerAddress), price)]
3032 }
3133 }
3234
3335
3436 @Verifier(tx)
3537 func verify () = {
3638 let account1 = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], account1PublicKey))
3739 then true
3840 else sigVerify(tx.bodyBytes, tx.proofs[1], account1PublicKey))
3941 then true
4042 else sigVerify(tx.bodyBytes, tx.proofs[2], account1PublicKey)
4143 let account2 = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], account2PublicKey))
4244 then true
4345 else sigVerify(tx.bodyBytes, tx.proofs[1], account2PublicKey))
4446 then true
4547 else sigVerify(tx.bodyBytes, tx.proofs[2], account2PublicKey)
4648 let other = if (if (sigVerify(tx.bodyBytes, tx.proofs[0], otherPublicKey))
4749 then true
4850 else sigVerify(tx.bodyBytes, tx.proofs[1], otherPublicKey))
4951 then true
5052 else sigVerify(tx.bodyBytes, tx.proofs[2], otherPublicKey)
5153 let account1account2 = if (account1)
5254 then account2
5355 else false
5456 let account1other = if (account1)
5557 then other
5658 else false
5759 let account2other = if (other)
5860 then account2
5961 else false
6062 match tx {
6163 case d: SetScriptTransaction =>
6264 true
6365 case d: DataTransaction =>
6466 true
6567 case _ =>
6668 if (if (account1account2)
6769 then true
6870 else account1other)
6971 then true
7072 else account2other
7173 }
7274 }
7375

github/deemru/w8io/169f3d6 
45.38 ms